DIRECTORY Xl; XlColorAccess: CEDAR DEFINITIONS ~ BEGIN ColorData: TYPE = REF READONLY ColorDataRec; ColorDataRec: TYPE = RECORD [ hasColors: BOOL ¬ FALSE, hasPrivateColormap: BOOL ¬ FALSE, --otherwise colormap simply copied from screen colormap: Xl.ColorMap, pseudoBlackPixel, pseudoWhitePixel: Xl.Pixel, --might have indices better suited for inverting then screen defaults entries: REF ¬ NIL, --good for XlBitmap.SetColormap. Actually ImagerColorMap.MapEntries, but we avoid module import dependency. reservedForImpl: PRIVATE REF ANY ¬ NIL ]; Access: PROC [screen: Xl.Screen, depth: BYTE, class: Xl.VisualClass] RETURNS [ColorData]; RealColorValToXColorVal: PROC [r: REAL, invGamma: REAL ¬ 0.4545454] RETURNS [Xl.RGBVal]; FindVisualType: PROC [screen: Xl.Screen, depth: BYTE, class: Xl.VisualClass] RETURNS [Xl.VisualType]; END. ²XlColorAccess.mesa Copyright Σ 1990, 1991, 1993 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, December 5, 1990 4:53:47 pm PST Christian Jacobi, August 16, 1993 12:09 pm PDT Package which supports usage of ImagerColorMap entries with X windows. Computes, allocates or fetches colors for a particular screen and visual. Tries first to use standard colormap, on failure creates private colormap. Returned ColorData is NOT NIL if a VisualType exists Internally used utilities maybe usefull externally too. Computes X-ish color index from range [0..1) Finds visual type for a screen, bits per pixel value and class Returns NIL in case of none found Κˆ–(cedarcode) style•NewlineDelimiter ˜™Icodešœ Οeœ=™HK™™>Kš !™!—K™Kšžœ˜K˜K˜—…—J„