PDInterpReader.mesa
Michael Plass, November 18, 1983 10:21 am
Last Edited by: Pier, November 22, 1983 2:44 pm
DIRECTORY PDInterpBasic, PDFileFormat, PDInterpBitmap;
PDInterpReader: DEFINITIONS = BEGIN
Handle definition
Handle: TYPE = LONG POINTER TO Rep;
Rep: TYPE = RECORD [
herald: PDFileFormat.Herald,
image: PDFileFormat.StartImage,
bandNumber: CARDINAL,
sMinBand: CARDINAL,
sSizeBand: CARDINAL,
colorType: ColorType,
colorTileLoadAddress: INT,
priority: INT,
loadWords: INT,
private: LONG POINTER TO PrivateRep,
index: INT,
page: INT,
pass: INT,
status: PDInterpBasic.Status,
warningCount: INT
];
ColorType: TYPE = {none, clear, ink, opaqueTile, transparentTile};
PrivateRep: TYPE;
Color Tile access:
ColorTileFromLoad: PROC [handle: Handle, colorTileLoadAddress: INT, scratchPointer: LONG POINTERNIL, scratchWords: INT ← 0] RETURNS [PDInterpBitmap.Tile];
Errors and Signals
Error: ERROR [handle: Handle, code: PDInterpBasic.PDErrorCode, wordIndex, wordCount: INT];
Warning: SIGNAL [handle: Handle, code: PDInterpBasic.PDWarningCode, wordIndex, wordCount: INT];
File control
Open: PROC RETURNS [Handle];
May raise PDFileReader.Error or PDFileReader.Warning
Close: PROC [handle: Handle] RETURNS [Handle ← NIL];
Reading operations
Get: PROC [handle: Handle] RETURNS [CommandBuffer];
May raise PDFileReader.Error or PDFileReader.Warning
CommandBuffer: TYPE = RECORD [
SELECT cmd: * FROM
maskRectangle => [
sMin, fMin, sSize, fSize: CARDINAL
],
maskTrapezoid => [
sMin, fMin, fMinLast, sSize, fSize, fSizeLast: CARDINAL
],
maskRunGroup => [
sMin, fMin, sSize, fSize: CARDINAL,
fOffset: CARDINAL, -- add this to fMin of each run
runCount: INT, -- number of runs
pointer: LONG POINTER TO PDFileFormat.Run,
loadAddress: INT -- -1 if not in the load
],
maskSamples => [
loadAddress: INT, -- -1 if not in the load
samples: PDInterpBitmap.BitmapDesc
],
colorSamples => [
samples: PDInterpBitmap.BitmapDesc
],
deviceCommand => [
deviceCommandPointer: LONG POINTER,
deviceCommandWords: CARDINAL
],
stateChange => [
whatChanged: WhatChanged,
loadChangeStart, loadChangeLength: INT
],
ENDCASE
];
WhatChanged: TYPE = {
imageStart, imageEnd, priorityChange, colorChange, bandChange, loadChange, documentEnd
};
END.