DIRECTORY; ImagerBasic: CEDAR DEFINITIONS = BEGIN Vec: TYPE = RECORD [x, y: REAL]; IntVec: TYPE = RECORD [x, y: INTEGER]; Edge: TYPE = RECORD [a, b: Vec]; IntEdge: TYPE = RECORD [a, b: IntVec]; Rectangle: TYPE = RECORD [x, y, w, h: REAL]; IntRectangle: TYPE = RECORD [x, y, w, h: INTEGER]; ImagingSpace: TYPE = { client, viewer, device }; Context: TYPE = REF ContextRep; -- Holds the imager state ContextRep: TYPE = RECORD [ procs: Procs, interactive: BOOLEAN, device: ImagingDevice, deviceProcs: DeviceProcs, -- Procedures supplied by device currentSource: SourceRecord, currentFont: Font, currentIntPosition: IntVec, -- CP kept in device space currentPosition: Vec, -- For those with floating point devices -- ********* 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 ]; Visibility: TYPE = {visible, partlyVisible, invisible}; ClipperType: TYPE = {none, rectangle, path}; ClipperRecord: TYPE = RECORD [ xMin, xMax, yMin, yMax: INTEGER, type: ClipperType, clipper: Clipper -- used if type is "path" ]; DefaultClipperRecord: ClipperRecord = [0, 1024, 0, 1024, rectangle, NIL]; Clipper: TYPE = REF ClipperRep; ClipperRep: TYPE = RECORD [ xMin, xMax, yMin, yMax: REAL, paths: LIST OF RECORD [exclude: BOOLEAN, path: Path] ]; ImagingDevice: TYPE = ATOM; -- i.e. $LF, $CRT8, $CRT24, $PD, $IP, etc. InteractiveImagingDevice: TYPE = ATOM; -- i.e. $LF, $CRT8, $CRT24 PxlValue: TYPE = LONG CARDINAL; ByteSequence: TYPE = REF ByteSequenceRep; ByteSequenceRep: TYPE = RECORD [PACKED SEQUENCE COMPUTED CARDINAL OF [0..256)]; SetUpProc: TYPE = PROC [] RETURNS [TransformRecord, ClipperRecord, DeviceProcs]; -- get memory, pin it, set the transform, clipper, and device procs ShutDownProc: TYPE = PROC []; -- free memory OpenPixelBufferProc: TYPE = PROC [buffer: PixelArray _ NIL] RETURNS [PixelArray]; -- redirect writes for double-buffer ClosePixelBufferProc: TYPE = PROC []; -- drop pixel buffer ref RGBtoPixelProc: TYPE = PROC [color: RGBValue] RETURNS [PxlValue]; -- Color to device transform PixeltoRGBProc: TYPE = PROC [pxlValue: PxlValue] RETURNS [RGBValue]; HilitePxlsProc: TYPE = PROC [area: IntRectangle]; -- Device dependent highlighting scheme MovePxlsProc: TYPE = PROC [source: IntRectangle, destination: IntVec]; -- move on display GetPxlsProc: TYPE = PROC [source: IntRectangle] RETURNS [PixelArray]; LoadPxlsProc: TYPE = PROC [source: PixelArray _ NIL, destination: IntVec]; LoadScanSegProc: TYPE = PROC [x, y, length: CARDINAL, segment: ByteSequence]; LoadTrapezoidProc: TYPE = PROC [top, bottom, leftTop, leftBot, rightTop, rightBot: CARDINAL, pxlValue: PxlValue]; -- Scan convert trapezoid, constant color SetPixelProc: TYPE = PROC [x, y: CARDINAL, pxlValue: PxlValue]; GetPixelProc: TYPE = PROC [x, y: CARDINAL] RETURNS [PxlValue]; DrawLineProc: TYPE = PROC [a, b: IntVec, pxlValue: PxlValue]; -- fast line, constant color DeviceProcs: TYPE = REF DeviceProcsRec; DeviceProcsRec: TYPE = RECORD[ setUp: SetUpProc, shutDown: ShutDownProc, openPixelBuffer: OpenPixelBufferProc, closePixelBuffer: ClosePixelBufferProc, RGBtoPixel: RGBtoPixelProc, pixeltoRGB: PixeltoRGBProc, hilitePxls: HilitePxlsProc, movePxls: MovePxlsProc, getPxls: GetPxlsProc, loadPxls: LoadPxlsProc, loadScanSeg: LoadScanSegProc, loadTrapezoid: LoadTrapezoidProc, setPixel: SetPixelProc, getPixel: GetPixelProc, drawLine: DrawLineProc ]; -- this doesn't seem to help PD and InterPress master devices much, what to do?? Font: TYPE = REF; SourceType: TYPE = { black, white, constant, pixelarray, sampled, functional }; RGBValue: TYPE = RECORD [ red, green, blue: REAL]; AISFile: TYPE[1]; -- to be filled in SourceRecord: TYPE = RECORD [ type: SourceType, color: RGBValue, pxlValue: 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; PixelArray: TYPE = REF PixelArrayRep; PixelArrayRep: TYPE = RECORD [ pixelsPerWord: CARDINAL, numberOfRows: CARDINAL, pixelsPerRow: CARDINAL, array: LONG POINTER, -- pointer to block of memory representing pixels colorTable: REF -- nil, or pointer to pixel-to-color translation table ]; Path: TYPE = REF PathRep; PathRep: TYPE = RECORD [ generateProc: PROC [ path: Path, transformation: Transformation, move: PROC [Vec], line: PROC [Vec], curve: PROC [Vec, Vec, Vec] ], data: REF ANY ]; StrokeEnds: TYPE = {butt, square, round}; Procs: TYPE = REF ProcsRec; ProcsRec: TYPE; END. ΊImagerBasic.mesa This interface provides the underlying data structures necessary to more than one definitions module within the Imager. Last Edited by: Crow, June 10, 1983 5:05 pm Basic Numbers and Shapes Context Transformations Representation of the transformation matrix a b 0 c d 0 e f 1 (or tx ty 1) Clipping Devices Fonts Sources Sampled Sources - Interpress model From the SampledImage's coordinate system to the standard coordinate system. The samples should be appended onto the end of this sequence. PixelArrays Pixel arrays are scanned in a standard way. Therefore BitBlt can be used to move them around. They are intended to be the fast form of Sample Arrays. Paths A client of the Imager may keep a path representation in a form appropriate for its own use; it only needs to unravel it into a series of MoveTo, LineTo and CurveTo operations when it is asked. Masks Characters Things we're not gonna tell you (opaque types) Κ˜headšœ™J™wJ™šœ™Jšœ™—IunitšΟk ˜ —head3šœ˜Jšœ˜—šΟb™Jšœœœœ˜ Jšœœœœ˜&Jšœœœ ˜ Jšœ œœ˜&Jšœ œœ œ˜,Jšœœœ œ˜2—šž™Jšœœ˜2Lšœ œœ Οc˜9šœ œœ˜Jšœ ˜ Jšœ œ˜Jšœ˜JšœŸ ˜=J˜Jšœ˜JšœŸ˜9JšœŸ(˜BLšŸ,˜,Jšœœ)˜:Jšœœ)˜:Jšœœ)˜:Jšœ œŸ$˜ALšŸ,˜,Jšœ4˜4Jšœ4˜4Jšœ4˜4JšœŸœŸ"˜9Jšœœ˜LšœŸ1˜:J˜——šž™Jšœœa˜tšœœœ˜ Jšœœ˜Jšœ˜Jšœ Ÿ˜9Jšœ˜—Lšœ;œ˜@Lšœœœ˜(šœœœ˜Jšœ˜J˜—™+J™J™J™——šž™Lšœ œ'˜7Lšœ œ˜,šœœœ˜Jšœ ˜ Jšœ˜JšœŸ˜0J˜—LšœDœ˜ILšœ œœ ˜šœ œœ˜Jšœœ˜Jš œœœœ œ ˜4J˜——™JšœœœŸ*˜GJšœœœŸ˜BLšœ œœœ˜Jšœœœ˜)Jšœœœœœœœœ ˜OL˜Jšœ  œœ0ŸC˜–Jšœ œ Ÿ˜3Jš œœœœœŸ&˜wJšœœœ Ÿœ˜KJšœ œœ Ÿ˜^Jšœ œœ ˜DJšœ œŸ(˜YJšœ œ-Ÿ˜ZJšœ œœ˜FJšœœœœ˜JJšœ œœ˜MJšœ œ5œŸ)˜’Jšœ œœ˜@Jšœ  œœœ ˜?Jšœ œ$Ÿ˜[Lšœœœ˜(šœœœ˜Jšœ˜Jšœ˜Jšœ%˜%Jšœ'˜'Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ˜Jšœ!˜!Jšœ˜Jšœ˜Jšœ˜JšœŸP˜T——™Jšœœœ˜—šž™Jšœ œ?˜OJšœ œœœ˜2Jšœ œŸ˜/šœœœ˜Jšœ˜Jšœ˜JšœŸ˜/Jšœ œœœŸ$˜=J˜—šΟi"™"Lšœœœ˜-šœœœ˜"Jšœœ˜ Jš œœ œœœ˜-Jšœ˜—Lšœœœ˜+šœœœ˜!˜JšœL™L—Jšœ˜Jšœœœ˜"šœœ˜6šœ˜J™=—Jšœœ˜JšœœŸ˜ŸJšœœ˜—Jšœœ˜ —Jšœ˜Jšœ œœ˜—J˜š  ™ Jšœ—™—Lšœ œœ˜%šœœœ˜Jšœœ˜Jšœœ˜Jšœœ˜Jšœ œŸ2˜HJšœ Ÿ;˜JJšœ˜———šž™JšœΑ™ΑLšœœœ ˜šœ œœ˜šœœ˜Jšœ ˜ J˜Jšœœ˜Jšœœ˜Jšœœ˜Jšœ˜—Jšœœ˜ Jšœ˜——šž™Lšœ œ˜*—Mšœ ™ šž.™.šœœœ ˜Jšœ œ˜—˜L˜——Lšœ˜—…—˜"ί