DIRECTORY Imager USING [Context], ImagerColorDefs USING [ColorRep, ConstantColor], ImagerDitherContext USING [MapEntries, SpecialPixel], ImagerDitheredDevicePrivate USING [Data], ImagerRasterPrivate USING [Data]; ImagerDitherContextImpl: CEDAR PROGRAM EXPORTS ImagerDitherContext ~ BEGIN OPEN ImagerDitherContext; ConstantColor: TYPE ~ ImagerColorDefs.ConstantColor; SetDitherMap: PUBLIC PROC [context: Imager.Context, mapEntries: MapEntries] ~ { WITH context.data SELECT FROM rasterData: ImagerRasterPrivate.Data => { WITH rasterData.device.data SELECT FROM data: ImagerDitheredDevicePrivate.Data => { data.mapEntries _ mapEntries; }; ENDCASE => NULL; }; ENDCASE => NULL; }; DoWithDitherMap: PUBLIC PROC [context: Imager.Context, mapEntries: MapEntries, action: PROC] ~ { WITH context.data SELECT FROM rasterData: ImagerRasterPrivate.Data => { WITH rasterData.device.data SELECT FROM data: ImagerDitheredDevicePrivate.Data => { old: MapEntries _ data.mapEntries; data.mapEntries _ mapEntries; action[ ! UNWIND => data.mapEntries _ old]; data.mapEntries _ old; }; ENDCASE => NULL; }; ENDCASE => NULL; action[]; }; MakeSpecialColor: PUBLIC PROC [ordinaryColor: ConstantColor, specialPixel: SpecialPixel] RETURNS [special: ConstantColor] ~ { special _ NEW[ImagerColorDefs.ColorRep.constant _ ordinaryColor^]; special.data _ NEW[SpecialPixel_specialPixel]; }; END. ŒImagerDitherContextImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Michael Plass, July 3, 1985 11:28:29 am PDT Κ˜codešœ™Kšœ Οmœ1™