<> <> <<>> <> <> DIRECTORY ImagerBasic USING [InteractiveImagingDevice, Path, SourceType, PxlValue, Font, IntVec, Vec]; ImagerInternalDefs: CEDAR DEFINITIONS = BEGIN <> 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 ]; <> <> 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 ]; <> <> <> <> <<>> <<>> <> 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] ]; <> 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 ]; <> 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, <> colorModel: ColorModel, maximumSampleValue: LONG CARDINAL, sampledSourceProc: PROC [sampledSource: SampledSource, sampleSequence: SampleSequence, <> 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; <> <> 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 ]; Paths Masks <> <> END.