ImagerPixelArray.mesa
Copyright © 1984, Xerox Corporation. All rights reserved.
Michael Plass, August 1, 1984 9:59:33 am PDT
Doug Wyatt, November 5, 1984 3:02:07 pm PST
DIRECTORY
ImagerTransformation USING [Transformation],
Rope USING [ROPE];
ImagerPixelArray: CEDAR DEFINITIONS
~ BEGIN
Transformation: TYPE ~ ImagerTransformation.Transformation;
ROPE: TYPE ~ Rope.ROPE;
PixelArray: TYPE ~ REF PixelArrayRep;
PixelArrayRep:
TYPE ~
RECORD[
class: Class, -- class operations
data: REF, -- instance data
sSize, fSize: NAT, -- slow and fast dimensions (Interpress calls these xPixels, yPixels)
samplesPerPixel: NAT, -- number of samples for each pixel
m: Transformation -- transforms from [s, f] coordinates to "upright" [x, y] coordinates
];
The pixel array contains (sSize*fSize) pixels, (sSize*fSize*samplesPerPixel) samples.
A sample is named by a triple [s, f, i]: s IN[0..sSize), f IN[0..fSize), i IN[0..samplesPerPixel).
Val: TYPE ~ [0..377B]; -- a sample value, 8 bits
Row: TYPE ~ REF RowRep;
RowRep: TYPE ~ RECORD[PACKED SEQUENCE size: NAT OF Val];
Class: TYPE ~ REF ClassRep;
ClassRep:
TYPE ~
RECORD[
type: ATOM,
MaxSampleValue: PROC[pa: PixelArray, i: NAT] RETURNS[Val],
GetSample: PROC[pa: PixelArray, s, f, i: NAT] RETURNS[Val],
GetRow: PROC[pa: PixelArray, row: Row, s, f, i: NAT]
];
MaxSampleValue:
PROC[pa: PixelArray, i:
NAT]
RETURNS[Val];
Returns the maximum sample value for layer i.
GetSample: PROC[pa: PixelArray, s, f, i: NAT ← 0] RETURNS[Val];
GetRow:
PROC[pa: PixelArray, row: Row, s, f, i:
NAT ← 0];
FOR k: NAT IN[0..MIN[row.size, pa.fSize-f]) DO row[k] ← GetSample[pa, s, f+k, i] ENDLOOP;
FromAIS:
PROC[name:
ROPE]
RETURNS[PixelArray];
Makes a pixel array from an AIS file.
FromAISSeparations:
PROC[name0, name1, name2, name3:
ROPE ←
NIL]
RETURNS[PixelArray];
Makes a multi-sample pixel array from a list of AIS files.
ExtractPixelArray:
PROC[pa: PixelArray, select:
LIST
OF
NAT]
RETURNS[PixelArray];
Extracts the selected sample layers from the pixel array.
JoinPixelArrays:
PROC[pixelArrays:
LIST
OF PixelArray]
RETURNS[PixelArray];
Joins multiple sample planes into one PixelArray
END.