ImagerPixelSeq.mesa
Copyright (C) 1984, 1985, Xerox Corporation. All rights reserved.
Written October 29, 1984
Michael Plass, October 18, 1985 11:43:45 am PDT
DIRECTORY ImagerPixelMap, ImagerTransformation;
ImagerPixelSeq: CEDAR DEFINITIONS ~ BEGIN
PixelMap: TYPE ~ ImagerPixelMap.PixelMap;
Transformation: TYPE ~ ImagerTransformation.Transformation;
Pixel: TYPE ~ CARDINAL;
PixelSeq: TYPE ~ REF PixelSeqRep;
PixelSeqRep: TYPE ~ RECORD [
SEQUENCE maxSize: NAT OF Pixel
];
Create: PROC [maxSize: NAT] RETURNS [new: PixelSeq];
ObtainScratch: PROC [maxSize: NAT] RETURNS [PixelSeq];
Gets one from a small pool. OK to drop it on the floor sometimes, but don't release twice!
ReleaseScratch: PROC [pixelSeq: PixelSeq];
Clear: PROC [pixelSeq: PixelSeq, size: NAT];
Copy: PROC [pixelSeq: PixelSeq, size: NAT, scratch: PixelSeq ← NIL] RETURNS [new: PixelSeq];
Add: PROC [dest, source: PixelSeq, size: NAT];
Subtract: PROC [dest, source: PixelSeq, size: NAT];
Apply: PROC [dest, source: PixelSeq, size: NAT, table: PixelSeq];
dest[i] ← table[source[i]]
ApplyAndAdd: PROC [dest, source: PixelSeq, size: NAT, table: PixelSeq];
dest[i] ← dest[i] + table[source[i]-table.origin]
LoadF: PROC [pixelSeq: PixelSeq, s, f: INTEGER, size: NAT, source: PixelMap];
LoadS: PROC [pixelSeq: PixelSeq, s, f: INTEGER, size: NAT, source: PixelMap];
StoreF: PROC [pixelSeq: PixelSeq, s, f: INTEGER, size: NAT, dest: PixelMap];
StoreS: PROC [pixelSeq: PixelSeq, s, f: INTEGER, size: NAT, dest: PixelMap];
TransferSamples: PROC [dest, source: PixelMap, transformation: Transformation, tile: BOOLEANFALSE, multiplier: CARDINAL ← 1, lgScale: INTEGER ← 0];
UnderSample: PROC [pixelMap: PixelMap, transformation: Transformation, tile: BOOLEANFALSE, background: CARDINAL ← 0, scratch: REF ImagerPixelMap.PixelMapRep ← NIL] RETURNS [PixelMap];
BoxFilter: PROC [pixelMap: PixelMap, sSizeBox, fSizeBox: NAT];
ChangeBitsPerPixel: PROC [pixelMap: PixelMap, newLgBitsPerPixel: [0..4], scratch: REF ImagerPixelMap.PixelMapRep ← NIL] RETURNS [PixelMap];
Renormalize: PROC [pixelMap: PixelMap, oldmin, oldmax, newmin, newmax: REAL];
END.