DIRECTORY Basics USING [LongMult], PrincOps USING [DstFunc, SrcFunc]; PDInterpBitmap: DEFINITIONS IMPORTS Basics = BEGIN -- ^ -- f | -- | -- | +----------------------------+ -- | | | -- | |rast * bitsPerWord / bitsPerPixel | -- | | | -- | | +------------+ | -- | | | | | -- | | | | | -- | | |fSize | | -- | | | | | -- | | sMin | sSize | | -- | |<-- -->+------------+ | -- | | ^ | -- | | |fMin | -- | sOrigin | v lines | -- |<-------->+----------------------------+ -- | ^origin of buffer -- | | -- | |fOrigin -- | | -- | | -- | v -- +--------------------------------------------> -- Device space origin s BitmapDesc: TYPE = RECORD [ sOrigin, fOrigin: INTEGER _ 0, sMin, fMin: INTEGER _ 0, sSize, fSize: NAT _ 0, pointer: LONG POINTER _ NIL, rast, lines: CARDINAL _ 0 ]; Rectangle: TYPE = RECORD [sMin, fMin: INTEGER, sSize, fSize: NAT]; RasterWords: PROC [bitmapDesc: BitmapDesc] RETURNS [INT] = INLINE { RETURN [Basics.LongMult[bitmapDesc.rast, bitmapDesc.lines]]; }; Reshape: PROC [pointer: LONG POINTER, words: INT, bounds: Rectangle] RETURNS [BitmapDesc]; InsufficientSpace: ERROR; Intersect: PROC [a, b: Rectangle] RETURNS [Rectangle]; Clear: PROC [bitmapDesc: BitmapDesc]; ShiftMap: PROC [p: BitmapDesc, s, f: INTEGER] RETURNS [BitmapDesc]; ShiftWindow: PROC [p: BitmapDesc, s, f: INTEGER] RETURNS [BitmapDesc]; Clip: PROC [p: BitmapDesc, bounds: Rectangle] RETURNS [BitmapDesc]; SetWindow: PROC [p: BitmapDesc, bounds: Rectangle] RETURNS [BitmapDesc]; Window: PROC [p: BitmapDesc] RETURNS [Rectangle]; BufferBounds: PROC [p: BitmapDesc] RETURNS [Rectangle]; BoundedWindow: PROC [p: BitmapDesc] RETURNS [Rectangle]; Fill: PROC [dest: BitmapDesc, area: Rectangle, value: CARDINAL, function: Function _ [null, null]]; Function: TYPE = RECORD [dstFunc: PrincOps.DstFunc, srcFunc: PrincOps.SrcFunc]; Transfer: PROC [dest, source: BitmapDesc, function: Function _ [null, null]]; Tile: TYPE = RECORD [ sOrigin, fOrigin: INTEGER, sSize, fSize: NAT, phase: INTEGER, pointer: LONG POINTER, rast, lines: CARDINAL ]; CreateTile: PROC [rectangle: Rectangle, phase: INTEGER _ 0, rasterPointer: LONG POINTER, scratchPointer: LONG POINTER _ NIL, scratchWords: INT _ 0] RETURNS [tile: Tile]; TransferTile: PROC [dest: BitmapDesc, tile: Tile, function: Function _ [null, null]]; END. ˜PDInterpBitmap.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Michael Plass, November 9, 1983 10:39 am Basic operations on two-dimensional arrays of pixels. Tim Diebert: September 19, 1985 2:37:43 pm PDT This interface provides most of the functionality of BitBlt. To avoid confusion no matter how the map is physically laid out, terms like height and width are avoided, and the coordinates are expressed in terms of s and f, for slow and fast. On a display, the s axis is normally vertical, and points down, but on a printer that scans in the long direction, the f axis will point up. The diagram below takes the latter point of view. A BitmapDesc describes a window into a buffer, and the buffer itself may be positioned anywhere in a global device space. The windowing information is stored in the BitmapDesc record, so that it may be easily changed to accomplish translation and clipping by rectangles. The translation feature may be used for destination maps to conveniently implement band buffers. These parameters define a window within the buffer, as well as where the buffer is positioned in device space. Stored contiguously, with each line padded to a word boundary, rast words per line. The long pointer points to the actual bits. Makes a PixelMap from the storage provided. Computes the intersection of device rectangles. A fast way to clear a buffer. Translates the bitmapDesc in device space. Translates the window in device space. Further restricts the window Changes the window Returns a rectangle describing the actual bounds of the buffer p.Window.Intersect[p.BufferBounds] [null, null] makes zero bits white, one bits black [or, null] makes zero bits transparent, one bits black [and, null] makes zero bits white, one bits black [and, complement] makes zero bits transparent, one bits white [xor, null] makes zero bits transparent, one bits inverted etcetera. Does a BITBLT from the source to the dest, through the intersection of the two windows. Does the right thing if the source and dest overlap in the same buffer. A tile is similar to a BitmapDesc, but the window specifications are more primitive, and there is an additional phase specification. A tile is replicated to fill the plane, with tile shifted by phase pixels in the f direction every source.sSize lines. The scratchPointer and scratchWords parameters describe the space for the results. The raster is turned into a tile. This may involve replicating the pattern to make a larger tile that will speed the coloring operation, so the size of the result will not in general be the same as the source. However, the raster may not always be copied. Transfers from the tiled plane to dest. Κš˜šœ™Icodešœ Οmœ1™K˜—š₯ œžœžœ ˜8Kšœ"™"K˜—š₯œžœ,žœ%˜cK˜—šœ žœžœ8˜OKšœ2™2K™6K™1K™=K™:K™ K˜—š₯œžœ?˜MKšœžœ“™ K˜—šœžœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœ žœžœ˜Kšœ ž˜Kšœ˜Kšœό™όK˜—š₯ œžœžœžœžœžœžœžœžœžœ˜©KšœΥ™ΥK˜—š₯ œžœC˜UKšœ'™'K™—Kšžœ˜——…— Τ