CGColorWithCIE.mesa
Last edited by Maureen Stone, September 19, 1983 4:05 pm
Last edited by Doug Wyatt, August 31, 1982 2:50 pm
Last Edited by: Beach, February 13, 1984 2:20:49 pm PST
DIRECTORY
GraphicsBasic USING [Color];
CGColorWithCIE: CEDAR DEFINITIONS = {
Color: TYPE = GraphicsBasic.Color;
GetStipple: PROC[color: Color] RETURNS[CARDINAL] = INLINE { RETURN[color.g*256+color.b] };
-- get a color's stipple pattern, assuming color.tag = stipple
The following convert between (hue, saturation, value) or (hue, saturation, lightness) and (red, green, blue).
All REALs except h should be in the range [0..1].
--h=undefined means it's a gray.
InvalidColor, Uninitialized: SIGNAL;
undefined: REAL = -1;
HSVToRGB: PROC[h, s, v: REAL] RETURNS[r, g, b: REAL];
RGBToHSV: PROC[r, g, b: REAL] RETURNS[h, s, v: REAL];
--HSV hexacone model.
HSLToRGB: PROC[h, s, l: REAL] RETURNS[r, g, b: REAL];
RGBToHSL: PROC[r, g, b: REAL] RETURNS[h, s, l: REAL];
--HSL double hexacone model.
The following convert between (red, green, blue) and (x,y) chromaticity coordinates.
Initialize the transform with x,y for red, green blue plus Y. Y can default to 1 if you're not matching the monitor to anything else.
CIEToRGB and RGBToCIE will signal Uninitialized if InitCIE has not been called
InitCIE: PROC[xr,yr,xg,yg,xb,yb: REAL, whiteY: REAL ← 1];
add more info hear for real cie. Need two more values?
PhosphorType: TYPE = {long,normal};
InitDefaultCIE: PROC[type: PhosphorType ← long];
default values for long and short persistance phosphors
GetDefaultValues: PROC[type: PhosphorType] RETURNS[xr,yr,xg,yg,xb,yb: REAL];
SetDefaultValues: PROC[xr,yr,xg,yg,xb,yb: REAL, type: PhosphorType];
add more info hear for real cie
CIEToRGB: PROC[x,y, Y: REAL] RETURNS[r, g, b: REAL];
GetMaxY: PUBLIC PROC[x,y: REAL] RETURNS[Y: REAL];
used to clip values of Y for CIEToRGB
RGBToCIE: PROC[r, g, b: REAL] RETURNS [x,y, Y: REAL];
}.