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; 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 ]; SWOPLinearDotArea: PROC RETURNS [ColorCorrection]; SWOPWithGCLinearLStar: PROC RETURNS [ColorCorrection]; SWOPWithMatrix: PROC[matrixTables: MatrixTables] RETURNS[ColorCorrection]; RGBToCMYProc: TYPE = PROC[maxSampleIn: ARRAY [0..3) OF CARDINAL, rgbIn, cmyOut: ImagerPixel.PixelBuffer, data: REF]; FlipRGB: RGBToCMYProc; --CMY _ [255,255, 255] -RGB MatrixTransform: RGBToCMYProc; InitMatrixTables: PROC[rgbToLStar, densityToDotArea: TRCTable, printerDMax, saturation, contrast: REAL, matrix: MatrixN _ NIL] RETURNS[MatrixTables]; 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. ~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 TYPES SWOP Transformation These routines will perform SWOP GCR and add a black printer to dark colors. Use InitMatrixTables below to get the TRCTable RGB Transformations From here can generate the black printer, etc. or flip values to generate RGB files for previewing (a crude approximation at best). The data must be a MatrixTables. This implements Dusty and Mik's matrix color correction, but not their black printer. Utility Procedures Κ˜code•Mark outsideHeaderšœ™Kšœ<™