ImagerMasks.mesa
Copyright © 1984, Xerox Corporation. All rights reserved.
Michael Plass, February 8, 1984 10:45:46 am PST
Doug Wyatt, August 12, 1984 5:33:09 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
ImagerBasic USING [DeviceRectangle],
ImagerManhattan USING [Polygon],
ImagerPixelArrays USING [PixelArray],
ImagerPixelMaps USING [Function, PixelMap, PixelMapRep, Tile],
ImagerScanConverter USING [DevicePath],
ImagerTransform USING [Transformation];
ImagerMasks: CEDAR DEFINITIONS
~ BEGIN
Data types
DeviceRectangle: TYPE ~ ImagerBasic.DeviceRectangle;
PixelMap: TYPE ~ ImagerPixelMaps.PixelMap;
PixelArray: TYPE ~ ImagerPixelArrays.PixelArray;
Tile: TYPE ~ ImagerPixelMaps.Tile;
Function: TYPE ~ ImagerPixelMaps.Function;
Transformation: TYPE ~ ImagerTransform.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.