DIRECTORY Imager USING [Context, VEC], ImagerColor USING [RGB, Color], ImagerTransformation USING [Transformation], Rope USING [ROPE], CalibratedColor USING [XYZ, SampledCalibration, RGBCalibration], ImagerSample USING [SampleMap]; ColorPlotGamuts: CEDAR DEFINITIONS ~ BEGIN Projection: TYPE = {x,y, lStar, aStar, bStar, uStar, vStar, reflectance, hueAngle}; SampleMap: TYPE = ImagerSample.SampleMap; SampledCalibration: TYPE = CalibratedColor.SampledCalibration; RGBCalibration: TYPE = CalibratedColor.RGBCalibration; VEC: TYPE = Imager.VEC; XYZ: TYPE = CalibratedColor.XYZ; RGB: TYPE = ImagerColor.RGB; ROPE: TYPE = Rope.ROPE; State: TYPE = REF StateRec; StateRec: TYPE = RECORD [ redMap,greenMap,blueMap: SampleMap, xAxis, yAxis: Projection, res: NAT, -- number of samples along longest dimension. white: XYZ, getColor: GetColorProc, getColorData: REF _ NIL, backgroundColor: RGB, transformation: ImagerTransformation.Transformation --based on projections ]; CreateMapState: PROC [xAxis, yAxis: Projection, res: NAT, white: XYZ, getColor: GetColorProc, getColorData: REF, backgroundColor: RGB _ [0.5, 0.5, 0.5]] RETURNS [State]; MapColor: PROC [state: State, color: XYZ] RETURNS [x,y: REAL, rgb: RGB]; MapValues: PROC [state: State, color: XYZ] RETURNS [x,y: REAL]; MarkColor: PROC[state: State, color: XYZ]; MarkColorVals: PROC[state: State, x, y: REAL, rgb: RGB]; MarkPoint: PROC[state: State, ix, iy: INTEGER, rgb: RGB]; GetColorProc: TYPE = PROC[xyz: XYZ, data: REF _ NIL] RETURNS[RGB]; Black: GetColorProc; --constant black Gray: GetColorProc; --constant gray White: GetColorProc; --constant gray SampledRainbow: GetColorProc; --assumes data is SampledCalibration SampledGrayscale: GetColorProc; --assumes data is SampledCalibration RGBRainbow: GetColorProc; --assumes data is RGBCalibration RGBGrayscale: GetColorProc; --assumes data is RGBCalibration RopeFromProjection: PROC[proj: Projection] RETURNS[r: ROPE]; ImageSampleMap: PROC[dc: Imager.Context, state: State]; ImageAndLabel: PROC [dc: Imager.Context, state: State, note: ROPE _ NIL, labelColor: ImagerColor.Color _ NIL]; StatesToInterpress: PROC[states: LIST OF State, ipName: ROPE, label: BOOLEAN _ TRUE, note: ROPE _ NIL, labelColor: ImagerColor.Color _ NIL, bleedBackground: BOOLEAN _ FALSE]; StateFromCalibration: PROC [cal: SampledCalibration, xAxis, yAxis: Projection, res: NAT, getColor: GetColorProc, getColorData: REF _ NIL] RETURNS [State]; StateFromRGBCalibration: PROC [cal: RGBCalibration, xAxis, yAxis: Projection, res: NAT, getColor: GetColorProc, getColorData: REF _ NIL] RETURNS [State]; SampleAndPlot: PROC [state: State, cal: SampledCalibration, sample: NAT _ 8, sampleProc: SampleProc, substituteRainbow: BOOLEAN _ TRUE]; RGBSampleAndPlot: PROC [state: State, cal: RGBCalibration, sample: NAT _ 8, sampleProc: SampleProc]; RGBProc: TYPE = PROC[rgb: RGB]; SampleProc: TYPE = PROC[sample: NAT _ 8, returnRGB: RGBProc]; GrayAxis: SampleProc; HueCircle: SampleProc; ColorsToWhite: SampleProc; ColorsToBlack: SampleProc; GamutSurface: SampleProc; WholeGamut: SampleProc; END. 0ColorPlotGamuts.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Maureen Stone July 23, 1986 10:37:22 am PDT Maureen Stone, June 29, 1988 1:43:49 am PDT For plotting color gamuts. reflectance is Y/white.Y. Hue angle is the LAB hue angle The parameter res tells how many pixels should be along the longer dimension convert color to axis specification and transform. Useful for creating synthetic overlays. convert color to axis specification and transform. Doesn't cal state.getColor. Mark a box in the SampleMap corresponding the to color x,y put into SampleMap, transforming them by the state.transformation. The values x,y are therefore projected color values. Put a mark in the SampleMap GetColor Procs Imaging Images SampleMaps as RGB sampled color Images the SampleMap in the current color, adds labels and the note in the labelColor. If labelColor=NIL uses the current color. Layout is to center the note under the sample map and axis. Different projections put the axis and labels in diazazzaazfferent places. If the note is NIL, no space is left for it. Makes an InterpressMaster on ipName by combining all the SampleMaps and calling ImageAndLabel. The states had better all be the same type. bleedBackground makes gray background for slides Device Gamuts Computes white and calls CreateMapState Samples gamuts and plots the results Sampled XYZ to RGB and back is expensive. Since we are sampling the gamut as a function of RGB, we can do the rainbow colorproc without the conversion. substituteRainbow =TRUE means use the cheap rainbow if the state.getColor=SampledRainbow. Interpolates in sample steps around the gamuts. Interpolates along the gray axis. Interpolates around the surface of the gamut (R,Y,G,C,B,M) in sample steps between vertices. ie, 8 steps between red and yellow, yellow and green, etc. Interpolates from each of the hue circle colors to white Interpolates from each of the hue circle colors to black HueCircle, ColorsToWhite, ColorsToBlack Interpolates uniformly along RGB in sample steps. Includes interior of the gamut. ส‘˜codešœ™Kšœ ฯmœ1™Kšœžœ"˜6Kšžœžœ žœ˜Kšžœžœžœ˜ Kšžœžœžœ˜Kšžœžœžœ˜K˜Kšœžœžœ ˜šœ žœžœ˜Kšœ#˜#Kšœ˜Kšœžœฯc-˜8Kšœžœ˜ K˜Kšœžœžœ˜Kšœžœ˜Kšœ5 ˜KK˜K˜—šฯnœžœ!žœ žœ(žœžœžœ ˜ฉK™L—š กœžœžœžœžœžœ˜HKš [™[—š ก œžœžœžœžœ˜?Kš O™O—šก œžœžœ˜*K™6—šก œžœžœžœ˜8Kš F™FKš 4™4—šก œžœžœžœ˜9K™—K˜—head™Kšœžœžœžœžœžœžœžœ˜BKšกœ ˜&Kšกœ ˜$Kšกœ ˜%Kšกœ $˜BKšกœ $˜DKšก œ  ˜:Kšก œ  ˜<—™Kšกœžœžœžœ˜<šกœžœ#˜7K™&—šก œžœ*ž œ"žœ˜nJšœธ™ธ—šกœžœ žœžœžœ žœžœžœžœ"žœžœžœ˜ฎKšœPก œ`™ฝ——šœ™Kšœก™'Kš กœžœ:žœ(ž œžœ ˜šKš กœžœ6žœ&ž œžœ ˜™K™K™$š ก œžœ1žœ1žœžœ˜ˆKšœ˜™˜KšœY™Y—K˜Kšกœžœ-žœ˜dK™Kšœ/™/Jšœ žœžœžœ˜Kšœ žœžœ žœ˜=šกœ ˜K™!—šก œ ˜K™˜—šก œ ˜K™8—šก œ ˜K™8—šก œ ˜Kšก œก œก ™'—šก œ ˜KšœS™S—K˜—Kšžœ˜—…— ร