ImagerDevice.mesa
Copyright © 1984 Xerox Corporation. All rights reserved.
Doug Wyatt, October 19, 1984 11:13:09 am PDT
DIRECTORY
ImagerColor USING [Color],
ImagerPixelMap USING [DeviceRectangle],
ImagerTransformation USING [Transformation],
Vector2 USING [VEC];
ImagerDevice: CEDAR DEFINITIONS
~ BEGIN
Color: TYPE ~ ImagerColor.Color;
DeviceRectangle: TYPE ~ ImagerPixelMap.DeviceRectangle;
Transformation: TYPE ~ ImagerTransformation.Transformation;
VEC: TYPE ~ Vector2.VEC;
HalftoneParameters:
TYPE ~
RECORD[
dotsPerInch: REAL,
angle: REAL, -- degrees anticlockwise from +x axis
shape: REAL -- 0.5 is circular
];
RunProc:
TYPE ~
PROC[sMin, fMin:
INTEGER, fSize:
NAT];
Device: TYPE ~ REF DeviceRep;
DeviceRep:
TYPE ~
RECORD[
class: Class,
clipBox: DeviceRectangle, -- 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
data: REF
];
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, runs: PROC[RunProc]]
];
SetColor:
PROC[device: Device, color: Color, viewToDevice: Transformation]
~ INLINE { device.class.SetColor[device: device, color: color, viewToDevice: viewToDevice] };
Establish the color for following masks.
SetPriority:
PROC[device: Device, priorityImportant:
BOOL]
~ INLINE { device.class.SetPriority[device: device, priorityImportant: priorityImportant] };
Declare whether priority order is important for following masks.
SetHalftone:
PROC[device: Device, halftone: HalftoneParameters]
~ INLINE { device.class.SetHalftone[device: device, halftone: halftone] };
Set halftoning parameters.
MaskRuns:
PROC[device: Device, runs:
PROC[RunProc]]
~ INLINE { device.class.MaskRuns[device: device, runs: runs] };
Apply the current color within the specified runs.
END.