<> <> <> <> <> <> <<>> DIRECTORY ImagerBasic USING [ConstantColor], ColorModels USING [undefined, Calibration], Rope USING [ROPE]; ConstantColors: CEDAR DEFINITIONS = BEGIN black, white: ConstantColor; -- of course we need these red, green, blue: ConstantColor; -- additive primaries magenta, cyan, yellow: ConstantColor; -- subtractive primaries orange, purple, brown: ConstantColor; -- for Color Naming Scheme grey, darkGrey, lightGrey, veryDarkGrey, veryLightGrey: ConstantColor; -- gives 7 grey levels -- All REAL values below should be in the range [0..1] except for undefined hues. -- HSV is hue, saturation, value (hexacone model); -- HSL is hue, saturation, lightness (double ended hexacone) -- RGB is red, green, blue. <> undefined: REAL = ColorModels.undefined; -- (-1.0) Calibration: TYPE = ColorModels.Calibration; ConstantColor: TYPE = ImagerBasic.ConstantColor; UndefinedColor: SIGNAL; IntensityToColor: PROC [intensity: REAL, cal: Calibration _ NIL] RETURNS [ConstantColor]; HSVToColor: PROC [h, s, v: REAL, cal: Calibration _ NIL] RETURNS [ConstantColor]; HSLToColor: PROC [h, s, l: REAL, cal: Calibration _ NIL] RETURNS [ConstantColor]; RGBToColor: PROC [r, g, b: REAL, cal: Calibration _ NIL] RETURNS [ConstantColor]; -- The above 4 procedures will SIGNAL Runtime.BoundsFault for any argument -- not in [0..1]; resuming the signal will perform arg _ MAX[0,MIN[1,arg]]. CIEToColor: PROC [x,y,Y: REAL] RETURNS [ConstantColor]; <<--CIE color system>> NameToColor: PROC [name: Rope.ROPE, cal: Calibration _ NIL] RETURNS [ConstantColor]; <<--Color naming system.>> <> <<>> <> <> <> <> <> <> <<>> <> <> ColorToIntensity: PROC[color: ConstantColor, cal: Calibration _ NIL] RETURNS[intensity: REAL]; ColorToHSV: PROC [color: ConstantColor, cal: Calibration _ NIL] RETURNS [h, s, v: REAL]; ColorToHSL: PROC [color: ConstantColor, cal: Calibration _ NIL] RETURNS [h, s, l: REAL]; ColorToRGB: PROC [color: ConstantColor, cal: Calibration _ NIL] RETURNS [r, g, b: REAL]; ColorToCIE: PROC [color: ConstantColor] RETURNS [x,y,Y: REAL]; ColorToName: PROC [color: ConstantColor, cal: Calibration _ NIL] RETURNS [name: Rope.ROPE]; END.