ImagerRaster.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 11, 1985 12:49:37 pm PDT
Doug Wyatt, May 30, 1985 11:21:34 pm PDT
DIRECTORY
Atom USING [PropList],
Imager USING [Context, ClassRep],
ImagerCache USING [Ref],
ImagerDevice USING [Device, DeviceBox],
ImagerPixelMap USING [PixelMap],
Terminal USING [Virtual];
ImagerRaster: CEDAR DEFINITIONS
~ BEGIN
Context: TYPE ~ Imager.Context;
Device: TYPE ~ ImagerDevice.Device;
DeviceBox: TYPE ~ ImagerDevice.DeviceBox;
Context creation
Create: PROC [device: Device, pixelUnits: BOOLFALSE, fontCache: ImagerCache.Ref ← NIL, rastWeight: REAL ← 1.0, fontTuner: FontTuner ← NIL, class: REF Imager.ClassRep ← NIL
] RETURNS [Context];
If fontCache=NIL, no caching will be done.
If fontTuner=NIL, no font tuning will be done.
Raster devices
NewBitmapDevice: PROC [frame: ImagerPixelMap.PixelMap, pixelsPerInch: REAL ← 72]
RETURNS [Device];
NewGrayDevice: PROC [terminal: Terminal.Virtual] RETURNS [Device];
NewColorMapDevice: PROC [terminal: Terminal.Virtual, bpp: NAT ← 8] RETURNS [Device];
NewColor24Device: PROC [terminal: Terminal.Virtual] RETURNS [Device];
Ambushing a raster device
AmbushDevice: PROC [ambusher: Ambusher] RETURNS [Device];
Provides a mechanism for software cursors, interesting demos.
Ambusher: TYPE ~ REF AmbusherRep;
AmbusherRep: TYPE ~ RECORD [
maskProc: PROC [self: Ambusher, box: DeviceBox, action: PROC],
Called for each masking operation; should call action
device: Device,
data: REF
];
Font tuning hook
FontTuner: TYPE ~ REF FontTunerRep;
FontTunerRep: TYPE ~ RECORD [
proc: FontTunerProc,
data: REF,
propList: Atom.PropList
];
FontTunerProc: TYPE ~ PROC [self: FontTuner, charProc: PROC[Context], context: Context];
Should call charProc to get the character, and should draw it into context.
Subclassing
CreateClass: PROC [type: ATOM] RETURNS [REF Imager.ClassRep];
For clients that want to do some simple subclassing of the raster class.
END.