DIRECTORY Terminal USING [Virtual, ChannelValue], ImagerDevice USING [Device], ImagerColor USING [ConstantColor, RGB], ImagerColorMap USING [MapEntry], Imager USING [Context], ImagerSample USING [SampleMap], PrincOps USING [DstFunc]; ImagerDitheredDevice: CEDAR DEFINITIONS ~ BEGIN ContextFromSampleMap: PROC [frame: ImagerSample.SampleMap, 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 ~ ImagerColor.ConstantColor; SpecialPixel: TYPE ~ RECORD [value: ChannelValue, dstFunc: PrincOps.DstFunc]; ColorFromSpecialPixel: PROC [specialPixel: SpecialPixel] RETURNS [ConstantColor]; ColorFromSpecialRGB: PROC [specialPixel: SpecialPixel, rgb: ImagerColor.RGB] RETURNS [ConstantColor]; DeviceFromSampleMap: PROC [frame: ImagerSample.SampleMap, displayHeight: NAT, pixelsPerInch: REAL _ 72] RETURNS [ImagerDevice.Device]; DeviceFromColorTerminal: PROC [vt: Terminal.Virtual, aChannel: BOOL _ TRUE] RETURNS [ImagerDevice.Device]; END. RImagerDitheredDevice.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Michael Plass, June 21, 1985 12:44:40 pm PDT Doug Wyatt, March 7, 1986 2:49:44 pm PST 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œ7™BK™,K™(—K˜šΟk ˜ Kšœ žœ˜'Kšœ žœ ˜Kšœ žœžœ˜'Kšœžœ ˜ Kšœžœ ˜Kšœ žœ ˜Kšœ žœ ˜—K˜KšΠlnœžœž ˜'Kšœž˜head™™kK˜—š Οnœžœ0žœžœžœžœ˜‚K˜—Kš  œžœ$žœžœžœ˜i—™šœ žœžœžœ˜3K™K˜—š  œžœ3˜EK™Kšœ-™-KšœG™G——šœ™Kšœžœ˜+šœžœ˜0K˜K˜—šœžœžœ2˜MK˜—š œžœžœ˜QKšœΗ™ΗK˜—š œžœ/žœžœ˜eKšœη™η——™™‰K˜—š  œžœ0žœžœžœ˜†K˜—š  œžœ"žœžœžœ˜jK˜——Kšžœ˜—…—θ :