ImagerDev.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, May 3, 1985 11:32:14 am PDT
Michael Plass, May 16, 1985 12:45:42 pm PDT
DIRECTORY
ImagerColorDefs USING [Color],
ImagerFont USING [XChar],
ImagerTransformation USING [Transformation],
Scaled USING [Value],
Vector2 USING [VEC];
ImagerDev: CEDAR DEFINITIONS
~ BEGIN
Color: TYPE ~ ImagerColorDefs.Color;
XChar: TYPE ~ ImagerFont.XChar;
Transformation: TYPE ~ ImagerTransformation.Transformation;
VEC: TYPE ~ Vector2.VEC;
DeviceBox: TYPE ~ RECORD[smin, fmin, smax, fmax: CARDINAL];
RunProc: TYPE ~ PROC[sMin, fMin: INTEGER, fSize: NAT];
BoxProc: TYPE ~ PROC[DeviceBox];
HalftoneParameters: TYPE ~ RECORD[
dotsPerInch: REAL,
angle: REAL, -- degrees anticlockwise from +x axis
shape: REAL -- 0.5 is circular
];
Device: TYPE ~ REF DeviceRep;
DeviceRep: TYPE ~ RECORD[
class: Class, -- class operations
data: REF, -- instance data
box: DeviceBox, -- bounding rectangle, in device coordinates
surfaceToDevice: Transformation, -- transformation from surface to device coordinates
surfaceUnitsPerInch: VEC, -- x and y scale factors
surfaceUnitsPerPixel: NAT -- surface resolution may be a multiple of pixel resolution
];
CharMask: TYPE ~ REF CharMaskRep;
Pad15: TYPE ~ PACKED ARRAY [0..15) OF [0..1];
CharMaskRep: TYPE ~ MACHINE DEPENDENT RECORD [
font: REF, char: XChar,
font and char together provide a unique identifier for this mask
sWidth, fWidth: Scaled.Value,
sMinBB, fMinBB: INTEGER,
sSizeBB, fSizeBB: CARDINAL,
metricsValid: BOOLEAN, -- number above are invalid if this is true.
amplified: BOOLEAN,
correctSpace: BOOLEAN,
correctMask: BOOLEAN,
flag: PACKED ARRAY [0..10) OF [0..1], -- for padding and expansion
data: SELECT rep: * FROM
raster => [bits: SEQUENCE COMPUTED CARDINAL -- sSize*Ceiling[fSize/16.0] -- OF WORD],
runs => [run: SEQUENCE nRuns: CARDINAL OF Run],
uncached => [],
ENDCASE
];
Run: TYPE ~ MACHINE DEPENDENT RECORD [fMin: CARDINAL, lastRun: BOOLEAN, fSize: NAT];
fMin is relative to fMinBB
Class: TYPE ~ REF ClassRep;
ClassRep: TYPE ~ RECORD[
type: ATOM,
SetColor: PROC[device: Device, color: Color, viewToDevice: Transformation],
SetPriority: PROC[device: Device, priorityImportant: BOOL],
SetHalftone: PROC[device: Device, halftone: HalftoneParameters],
MaskRuns: PROC[device: Device, bounds: DeviceBox, runs: PROC[RunProc]],
MaskBoxes: PROC[device: Device, bounds: DeviceBox, boxes: PROC[BoxProc]],
MaskBits: PROC[device: Device, srcBase: LONG POINTER, srcWordsPerLine: NAT,
ts, tf: INTEGER, replace: BOOLFALSE, boxes: PROC[BoxProc]],
MoveBoxes: PROC[device: Device, ts, tf: INTEGER, boxes: PROC[BoxProc]],
MaskChar: PROC[device: Device, s, f: INTEGER, mask: CharMask]
];
END.