ImageGamuts.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Maureen Stone, July 27, 1989 1:01:08 pm PDT
Reads images, maps colors, plots colors
DIRECTORY
Rope USING [ROPE],
ImagerColor USING [RGB, Color],
AIS USING [Raster, FRef, WRef],
PrintColorXForms USING [TRCTable, MatrixTables],
CalibratedColor USING [RGBCalibration, SampledCalibration, XYZ],
SampleCache USING [RefCache, Sample],
ColorPlotGamuts USING [State, Projection], TRCData;
ImageGamuts: CEDAR DEFINITIONS
~
BEGIN
State: TYPE ~ ColorPlotGamuts.State;
Projection: TYPE ~ ColorPlotGamuts.Projection;
RGBCalibration: TYPE = CalibratedColor.RGBCalibration;
SampledCalibration: TYPE = CalibratedColor.SampledCalibration;
RefCache: TYPE = SampleCache.RefCache;
Sample: TYPE = SampleCache.Sample;
XYZ: TYPE = CalibratedColor.XYZ;
ROPE: TYPE = Rope.ROPE;
RGB: TYPE = ImagerColor.RGB;
Read Images
AISColors: TYPE = {r,g,b, clipped};
AISFile: TYPE = RECORD[name: ROPE ← NIL, fRef: AIS.FRef ← NIL, wRef: AIS.WRef ← NIL, raster: AIS.Raster ← NIL];
AISFiles: TYPE = ARRAY AISColors OF AISFile;
CreateInputData: PROC [fileStem: ROPE, rgbCal: RGBCalibration] RETURNS [inputData: RefCache];
OpenFiles: PROC [fileStem: ROPE] RETURNS [aisFiles: AISFiles];
CloseFiles: PROC [aisFiles: AISFiles];
CreateFiles: PROC [fileStem: ROPE, raster: AIS.Raster] RETURNS [aisFiles: AISFiles];
FindFile: PROC [stem, key, default: ROPE] RETURNS [ROPE];
Plot Image Gamuts
MapProc: TYPE = PROC[rgbBytes: Sample, rgb: ImagerColor.RGB, data: REF] RETURNS[XYZ];
ColorProc: TYPE =PROC[sample: Sample] RETURNS[RGB];
PlotInputData: PROC [state: State, inputData: RefCache, mapData: REF, mapProc: MapProc ← NIL, imageColorProc: ColorProc ← NIL];
Plotting macros
PlotInfo: TYPE = RECORD[aisRoot, ipRoot, note: ROPE, res: NAT, rgbCal: RGBCalibration, sampledCal: SampledCalibration, labelColor: ImagerColor.Color, bleedBackground: BOOLEAN ← TRUE, inputData: RefCache ← NIL];
MapInfo: TYPE = RECORD[mapProc: MapProc, mapData: REF, rgbState: BOOLEAN ← TRUE]; --default color proc makes rainbows on image
GetCalibrations: PROC[rgbAtom, sampledAtom: ATOM] RETURNS[rgbCal: RGBCalibration, sampledCal: SampledCalibration];
MakeChromaPlot: PROC [pi: PlotInfo, xAxis, yAxis: Projection, mapInfo: MapInfo];
MakeLStarPlot: PROC [pi: PlotInfo, xAxis: Projection, mapInfo: MapInfo];
Make3LABViews: PROC [pi: PlotInfo, mapInfo: MapInfo];
Mapped Plots
PrinterMapData: TYPE = REF PrinterMapDataRec;
PrinterMapDataRec: TYPE = RECORD [tables: PrintColorXForms.MatrixTables, sampledCal: SampledCalibration]; -- used to see printed values
MatrixMapData: TYPE = REF MatrixMapDataRec;
MatrixMapDataRec: TYPE = RECORD [tables: PrintColorXForms.MatrixTables, rgbCal: RGBCalibration]; -- used to see mapped values
RGBMap: PUBLIC MapProc; --data is an RGBCal
MatrixMap: MapProc;
PrinterMap: MapProc;
GetMonitorMapInfo: PROC[rgbCal: RGBCalibration] RETURNS[MapInfo];
GetMappedMapInfo: PROC[tables: PrintColorXForms.MatrixTables, rgbCal: RGBCalibration] RETURNS[MapInfo];
GetPrinterMapInfo: PROC[tables: PrintColorXForms.MatrixTables, sampledCal: SampledCalibration] RETURNS[MapInfo];
Map Image Gamuts
SampleProc: TYPE = PROC[in: Sample] RETURNS[out: Sample];
AdjustFiles: PROC [fileStem, adjusted: ROPE, proc: SampleProc];
SaturationMatrix: PROC [rgbToLStar: PrintColorXForms.TRCTable, saturation: REAL, printerDMax: REAL] RETURNS [PrintColorXForms.MatrixTables];
AdjustWithMatrix: PROC [fileStem, adjusted: ROPE, matrixTables: PrintColorXForms.MatrixTables];
END.