PrintColorTransformations.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Maureen Stone, June 4, 1989 3:21:32 pm PDT
Color Transformation routines for printing monitor images
DIRECTORY
PrintColor USING [ColorCorrection],
Rope USING [ROPE];
PrintColorTransformations: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
ColorCorrection: TYPE ~ PrintColor.ColorCorrection;
TYPES
TRCTable: TYPE = REF TRCTableRec;
TRCTableRec: TYPE = ARRAY[0..LAST[BYTE]] OF NAT;
Values: TYPE = RECORD[c0,m0,y0,c1,m1,y1,c2,m2,y2: REAL];
MatrixEltTable: TYPE = REF MatrixEltTableRec;
MatrixEltTableRec: TYPE = ARRAY[0..LAST[BYTE]] OF INT;
MatrixTables: TYPE ~ REF MatrixTablesRec;
MatrixTablesRec: TYPE ~ RECORD [
m00, m01, m02, m10, m11, m12, m20, m21, m22: MatrixEltTable,
cyan, magenta, yellow: TRCTable ← NIL
];
SWOP Transformations
These routines will perform SWOP GCR and add a black printer to dark colors.
Currently converts CMY ← [1,1,1] - RGB.
SWOPLinearDotArea: PROC RETURNS [ColorCorrection];
SWOPWithGCLinearLStar: PROC RETURNS [ColorCorrection];
Rhodes-Lamming color correction
SWOPWithMatrix: PROC[matrixTables: MatrixTables] RETURNS[ColorCorrection];
Use InitMatrixTables below to get the TRCTable.
Uses Rhodes-Lamming matrix with SWOP black printer and linearization
InitMatrixTables: PROC[rgbToLStar, densityToDotArea: TRCTable, printerDMax, saturation, contrast: REAL, values: Values] RETURNS[MatrixTables];
Used with SWOPWithMatrix.
CorrectionType: TYPE ~ {grayBalanceOnly, full};
ProcFromCCSpec: PROC[ccSpec: ROPE, correctionType: CorrectionType, maxSampleOut, maxSampleIn: NAT ← 255] RETURNS[ColorCorrection];
Does both color correction and black printer using the InterpressCC spec data.
Only works for maxSampleIn and maxSampleOut=255
Black only
LuminanceToDotArea: PROC[maxSampleOut, maxSampleIn: NAT ← 255] RETURNS[ColorCorrection];
RBG => luminance => dot area. Good if images are designed already in dot area
Trivial CC procs
NullRGB: PROC[maxSampleOut, maxSampleIn: NAT ← 255] RETURNS[ColorCorrection];
RGB ← RGB
FlipRGB: PROC[maxSampleOut, maxSampleIn: NAT ← 255] RETURNS[ColorCorrection];
CMYK = [C: 255-R, M: 255-G, Y: 255-B, K: 0]. Also the default color correction behavior
FlipAndFullGCR: PROC[maxSampleOut, maxSampleIn: NAT ← 255] RETURNS[ColorCorrection];
C,M,Y computed as for flipRGB, then modified such that
K= MIN[C, M, Y]. [C: C-K, M: M-K, Y: M-K, K: K]
Utility Procedures
ReadTRC: PROC [trcFn: ROPE] RETURNS [trc: TRCTable];
DensityToLStar: PROC [dMax: REAL] RETURNS [trc:TRCTable];
RGBToLStar: PROC RETURNS [trc:TRCTable];
Define the TRC along the gray axis, that is, where R=G=B.
This is independent of the monitor phosphors because
Y/Yn = f(YR+YG+YB)/(YR+YG+YB) for R=G=B
IdentityTRC: PROC [] RETURNS [initTrc:TRCTable];
IdentityValues: PROC RETURNS[Values];
END.