<> <> <> <> <> <<>> DIRECTORY Basics USING [LongMult], ImagerBasic USING [IntPair], ImagerPixelMaps USING [PixelMap, Function]; ImagerPixelMapsExtras: CEDAR DEFINITIONS IMPORTS Basics ~ BEGIN <> PixelMap: TYPE ~ ImagerPixelMaps.PixelMap; Function: TYPE ~ ImagerPixelMaps.Function; IntPair: TYPE ~ ImagerBasic.IntPair; ByteSequence: TYPE ~ RECORD [PACKED SEQUENCE length: CARDINAL OF [0..256)]; <> FillConstantTrap: PROC [destination: PixelMap, -- trapezoid, constant color top, bottom, leftTop, leftBot, rightTop, rightBot: NAT, pxlValue: CARDINAL, function: Function _ [null, null]]; FillSmoothTrap: PROC [ destination: PixelMap, -- trapezoid, bilinear interpolated 8-bit color top, bottom, leftTop, leftBot, rightTop, rightBot: NAT, leftTopVal, leftBotVal, rightTopVal, rightBotVal: NAT ]; DrawLine: PUBLIC PROC [destination: PixelMap, -- fast line, constant color p1, p2: IntPair, pxlValue: NAT, function: Function _ [null, null]]; DrawBltLine: PUBLIC PROC [destination: PixelMap, -- fast line using BitBLT, constant color p1, p2: IntPair, pxlValue: NAT, function: Function _ [null, null]]; LoadScanSeg: PUBLIC PROC[destination: PixelMap, s, f: INTEGER, length: NAT, segment: LONG POINTER, offset: NAT _ 0]; StoreScanSeg: PUBLIC PROC [source: PixelMap, s, f: INTEGER, length: NAT, segment: LONG POINTER, offset: NAT _ 0]; SetPixel: PROC [destination: PixelMap, s, f: INTEGER, value: NAT]; <> <<>> <> SetBit: PROC [dest: PixelMap, s, f: INTEGER, value: CARDINAL] ~ TRUSTED INLINE { LOOPHOLE[ dest.refRep.pointer + Basics.LongMult[(s - dest.sOrigin), dest.refRep.rast], LONG POINTER TO PACKED ARRAY [0..0) OF [0..2)] [f - dest.fOrigin] _ value; }; Set2Bits: PROC [dest: PixelMap, s, f: INTEGER, value: CARDINAL] ~ TRUSTED INLINE { LOOPHOLE[ dest.refRep.pointer + Basics.LongMult[(s - dest.sOrigin), dest.refRep.rast], LONG POINTER TO PACKED ARRAY [0..0) OF [0..4)] [f - dest.fOrigin] _ value; }; Set4Bits: PROC [dest: PixelMap, s, f: INTEGER, value: CARDINAL] ~ TRUSTED INLINE { LOOPHOLE[ dest.refRep.pointer + Basics.LongMult[(s - dest.sOrigin), dest.refRep.rast], LONG POINTER TO PACKED ARRAY [0..0) OF [0..16)] [f - dest.fOrigin] _ value; }; Set8Bits: PROC [dest: PixelMap, s, f: INTEGER, value: CARDINAL] ~ TRUSTED INLINE { LOOPHOLE[ dest.refRep.pointer + Basics.LongMult[(s - dest.sOrigin), dest.refRep.rast], LONG POINTER TO PACKED ARRAY [0..0) OF [0..256)] [f - dest.fOrigin] _ value; }; Set16Bits: PROC [dest: PixelMap, s, f: INTEGER, value: CARDINAL] ~ TRUSTED INLINE { LOOPHOLE[ dest.refRep.pointer + Basics.LongMult[(s - dest.sOrigin), dest.refRep.rast], LONG POINTER TO PACKED ARRAY [0..0) OF CARDINAL] [f - dest.fOrigin] _ value; }; END.