XeroxDecompress.mesa
Copyright © 1984, 1986 by Xerox Corporation. All rights reserved.
last edited by: castillo 20-Dec-84 15:46:12
Defines Procedure types that can be used for decompression in cases
where maxSampleValue = 1 and the result is a series of scanlines of
[0..1] bits in contiguous memory, padded with 0's to the next doubleword
there will be a separate implementation for each flavor of compression
Decompression occurs at the time the samples vector is needed
i.e. MakeSampledBlack or MaskPixel
DIRECTORY
Environment USING [Block];
XeroxDecompress: CEDAR DEFINITIONS
= BEGIN
DecompressFlavor: TYPE = {-- the first 3 direct from the RES standard
adaptive,
ccitt,
compressed, -- formerly IMG
those below non-standard and 'modified'
huffman,
read};
DecompressInfo: TYPE = RECORD [
scanLength: NATURAL, -- number of pixels (in this case, bits) in scanline
flavor: DecompressFlavor,
private: REF]; -- to impl's private data
DecompressHandle: TYPE = REF DecompressInfo;
Error: ERROR [line: CARDINAL];
error while decompressing. The decompressor should free up
the resources allocated before raising this error.
InitProc: TYPE = PROCEDURE [v: Environment.Block] RETURNS [h: DecompressHandle];
v points to the data bytes in a sequenceLargeVector where bytesInInt = 2
and the vector may have been of a one of the compressed flavors
DoneProc: TYPE = PROCEDURE [h: DecompressHandle];
NextLineProc: TYPE = PROCEDURE [h: DecompressHandle, out: LONG POINTER]
RETURNS
[valid: BOOLEAN];
caller assures "out" points to space enough for one scanline
valid = TRUE up through last scan line
AdaptiveInit: InitProc;
AdaptiveNextLine: NextLineProc;
AdaptiveDone: DoneProc;
CcittInit: InitProc;
CcittNextLine: NextLineProc;
CcittDone: DoneProc;
CompressedInit: InitProc;
CompressedNextLine: NextLineProc;
CompressedDone: DoneProc;
HuffmanInit: InitProc;
HuffmanNextLine: NextLineProc;
HuffmanDone: DoneProc;
ReadInit: InitProc;
ReadNextLine: NextLineProc;
ReadDone: DoneProc;
END.
LOG
5Nov84 - castillo.
Newlin 5-Nov-84 modify flavor names, add RETURNS to NextLine & add specific PROCS.
16Nov84 - castillo - changed Init parms, added Error.
20Dec84 - castillo - changed the LONG POINTER in Init for a Env.BLock.
Rick Beach, June 17, 1986 12:01:57 pm PDT
Converted to Cedar