PrintColorXForms.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Maureen Stone, July 27, 1989 12:58:39 pm PDT
Color Transformation routines for printing monitor images
DIRECTORY
PrintColor USING [ColorCorrection],
CalibratedColor USING [RGBCalibration],
ImagerPixel USING [PixelBuffer],
Rope USING [ROPE];
PrintColorXForms: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
ColorCorrection: TYPE ~ PrintColor.ColorCorrection;
TYPES
MatrixN: TYPE = REF MatrixSeq;
MatrixSeq: TYPE = RECORD[SEQUENCE nrows: INTEGER OF RowN];
RowN: TYPE = REF VecSeq;
VecSeq: TYPE = RECORD[SEQUENCE ncols: INTEGER OF Real0];
Real0: TYPE = REAL ← 0;
MatrixEltTable: TYPE = REF MatrixEltTableRec;
MatrixEltTableRec: TYPE = ARRAY[0..LAST[BYTE]] OF INT;
TRCTable: TYPE = REF TRCTableRec;
TRCTableRec: TYPE = ARRAY[0..LAST[BYTE]] OF NAT;
MatrixTables: TYPE ~ REF MatrixTablesRec;
MatrixTablesRec: TYPE ~ RECORD [
m00, m01, m02, m10, m11, m12, m20, m21, m22: MatrixEltTable,
cyan, magenta, yellow: TRCTable ← NIL
];
SWOP Transformation
These routines will perform SWOP GCR and add a black printer to dark colors.
SWOPLinearDotArea: PROC RETURNS [ColorCorrection];
SWOPWithGCLinearLStar: PROC RETURNS [ColorCorrection];
SWOPWithMatrix: PROC[matrixTables: MatrixTables] RETURNS[ColorCorrection];
Use InitMatrixTables below to get the TRCTable
RGB Transformations
RGBToCMYProc: TYPE = PROC[maxSampleIn: ARRAY [0..3) OF CARDINAL, rgbIn, cmyOut: ImagerPixel.PixelBuffer, data: REF];
From here can generate the black printer, etc. or flip values to generate RGB files for previewing (a crude approximation at best).
FlipRGB: RGBToCMYProc; --CMY ← [255,255, 255] -RGB
MatrixTransform: RGBToCMYProc;
The data must be a MatrixTables. This implements Dusty and Mik's matrix color correction, but not their black printer.
InitMatrixTables: PROC[rgbToLStar, densityToDotArea: TRCTable, printerDMax, saturation, contrast: REAL, matrix: MatrixN ← NIL] RETURNS[MatrixTables];
Utility Procedures
ReadTRC: PROC [trcFn: ROPE] RETURNS [trc: TRCTable];
DensityToLStar: PUBLIC PROC [dMax: REAL] RETURNS [trc:TRCTable];
RGBToLStar: PUBLIC PROC [cal: CalibratedColor.RGBCalibration] RETURNS [trc:TRCTable];
IdentityTRC: PROC [] RETURNS [initTrc:TRCTable];
MatrixFromValues: PROC[c0,m0,y0,c1,m1,y1,c2,m2,y2: REAL] RETURNS[MatrixN];
IdentityMatrix: PROC RETURNS[MatrixN];
END.