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],
ImagerDevice USING [Device],
ImagerColor USING [RGB],
ImagerColorDefs USING [ConstantColor],
ImagerColorMap USING [MapEntry],
Imager USING [Context],
ImagerPixelMap USING [PixelMap],
PrincOps USING [DstFunc];
ImagerDitheredDevice: 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: ImagerPixelMap.PixelMap, displayHeight: NAT, pixelUnits: BOOLFALSE] RETURNS [Imager.Context];
ContextFromColorTerminal: PROC [vt: Terminal.Virtual, pixelUnits: BOOLFALSE] RETURNS [Imager.Context];
Modifying Dithering Maps
MapEntries: TYPE ~ LIST OF ImagerColorMap.MapEntry;
Treat this as immutable.
SetDitherMap: PROC [context: Imager.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 ~ ImagerColorDefs.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: ImagerColor.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: ImagerPixelMap.PixelMap, displayHeight: NAT, pixelsPerInch: REAL ← 72] RETURNS [ImagerDevice.Device];
DeviceFromColorTerminal: PROC [vt: Terminal.Virtual, aChannel: BOOLTRUE] RETURNS [ImagerDevice.Device];
END.