<<>> <> <> <> <<>> MaskWithColor: DEFINITIONS = BEGIN Ptr: TYPE = LONG POINTER TO WORD; bitsPerUnit: NAT = BITS[UNIT]; bitsPerWord: NAT = BITS[WORD]; unitsPerWord: NAT = UNITS[WORD]; BitOffset: TYPE = [0..bitsPerWord); LogBitOffset: TYPE = [0..BITS[BitOffset]]; RunSeq: TYPE = LONG POINTER TO RunSeqRep; RunSeqRep: TYPE = RECORD [PACKED SEQUENCE len: CARDINAL OF RunByte]; RunByte: TYPE = WORD8 MACHINE DEPENDENT RECORD [ count: RunCount, -- the number of pixels to color or skip color: BOOL, -- color => store the color, else skip last: BOOL -- last => last run in the line ]; RunCount: TYPE = [1..64]; LongRunSeq: TYPE = LONG POINTER TO LongRunSeqRep; LongRunSeqRep: TYPE = RECORD [PACKED SEQUENCE len: CARDINAL OF LongRun]; LongRun: TYPE = MACHINE DEPENDENT RECORD [ fMin: CARD16, -- fMin is relative to the line start lastRun: BOOL, -- lastRun is TRUE for the last run in the line fSize: NAT15]; -- fSize is the length of the run <> MakeColorWord: PROC [sampleColor: WORD, logDepth: LogBitOffset] RETURNS [WORD]; <> StoreWithColorMask: PROC [ maskBase: Ptr, maskOffset: CARDINAL, maskWpl: CARDINAL, dstBase: Ptr, dstOffset: CARDINAL, dstWpl: CARDINAL, height: CARDINAL, width: CARDINAL, logDepth: LogBitOffset, colorWord: WORD]; <> <> <> <> <> <> <> <> <> <> <> <> StoreWithColorRuns: PROC [ mask: RunSeq, dstBase: Ptr, dstOffset: CARDINAL, dstWpl: CARDINAL, logDepth: LogBitOffset, colorWord: WORD]; <> <> <> <> <> <> <> <> <<>> StoreWithLongColorRuns: PROC [ mask: LongRunSeq, dstBase: Ptr, dstOffset: CARDINAL, dstWpl: CARDINAL, logDepth: LogBitOffset, colorWord: WORD]; <> <> <> <> <> <> <> <> <<>> BadRun: ERROR; MaskToRun: PROC [run: RunSeq, maskPtr: Ptr, offset: CARDINAL, wpl: CARDINAL, height: CARDINAL, width: CARDINAL] RETURNS [CARDINAL]; <> MaskToLongRun: PROC [run: LongRunSeq, maskPtr: Ptr, offset: CARDINAL, wpl: CARDINAL, height: CARDINAL, width: CARDINAL] RETURNS [CARDINAL]; <> END.