DIRECTORY ColorTypes, ImagerColor; ColorFns: CEDAR DEFINITIONS ~ BEGIN CIELAB: TYPE ~ ColorTypes.CIELAB; CIELUV: TYPE ~ ColorTypes.CIELUV; CMY: TYPE ~ ColorTypes.CMY; HSL: TYPE ~ ColorTypes.HSL; HSV: TYPE ~ ColorTypes.HSV; LCh: TYPE ~ ColorTypes.LCh; RGB: TYPE ~ ColorTypes.RGB; -- RECORD [R, G, B: REAL] XYZ: TYPE ~ ColorTypes.XYZ; YES: TYPE ~ ColorTypes.YES; YIQ: TYPE ~ ColorTypes.YIQ; Yxy: TYPE ~ ColorTypes.Yxy; HSVFromRGB: PROC [RGB] RETURNS [HSV]; RGBFromHSV: PROC [HSV] RETURNS [RGB]; HSLFromRGB: PROC [RGB] RETURNS [HSL]; RGBFromHSL: PROC [HSL] RETURNS [RGB]; Invalid: ERROR; YIQFromRGB: PROC [RGB] RETURNS [YIQ]; RGBFromYIQ: PROC [YIQ] RETURNS [RGB]; YESFromRGB: PROC [RGB] RETURNS [YES]; RGBFromYES: PROC [YES] RETURNS [RGB]; CMYFromRGB: PROC [RGB] RETURNS [CMY]; RGBFromCMY: PROC [CMY] RETURNS [RGB]; DensityFromReflectance: PROC [r: REAL] RETURNS [REAL]; ReflectanceFromDensity: PROC [d: REAL] RETURNS [REAL]; DensityFromDotArea: PROC [area: REAL, solidD: REAL ¬ 1.5, n: REAL ¬ 1.4] RETURNS [density: REAL]; DotAreaFromDensity: PROC [density: REAL, solidD: REAL ¬ 1.5, n: REAL ¬ 1.4] RETURNS [area: REAL]; Tristimulus: PROC [yxy: Yxy] RETURNS [xyz: XYZ]; IlluminantChange: PROC [xyz65: XYZ] RETURNS [XYZ]; YesIlluminantChange: PUBLIC PROC [yes65: YES] RETURNS [YES]; XeroxRGBFromXYZ: PROC [xyz: XYZ] RETURNS [rgb: RGB]; XeroxRGBFromYES: PROC [yes: YES] RETURNS [rgb: RGB]; YESFromXYZ: PROC [xyz: XYZ] RETURNS [yes: YES]; YESFromXeroxRGB: PROC [rgb: RGB] RETURNS [yes: YES]; XYZFromXeroxRGB: PROC [rgb: RGB] RETURNS [xyz: XYZ]; XYZFromYES: PROC [yes: YES] RETURNS [xyz: XYZ]; NTSCRGBFromXYZ: PROC [xyz: XYZ] RETURNS [rgb: RGB]; NTSCRGBFromYIQ: PROC [yiq: YIQ] RETURNS [rgb: RGB]; YIQFromXYZ: PROC [xyz: XYZ] RETURNS [yiq: YIQ]; YIQFromNTSCRGB: PROC [rgb: RGB] RETURNS [yiq: YIQ]; XYZFromNTSCRGB: PROC [rgb: RGB] RETURNS [xyz: XYZ]; XYZFromYIQ: PROC [yiq: YIQ] RETURNS [xyz: XYZ]; NTSCRGBFromYES: PROC [yes: YES] RETURNS [rgb: RGB]; YIQFromYES: PROC [yes: YES] RETURNS [yiq: YIQ]; YESFromNTSCRGB: PROC [rgb: RGB] RETURNS [yes: YES]; YESFromYIQ: PROC [yiq: YIQ] RETURNS [yes: YES]; CIELABFromXYZ: PROC [xyz, white: XYZ] RETURNS [CIELAB]; XYZFromCIELAB: PROC [lab: CIELAB, white: XYZ] RETURNS [XYZ]; Lightness: PROC [Y, whiteY: REAL] RETURNS [REAL]; Luminance: PROC [lStar, whiteY: REAL] RETURNS [REAL]; ABDifference: PROC [c1, c2: CIELAB] RETURNS [REAL]; CMCDifference: PROC [c1, c2: CIELAB] RETURNS [REAL]; HCLDifferenceCIELAB: PROC [c1, c2: CIELAB] RETURNS [hue, chroma, lightness: REAL]; ABChroma: PROC [c: CIELAB] RETURNS [REAL]; ABHueAngle: PROC [c: CIELAB] RETURNS [REAL]; ABHueDifference: PROC [c1, c2: CIELAB] RETURNS [REAL]; LabToLCh: PROC [lab: CIELAB] RETURNS [LCh]; LChToLab: PROC [lch: LCh] RETURNS [CIELAB]; CIELUVFromXYZ: PROC [xyz, white: XYZ] RETURNS [CIELUV]; XYZFromCIELUV: PROC [luv: CIELUV, white: XYZ] RETURNS [XYZ]; UVDifference: PROC [c1, c2: CIELUV] RETURNS [REAL]; HCLDifferenceCIELUV: PROC [c1, c2: CIELUV] RETURNS [hue, chroma, lightness: REAL]; UVChroma: PROC [c: CIELUV] RETURNS [REAL]; UVSaturation: PROC [c: CIELUV] RETURNS [REAL]; UVHueAngle: PROC [c: CIELUV] RETURNS [REAL]; UVHueDifference: PROC [c1, c2: CIELUV] RETURNS [REAL]; END. € ColorFns.mesa Copyright Σ 1985, 1986, 1987, 1992 by Xerox Corporation. All rights reserved. Stone, December 18, 1986 11:51:22 am PST Michael Plass, January 8, 1987 9:37:26 am PST Doug Wyatt, April 10, 1992 4:19 pm PDT Ken Fishkin, September 14, 1992 12:16 pm PDT Computer Graphics Models: HSV, HSL Conversion between RGB and HSV. Conversion between RGB and HSL. HSLFromRGB may raise Invalid. Achromatic/Chromatic Models, YIQ and YES Conversion between RGB and YIQ. Conversion between RGB and YES. Printer-Oriented Models Conversion between RGB and CMY. Simplest implementation produces R=1-C, G=1-M, B=1-Y. Printer-Oriented Functions, Density and Dot Area For ideal Reflectance, or for Transmittance=1-R. Used for computing density from ideal dot area on halftoned films. d _ Log[1/R]. Reflectance of 0 will return a density of 5.0 (R=0.00001) Reflectance is percentage [0+..100]. Density is positive. To be consistant with procedure above, Density in [0..3] Density measured from halftoned patterns on prints does not follow the equations above. Here are equations relating density and dot area for reflective prints. area is percentage in [0..100], Density is positive. D = -n*log[1-a(1-10-solidD/n)] If n=1 then reduces to the Murray-Davis equations (ref. Yule). area is percentage in [0..100], Density is positive. Inverse of above. Functions involving XYZ and its descendants These are _far_ too many functions for my taste: if it was up to me, I'd just have (To)/(From) XYZ for each of these spaces. But, mine not to reason why, mine just to port /PCedar2.0/CES/ImagerColorES.mesa: Converts from the CIE 1931 Yxy color quantities usually measured by colorimeters to tristimuls values. Illuminant correction from D65 to D50. The approximation method described in section 6.3 is used. Illuminant correction from D65 to D50 for a YES color. The approximation method described in section 6.3 is used. If white.Y = 0, the reference white is used (see operator parametrization). If white.Y = 0, the reference white is used (see operator parametrization). Returns L* from luminance Y. If whiteY = 0, the reference white is used (see operator parametrization). Returns luminance Y from L*. If whiteY = 0, the reference white is used (see operator parametrization). CIE 1976 color stimulus difference. CMC(l:c) color stimulus difference. Uses a formula which has been shown to give a better correlation for small color differences in the colorant industries. The relative weightings of the contributions of the differences in L*, C*ab, H*ab, are varied according to the position of the color in the CIELAB space. For compatibility with CalibratedColorFns. CIE 1976 a,b chroma. CIE 1976 a,b hue-angle. CIE 1976 a,b hue-difference. Transforms from cartesian to cylindrical CIELAB coordinates. Transforms from cylindrical to cartesian CIELAB coordinates. If white.Y = 0, the reference white is used (see operator parametrization). If white.Y = 0, the reference white is used (see operator parametrization). CIE 1976 color stimulus difference. For compatibility with CalibratedColorFns. CIE 1976 u,v chroma. CIE 1976 u,v chroma. CIE 1976 u,v hue-angle. CIE 1976 u,v hue-difference. ΚJ–(cedarcode) style•NewlineDelimiter ™code™ Kšœ ΟeœC™NK™(K™-K™&K™,K™—šΟk ˜ K˜—K˜šΟnœžœž œž˜#K˜K˜Kšžœžœžœ˜!Kšžœžœžœ˜!Kšžœžœžœ˜Kšžœžœžœ˜Kšžœžœžœ˜Kšœžœ˜K• CharPropsg'Postfix0 1 .3 textColorPostfix1 3 .div 1 .3 textColorPostfix2 3 .div 1 .3 textColoršžœžœžœΟc˜5Kšžœžœžœ˜Kšžœžœžœ˜Kšžœžœžœ˜Kšœžœ˜—head™"K˜Kš Ÿ œžœžœžœžœ˜%š Ÿ œžœžœžœžœ˜%Kšœ™K™—Kš Ÿ œžœžœžœžœ˜%š Ÿ œžœžœžœžœ˜%K™>K™—KšŸœžœ˜K™—™(Kš Ÿ œžœžœžœžœ˜%š Ÿ œžœžœžœžœ˜%Kšœ™K™—Kš Ÿ œžœžœžœžœ˜%š Ÿ œžœžœžœžœ˜%Kšœžœ™K™——™Kš Ÿ œžœžœžœžœ˜%š Ÿ œžœžœžœžœ˜%Kšœžœ™Kšœ5™5K™——™0K™0K™Bš Ÿœžœžœžœžœ˜6K™HK™&—š Ÿœžœžœžœžœ˜6K™N—K˜K™WK™GšŸœžœžœ žœ žœžœ žœ˜aKšœIΟu œ™TK™@—šŸœžœ žœ žœ žœžœžœ˜aK™G—K˜—™+K™ΞK˜šŸ œžœ žœžœ˜0Kšœf™f—code2š Ÿœžœ žœžœžœ˜2KšœΟdœ’œ<™a—š Ÿœžœžœ žœžœžœ˜