Last updated at 3:23 pm UTC on 14 January 2006
- BitBlt implements a basic graphical operation.
Citation from LaLonde and Pugh I p. 393:
Instances of class BitBlt (Block Transfer) describe a single graphical operation (often copy operations)
Operations on objects are normally described as methods, not by instances of a class.
Very often, large numbers of copy operations are carried out in a context where most of these parameters remain the same. As a result, it was decided to use instances of a class (BitBlt) rather than a method to represent copy operations.
The copy operations are carried out when a copyBits message is sent to an initialized instance of class BitBlt. Method 'copyBits' is a primitive operation that can be optimised to take advantage of any special bit copying hardware that may be available on the host computer. Operation 'copyBits' is so fundamental that small increases in its performance have dramatic effects on the responsiveness of the Smalltalk user interface as a whole.
The name BitBlt is derived from a powerful bit-boundary block transfer instruction of that name found on one of the first machines to support Smalltalk, the Xerox Alto. RasterOp is a synonym for BitBlt in many graphics systems. All text and graphical operations in Smalltalk can be described in terms of Copying some source (not necessarily visible) Form to a Destination Form.
...Displaying a text string involves copying the
Form representing each character (see class BitBlt) in the string onto the display in sequence.
Example: The following (somewhat artificial) code copies a square area (0 @ 0 to 100 @ 100) from the display onto another area on the display.
combinationRule: Form over
clipRect: Display computeBoundingBox)
January 04, 2004 Boris Gaertner relied to the following questionf from Martin Kuball
Question: I'm trying to do some image processing in Squeak. I load an image into a Form and than use a BitBlt peeker to examine pixel values. After some hacking I > noticed that the indexing is not 1-based as in other Smalltalk methods. Is > this on purpose or a bug?
Answer: > This is not a bug. In a Form, pixel coordinates run from
0 to: form width - 1 in the horizontal and from 0 to: form height - 1 in the vertical.
This is Smalltalk tradition, but it is not mentioned very often. In the blue book, we read on page 383 (reprint of May 1983):
"A display object represents an image that has a width, a height, an assumed origin at 0 @ 0, and an offset ..."
See Video input for examples of using BitBlt