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 ContextFromPixelMap: PROC [frame: ImagerPixelMap.PixelMap, displayHeight: NAT, pixelUnits: BOOL _ FALSE] RETURNS [Imager.Context]; ContextFromColorTerminal: PROC [vt: Terminal.Virtual, pixelUnits: BOOL _ FALSE] RETURNS [Imager.Context]; MapEntries: TYPE ~ LIST OF ImagerColorMap.MapEntry; SetDitherMap: PROC [context: Imager.Context, mapEntries: MapEntries]; ChannelValue: TYPE ~ Terminal.ChannelValue; ConstantColor: TYPE ~ ImagerColorDefs.ConstantColor; SpecialPixel: TYPE ~ RECORD [value: ChannelValue, dstFunc: PrincOps.DstFunc]; ColorFromSpecialPixel: PROC [specialPixel: SpecialPixel] RETURNS [ConstantColor]; ColorFromSpecialRGB: PROC [specialPixel: SpecialPixel, rgb: ImagerColor.RGB] RETURNS [ConstantColor]; DeviceFromPixelMap: PROC [frame: ImagerPixelMap.PixelMap, displayHeight: NAT, pixelsPerInch: REAL _ 72] RETURNS [ImagerDevice.Device]; DeviceFromColorTerminal: PROC [vt: Terminal.Virtual, aChannel: BOOL _ TRUE] RETURNS [ImagerDevice.Device]; END. $ImagerDitheredDevice.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Michael Plass, June 21, 1985 12:44:40 pm PDT Creating Contexts The following assume a color map that matches the standard map; this may be changed by SetDitherMap, below. Modifying Dithering Maps Treat this as immutable. Subject to DoSave. Fast if mapEntries have been loaded recently. Does not change the display's color map; see ImagerColorMap.LoadEntries Channel Value Colors 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. 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. Κ˜codešœ™Kšœ Οmœ1™