DIRECTORY ImagerTransform USING [Pair, Rectangle, IntRectangle, Transformation], Real USING [NonTrappingNaN], Scaled USING [Value]; ImagerBasic: CEDAR DEFINITIONS = BEGIN Pair: TYPE = ImagerTransform.Pair; IntPair: TYPE = RECORD [x, y: INTEGER]; Rectangle: TYPE = ImagerTransform.Rectangle; Transformation: TYPE = ImagerTransform.Transformation; IntRectangle: TYPE = ImagerTransform.IntRectangle; Bezier: TYPE = RECORD [b0, b1, b2, b3: Pair]; -- Bezier control points for a cubic curve nullREAL: REAL = Real.NonTrappingNaN; DeviceCoordinate: TYPE ~ RECORD [s, f: INTEGER]; DeviceRectangle: TYPE ~ RECORD [sMin, fMin: INTEGER, sSize, fSize: NAT]; PathMapType: TYPE = PROC[ data: REF, move: PROC[p: Pair], line: PROC[p: Pair], curve: PROC[p1, p2, p3: Pair], conic: PROC[p1, p2: Pair, r: REAL] ]; ClientClipper: TYPE = LIST OF ClientClipperItem; ClientClipperItem: TYPE = RECORD [ exclude: BOOLEAN, easyRectangle: BOOLEAN, pathMap: PathMapType, pathData: REF ]; Visibility: TYPE = {visible, partlyVisible, invisible}; StrokeEnd: TYPE = {nil, square, butt, round}; Color: TYPE = REF ColorRep; ColorRep: TYPE = RECORD[ SELECT tag: * FROM constant => [x, y, Y: CARDINAL], -- CIE Chromaticity coordinates sampled => [ transparent: BOOLEAN, -- are 0 samples white (false) or transparent (true)? pa: PixelArray, -- the array of samples m: Transformation, -- transforms from pa to device coordinates colorOperator: ATOM -- maps samples into colors ], special => [ref: REF], ENDCASE ]; ConstantColor: TYPE = REF ColorRep[constant]; SampledColor: TYPE = REF ColorRep[sampled]; PixelArray: TYPE = REF PixelArrayRep; PixelArrayRep: TYPE = RECORD [ xPixels, yPixels: INT, -- dimensions of the array, in pixels maxSampleValue: INT, -- the range of sample values is [0..maxSampleValue] samplesPerPixel: INT, -- number of samples for each pixel m: Transformation, -- transformation to client space (see Interpress, section 4.6) get: PROC [ self: PixelArray, buffer: PixelBuffer, nSamples: NAT, layer: INT, xStart, yStart: Scaled.Value, xDelta, yDelta: Scaled.Value ], data: REF ANY ]; PixelBuffer: TYPE = REF PixelBufferRep; PixelBufferRep: TYPE = RECORD [ SEQUENCE maxLength: NAT OF CARDINAL ]; State: TYPE = REF StateRep; StateRep: TYPE = RECORD[ -- persistent variables -- cpx, cpy: REAL, -- CORRECT variables -- correctMX, correctMY: REAL, correctMaskCount: INT, correctMaskX, correctMaskY: REAL, correctSumX, correctSumY: REAL, correctSpaceX, correctSpaceY: REAL, correctcpx, correctcpy: REAL, correctTargetX, correctTargetY: REAL, -- nonpersistent variables -- T: Transformation, priorityImportant: INT, mediumXSize, mediumYSize: REAL, fieldXMin, fieldYMin, fieldXMax, fieldYMax: REAL, showVec: REF, color: Color, noImage: INT, strokeWidth: REAL, strokeEnd: INT, underlineStart: REAL, amplifySpace: REAL, correctPass: INT, correctShrink: REAL, correctTX, correctTY: REAL, clipper: ClientClipper, propertyList: REF ]; END. (ImagerBasic.mesa This interface provides the public data structures shared by clients and the Imager. Last Edited by: Crow, Plass, Wyatt, July 6, 1983 2:38 pm Wyatt, September 30, 1983 2:11 pm Plass, February 6, 1984 2:55:29 pm PST Basic Definitions (Numbers and Shapes) RECORD [x, y: REAL] RECORD [x, y, w, h: REAL] RECORD [x, y, w, h: INTEGER] Paths Clipping The ClientClipper is the intersection of the ClientClipperItems. True if it is an excluding clipper. True if the path is known to be a rectangle with sides parallel to the view coordinate system axes. The path is mapped in the view coordinate system. Must be immutable for the life of the clipper. Masks Colors PixelArrays object implementation fills this with the requested number of samples. number of samples to put in buffer. in the range [0..samplesPerPixel) position of first sample. increment to get to successive samples. for use by the get proc; some devices may discriminate on this REF to get at the representation directly, if they are able to recognize it. Imager State ÊI˜šœ™J™—J™TJ™šœ™Jšœ(™(J™!™&J™——šÏk ˜ Jšœœ1˜FJšœœ˜Jšœœ ˜—J˜Jšœ œ ˜šœ˜J™—šœ&™&J™šœœ˜"Jšœœ™—Jšœ œœœ˜'šœ œ˜,Jšœœ™—Jšœœ"˜6šœœ ˜2Jšœœ™—JšœœœÏc*˜XJšœ œ˜%Jšœœœœ˜0Jš œœœœœ˜HJ™—™J™šœ œœ˜Jšœœ˜ Jšœœ ˜Jšœœ ˜Jšœœ˜Jšœœœ˜"Jšœ˜J˜——šœ™J™šœœœœ˜0Jšœ@™@—šœœœ˜"šœ œ˜J™#—šœœ˜J™c—šœ˜J™1—šœ ˜ J™.—Jšœ˜J˜—Jšœ œ'˜7J™—šœ™J™Jšœ œ˜-J™—šœ™J™Jšœœœ ˜šœ œœ˜šœ˜Jšœœž˜@˜ Jšœ œž5˜KJšœž˜'Jšœž+˜>Jšœœž˜/J˜—Jšœœ˜Jš˜—J˜—J˜Jšœœœ˜-Jšœœœ˜+J˜J™—šœ ™ J™Jšœ œœ˜%šœœœ˜Jšœœž%˜