ImagerScanConverter.mesa
Michael Plass, October 3, 1983 1:28 pm
DIRECTORY ImagerPixelMaps;
ImagerScanConverter: CEDAR DEFINITIONS ~ BEGIN
DeviceRectangle: TYPE ~ ImagerPixelMaps.DeviceRectangle;
bigRectangle: DeviceRectangle ~ [sMin: -big/2, fMin: -big/2, sSize: big, fSize: big];
big: PRIVATE INTEGER ~ LAST[NAT];
PixelMap: TYPE ~ ImagerPixelMaps.PixelMap;
Function: TYPE ~ ImagerPixelMaps.Function;
DevicePath: TYPE ~ REF DevicePathRep;
DevicePathRep: TYPE;
PathProc: TYPE ~ PROC [
move: PROC [s, f: REAL],
line: PROC [s, f: REAL],
curve: PROC [s1, f1, s2, f2, s3, f3: REAL]
control points of a bezier cubic
];
CreatePath: PROC [
pathProc: PathProc,
clipBox: DeviceRectangle ← bigRectangle,
scratch: DevicePath ← NIL -- for re-use of storage
] RETURNS [DevicePath];
BoundingBox: PROC [devicePath: DevicePath] RETURNS [DeviceRectangle];
Not always as tight as possible, but should be pretty close.
NumberOfRuns: PROC [devicePath: DevicePath] RETURNS [numberOfRuns: INT];
Guaranteed to be an upper bound, should be close to the actual.
ConvertToRuns: PROC [
devicePath: DevicePath,
runProc: PROC [sMin, fMin: INTEGER, fSize: NAT],
clipBox: DeviceRectangle ← bigRectangle,
parityFill: BOOLEANFALSE
];
ConvertToPixels: PROC [
devicePath: DevicePath,
pixelMap: PixelMap,
value: CARDINAL ← 1,
parityFill: BOOLEANFALSE,
function: Function ← [null, null]
];
END.