ImagerRaster.mesa
Copyright © 1984, 1985, 1986 by Xerox Corporation. All rights reserved.
Michael Plass, June 11, 1985 12:49:37 pm PDT
Doug Wyatt, February 17, 1986 3:28:39 pm PST
DIRECTORY
Atom USING [PropList],
Imager USING [Context, ClassRep],
ImagerCache USING [Ref],
ImagerDevice USING [Device],
ImagerSample USING [Box, SampleMap],
Terminal USING [Virtual];
ImagerRaster: CEDAR DEFINITIONS
~
BEGIN
Context: TYPE ~ Imager.Context;
Device: TYPE ~ ImagerDevice.Device;
Box: TYPE ~ ImagerSample.Box;
SampleMap: TYPE ~ ImagerSample.SampleMap;
Context creation
Create:
PROC [device: Device, pixelUnits:
BOOL ←
FALSE, 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: SampleMap, 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: Box, 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.