DIRECTORY PrintColor USING [ColorCorrection], Rope USING [ROPE]; PrintColorTransformations: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; ColorCorrection: TYPE ~ PrintColor.ColorCorrection; 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 ]; SWOPLinearDotArea: PROC RETURNS [ColorCorrection]; SWOPWithGCLinearLStar: PROC RETURNS [ColorCorrection]; SWOPWithMatrix: PROC[matrixTables: MatrixTables] RETURNS[ColorCorrection]; InitMatrixTables: PROC[rgbToLStar, densityToDotArea: TRCTable, printerDMax, saturation, contrast: REAL, values: Values] RETURNS[MatrixTables]; CorrectionType: TYPE ~ {grayBalanceOnly, full}; ProcFromCCSpec: PROC[ccSpec: ROPE, correctionType: CorrectionType, maxSampleOut, maxSampleIn: NAT _ 255] RETURNS[ColorCorrection]; LuminanceToDotArea: PROC[maxSampleOut, maxSampleIn: NAT _ 255] RETURNS[ColorCorrection]; NullRGB: PROC[maxSampleOut, maxSampleIn: NAT _ 255] RETURNS[ColorCorrection]; FlipRGB: PROC[maxSampleOut, maxSampleIn: NAT _ 255] RETURNS[ColorCorrection]; FlipAndFullGCR: PROC[maxSampleOut, maxSampleIn: NAT _ 255] RETURNS[ColorCorrection]; ReadTRC: PROC [trcFn: ROPE] RETURNS [trc: TRCTable]; DensityToLStar: PROC [dMax: REAL] RETURNS [trc:TRCTable]; RGBToLStar: PROC RETURNS [trc:TRCTable]; IdentityTRC: PROC [] RETURNS [initTrc:TRCTable]; IdentityValues: PROC RETURNS[Values]; END. hPrintColorTransformations.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 TYPES SWOP Transformations These routines will perform SWOP GCR and add a black printer to dark colors. Currently converts CMY _ [1,1,1] - RGB. Rhodes-Lamming color correction Use InitMatrixTables below to get the TRCTable. Uses Rhodes-Lamming matrix with SWOP black printer and linearization Used with SWOPWithMatrix. Does both color correction and black printer using the InterpressCC spec data. Only works for maxSampleIn and maxSampleOut=255 Black only RBG => luminance => dot area. Good if images are designed already in dot area Trivial CC procs RGB _ RGB CMYK = [C: 255-R, M: 255-G, Y: 255-B, K: 0]. Also the default color correction behavior 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 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 Κ*˜code•Mark outsideHeaderšœ™Kšœ<™