ImagerMasks.mesa
Michael Plass, February 8, 1984 10:45:46 am PST
Provides device-resolution masks in a variety of representations. The coordinates are given in terms of s and f (for slow and fast).
DIRECTORY
ImagerBasic,
ImagerManhattan,
ImagerPixelMaps,
ImagerScanConverter
;
ImagerMasks: CEDAR DEFINITIONS ~ BEGIN
Data types
DeviceRectangle: TYPE ~ ImagerBasic.DeviceRectangle;
PixelMap: TYPE ~ ImagerPixelMaps.PixelMap;
PixelArray: TYPE ~ ImagerBasic.PixelArray;
Tile: TYPE ~ ImagerPixelMaps.Tile;
Function: TYPE ~ ImagerPixelMaps.Function;
PathMapType: TYPE ~ ImagerBasic.PathMapType;
Transformation: TYPE ~ ImagerBasic.Transformation;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
Mask: TYPE ~ REF;
Mask Creation
FromRectangle: PROC [box: DeviceRectangle] RETURNS [Mask];
FromManhattanPolygon: PROC [polygon: ImagerManhattan.Polygon] RETURNS [Mask];
Does not copy the list.
FromBitmap: PROC [pixelMap: PixelMap] RETURNS [Mask];
Does not copy the bits. Must be one bit per pixel.
FromDevicePath: PROC [devicePath: DevicePath] RETURNS [Mask];
Does not copy.
FromPixelArray: PROC [pixelArray: PixelArray, compositeTransformation: Transformation] RETURNS [Mask];
Mask Data Extraction
BoundingBox: PROC [mask: Mask] RETURNS [DeviceRectangle];
CountRuns: PROC [mask: Mask] RETURNS [numberOfRuns: INT];
An upper bound.
GenerateRuns: PROC [mask, clipper: Mask, runProc: PROC [sMin, fMin: INTEGER, fSize: NAT], sTranslate, fTranslate: INTEGER ← 0];
In order first by increasing sMin, then by increasing fMin.
The mask is translated by [sTranslate, fTranslate] before generating runs.
ApplyTile: PROC [mask, clipper: Mask, dest: PixelMap, tile: Tile, function: Function ← [null, null], sTranslate, fTranslate: INTEGER ← 0];
ApplyConstant: PROC [mask, clipper: Mask, dest: PixelMap, value: CARDINAL, function: Function ← [null, null], sTranslate, fTranslate: INTEGER ← 0];
ToPixelMap: PROC [mask, clipper: Mask, sTranslate, fTranslate: INTEGER ← 0, scratch: REF ImagerPixelMaps.PixelMapRep ← NIL]
RETURNS [PixelMap];
Causes copying.
ToManhattanPolygon: PROC [mask, clipper: Mask, sTranslate, fTranslate: INTEGER ← 0] RETURNS [ImagerManhattan.Polygon];
Causes copying.
PixelArrayFromPixelMap: PROC [pixelMap: PixelMap] RETURNS [PixelArray];
Does not copy the PixelMap
END.