ImagerInternalDefs.mesa
This interface provides the underlying data structures necessary to more than one definitions module within the Imager
Last Edited by:
Crow, June 18, 1983 12:08 pm
DIRECTORY
ImagerBasic USING [InteractiveImagingDevice, Path, SourceType, PxlValue, Font, IntVec,
Vec];
Context
ImagingSpace: TYPE = { client, viewer, device };
DisplayContext: TYPE = REF DisplayContextRep; -- Holds the imager state
DisplayContextRep:
TYPE =
RECORD [
interactive: BOOLEAN,
device: ImagerBasic.InteractiveImagingDevice,
deviceProcs: REF ANY, -- Procedures supplied by device
currentSource: SourceRecord,
currentFont: ImagerBasic.Font,
currentIntPosition: ImagerBasic.IntVec, -- CP kept in device space
currentPosition: ImagerBasic.Vec, -- For floating point types
-- ********* Transformations ************
clientTransform: TransformRecord ← DefaultTransformRecord,
viewerTransform: TransformRecord ← DefaultTransformRecord,
deviceTransform: TransformRecord ← DefaultTransformRecord,
transform: TransformRecord, -- composite transformation
-- ***************** Clipping ***********
clientClipper: ClipperRecord ← DefaultClipperRecord,
viewerClipper: ClipperRecord ← DefaultClipperRecord,
deviceClipper: ClipperRecord ← DefaultClipperRecord,
clipper: ClipperRecord, -- composite clipper
noClipArmed, noClip: BOOLEAN,
data: REF -- Interpretation of this depends on the procs
];
Transformations
TransformType: TYPE = { none, identity, rot90, rot180, rot270, mirrorX, mirrorY, mirror45Deg, mirror135Deg, hard };
TransformRecord:
TYPE =
RECORD [
x, y: INTEGER,
type: TransformType,
transformation: Transformation -- used if type is "hard"
];
DefaultTransformRecord: TransformRecord = [0, 0, identity, NIL];
Transformation: TYPE = REF TransformRep;
TransformRep:
TYPE =
RECORD [
a, b, c, d, e, f: REAL
];
Representation of the transformation matrix (as in Interpress)
a d 0
b e 0
c f 1 (or tx ty 1)
Clipping
ClipperType: TYPE = {none, rectangle, path};
ClipperRecord:
TYPE =
RECORD [
xMin, xMax, yMin, yMax: INTEGER, -- what if Client clipper is outside integer range?
type: ClipperType,
clipper: Clipper -- used if type is "path"
];
DefaultClipperRecord: ClipperRecord = [0, 1024, 0, 1024, rectangle, NIL]; -- not good?
Clipper: TYPE = REF ClipperRep;
ClipperRep:
TYPE =
RECORD [
xMin, xMax, yMin, yMax: REAL,
paths: LIST OF RECORD [exclude: BOOLEAN, path: ImagerBasic.Path]
];
Sources
RGBValue: TYPE = RECORD [ red, green, blue: REAL];
AISFile: TYPE[1]; -- to be filled in
SourceRecord:
TYPE =
RECORD [
type: ImagerBasic.SourceType, -- {black, white, constant, pixelarray, sampled, functional}
color: RGBValue,
pxlValue: ImagerBasic.PxlValue, -- TYPE = LONG CARDINAL
samples: REF ANY ← NIL -- gets NARROWed by called procedure
];
Sampled Sources - Interpress model
SampleSequence: TYPE = REF SampleSequenceRep;
SampleSequenceRep:
TYPE =
RECORD [
length: NAT,
seq: SEQUENCE maxLength: NAT OF LONG CARDINAL
];
SampledSource: TYPE = REF SampledSourceRep;
SampledSourceRep:
TYPE =
RECORD [
transformation: Transformation,
From the SampledImage's coordinate system to the standard coordinate system.
colorModel: ColorModel,
maximumSampleValue: LONG CARDINAL,
sampledSourceProc:
PROC [sampledSource: SampledSource,
sampleSequence: SampleSequence,
The samples should be appended onto the end of this sequence.
numberOfSamples: NAT,
x0, y0, deltaX, deltaY: INTEGER -- Description of the sample line, in the SampledImage's coordinate system. The delta values tell how to get to the next point.
] ← NIL,
data: REF ANY
];
ColorModel: TYPE = ATOM;
PixelBoxes
Pixel boxes hold BitBlt-able chunks of memory represented as pixels.
PixelBox: TYPE = REF PixelBoxRep;
PixelBoxRep:
TYPE =
RECORD [
bitsPerPixel: CARDINAL,
numberOfRows: CARDINAL,
wordsPerRow: CARDINAL, -- rows are word-size multiples for efficiency
array: LONG POINTER -- pointer to block of memory representing pixels
];