ImagerColorPrivate.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, May 29, 1985 11:12:08 pm PDT
DIRECTORY
Atom USING [PropList],
ImagerColor,
ImagerColorDefs,
Rope USING [ROPE];
ImagerColorPrivate: CEDAR DEFINITIONS
~ BEGIN OPEN ImagerColor, ImagerColorDefs;
ROPE: TYPE ~ Rope.ROPE;
StippleFunction: TYPE ~ {replace, invert, paint, erase};
ConstantColorImpl: TYPE ~ REF ConstantColorImplRep;
ConstantColorImplRep: TYPE ~ RECORD[
Y: REAL, -- intensity, IN[0..1]
variant: SELECT tag: * FROM
stipple => [word: WORD, function: StippleFunction],
gray => [f: REAL],
rgb => [val: RGB],
cie => [val: CIE],
ENDCASE
];
ConstantColorClass: TYPE ~ REF ConstantColorClassRep;
ConstantColorClassRep: TYPE ~ RECORD[
type: ATOM, -- $Gray, $RGB, ...
ComponentFromColor: PROC [color: ConstantColor, name: ATOM] RETURNS [REAL],
propList: Atom.PropList ← NIL
];
RGBCalibrationImpl: TYPE ~ REF RGBCalibrationImplRep;
RGBCalibrationImplRep: TYPE ~ RECORD [
cRX, cRY, cRZ, cGX, cGY, cGZ, cBX, cBY, cBZ: REAL,
cXR, cXG, cXB, cYR, cYG, cYB, cZR, cZG, cZB: REAL
];
RGBData: TYPE ~ REF RGBDataRep;
RGBDataRep: TYPE ~ RECORD [rgb: RGB, calibration: RGBCalibration];
CIEData: TYPE ~ REF CIEDataRep;
CIEDataRep: TYPE ~ RECORD [cie: CIE];
ColorFromStipple: PROC [word: WORD, function: StippleFunction] RETURNS [ConstantColor];
Makes stipples for use by Viewers; the word is interpreted as a 4 by 4 bit tile pattern.
ComponentFromColor: PROC [color: ConstantColor, name: ATOM] RETURNS [REAL];
Returns the color's contribution to the named component, a number IN[0..1].
The currently understood names are $Intensity, $Red, $Green, $Blue.
Eventually, we will provide proper facilities for calibrated colors.
END.