ImagerMask.mesa
Copyright © 1984, Xerox Corporation. All rights reserved.
Michael Plass, February 8, 1984 10:45:46 am PST
Doug Wyatt, October 10, 1984 4:04:51 pm PDT
Provides device-resolution masks in a variety of representations. The coordinates are given in terms of s and f (for slow and fast).
DIRECTORY
ImagerManhattan USING [Polygon],
ImagerPixelArray USING [PixelArray],
ImagerPixelMap USING [DeviceRectangle, Function, PixelMap, PixelMapRep, Tile],
ImagerScanConverter USING [DevicePath],
ImagerTransformation USING [Transformation];
ImagerMask: CEDAR DEFINITIONS
~ BEGIN
Data types
DeviceRectangle: TYPE ~ ImagerPixelMap.DeviceRectangle;
PixelMap: TYPE ~ ImagerPixelMap.PixelMap;
PixelArray: TYPE ~ ImagerPixelArray.PixelArray;
Tile: TYPE ~ ImagerPixelMap.Tile;
Function: TYPE ~ ImagerPixelMap.Function;
Transformation: TYPE ~ ImagerTransformation.Transformation;
ManhattanPolygon: TYPE ~ ImagerManhattan.Polygon;
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
Mask: TYPE ~ REF;
Mask Creation
FromRectangle: PROC [box: DeviceRectangle] RETURNS [Mask];
FromManhattanPolygon: PROC [polygon: ManhattanPolygon] RETURNS [Mask]
~ INLINE { RETURN[polygon] };
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]
~ INLINE { RETURN[devicePath] };
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 ImagerPixelMap.PixelMapRep ← NIL]
RETURNS [PixelMap];
Causes copying.
ToManhattanPolygon: PROC [mask, clipper: Mask, sTranslate, fTranslate: INTEGER ← 0] RETURNS [ManhattanPolygon];
Causes copying.
PixelArrayFromPixelMap: PROC [pixelMap: PixelMap] RETURNS [PixelArray];
Does not copy the PixelMap
END.