<> <> <> DIRECTORY ImagerPixelMaps USING [DeviceRectangle, Function, PixelMap]; ImagerScanConverter: CEDAR DEFINITIONS ~ BEGIN DeviceRectangle: TYPE ~ ImagerPixelMaps.DeviceRectangle; PixelMap: TYPE ~ ImagerPixelMaps.PixelMap; Function: TYPE ~ ImagerPixelMaps.Function; DevicePath: TYPE ~ REF DevicePathRep; PathProc: TYPE ~ PROC [ move: PROC [s, f: REAL], line: PROC [s, f: REAL], curve: PROC [s1, f1, s2, f2, s3, f3: REAL] <> ]; CreatePath: PROC [ pathProc: PathProc, clipBox: DeviceRectangle, scratch: DevicePath _ NIL -- for re-use of storage ] RETURNS [DevicePath]; BoundingBox: PROC [devicePath: DevicePath] RETURNS [DeviceRectangle]; <> NumberOfRuns: PROC [devicePath: DevicePath] RETURNS [numberOfRuns: INT]; <> ConvertToRuns: PROC [ devicePath: DevicePath, runProc: PROC [sMin, fMin: INTEGER, fSize: NAT], clipBox: DeviceRectangle, parityFill: BOOLEAN _ FALSE ]; ConvertToPixels: PROC [ devicePath: DevicePath, pixelMap: PixelMap, value: CARDINAL _ 1, parityFill: BOOLEAN _ FALSE, function: Function _ [null, null] ]; ConvertToManhattanPolygon: PROC [ devicePath: DevicePath, clipBox: DeviceRectangle, parityFill: BOOLEAN _ FALSE ] RETURNS [LIST OF DeviceRectangle]; <> <> DevicePathRep: PRIVATE TYPE ~ RECORD [ scanLineCrossings: INT, sMin, sMax, fMin, fMax: INTEGER, pointTable: PointTable, bucketTable: BucketTable, segmentList: LIST OF SegmentRep, pieceList: LIST OF PieceRep ]; PointTable: PRIVATE TYPE ~ REF PointTableRec; PointTableRec: PRIVATE TYPE ~ RECORD [ SEQUENCE maxLength: NAT OF Point ]; Point: TYPE ~ MACHINE DEPENDENT RECORD [ <<1 word long, ordered so it can be sorted like a cardinal>> fRel: NAT, -- relative to devicePath.fMin direction: Direction ]; Direction: TYPE ~ {increasing, decreasing}; BucketTable: PRIVATE TYPE ~ REF BucketTableRec; BucketTableRec: PRIVATE TYPE ~ RECORD [length: NAT, seq: SEQUENCE maxLength: NAT OF INTEGER]; SegmentRep: PRIVATE TYPE ~ RECORD [ sFirstScan: INTEGER, -- sFirstScan + 1/2 defines the first scan line that crosses this segment. direction: Direction, scanCount: NAT, -- number of scan lines that cross this segment. s0, f0, s1, f1: REAL ]; PieceRep: PRIVATE TYPE ~ RECORD [ sOrg, fOrg: INTEGER, -- in device units sScale: CARDINAL, sOffset: CARDINAL, sFirstScan: INTEGER, -- sFirstScan + 1/2 defines the first scan line that crosses this piece. scanCount: CARDINAL, -- number of scan lines that cross this piece. direction: Direction, iterationsUntilFlat: NAT, f0: CARDINAL, s1, f1: CARDINAL, s2, f2: CARDINAL, s3, f3: CARDINAL <> <<(fi/fScale + 1/2 + fOrg, (si+sOffset)/sScale + sOrg)>> ]; END.