ImagerDitheredDevice.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass, June 21, 1985 12:44:40 pm PDT
DIRECTORY
Terminal USING [Virtual, ChannelValue],
IIDevice USING [Device],
IIColor USING [RGB],
IIColorDefs USING [ConstantColor],
IIColorMap USING [MapEntry],
II USING [Context],
IIPixelMap USING [PixelMap],
PrincOps USING [DstFunc];
IIDitheredDevice: CEDAR DEFINITIONS
~ BEGIN
Creating Contexts
The following assume a color map that matches the standard map; this may be changed by SetDitherMap, below.
ContextFromPixelMap:
PROC [frame: IIPixelMap.PixelMap, displayHeight:
NAT, pixelUnits:
BOOL ←
FALSE]
RETURNS [II.Context];
ContextFromColorTerminal: PROC [vt: Terminal.Virtual, pixelUnits: BOOL ← FALSE] RETURNS [II.Context];
Modifying Dithering Maps
MapEntries:
TYPE ~
LIST
OF IIColorMap.MapEntry;
Treat this as immutable.
SetDitherMap:
PROC [context: II.Context, mapEntries: MapEntries];
Subject to DoSave.
Fast if mapEntries have been loaded recently.
Does not change the display's color map; see ImagerColorMap.LoadEntries
Channel Value Colors
ChannelValue: TYPE ~ Terminal.ChannelValue;
ConstantColor:
TYPE ~ IIColorDefs.ConstantColor;
SpecialPixel:
TYPE ~
RECORD [value: ChannelValue, dstFunc: PrincOps.DstFunc];
ColorFromSpecialPixel:
PROC [specialPixel: SpecialPixel]
RETURNS [ConstantColor];
For color map animation; sets a color that will cause the value to be stored in the frame with the specified dstFunc. The client is responsible for making sure the color map is set up appropriately.
ColorFromSpecialRGB:
PROC [specialPixel: SpecialPixel, rgb: IIColor.
RGB]
RETURNS [ConstantColor];
Makes a color that will act like ColorFromRGB[rgb] on non-dithered contexts, but like SpecialColorFromChannelValue[specialPixel] on dithered devices. The client is responsible for making sure the color map is set up appropriately.
Creating Devices
Not needed by most clients, these are provided in case more control is needed. See ImagerRaster for making a context on a raster device.
DeviceFromPixelMap:
PROC [frame: IIPixelMap.PixelMap, displayHeight:
NAT, pixelsPerInch:
REAL ← 72]
RETURNS [IIDevice.Device];
DeviceFromColorTerminal:
PROC [vt: Terminal.Virtual, aChannel:
BOOL ←
TRUE]
RETURNS [IIDevice.Device];
END.