ImagerBrick.mesa
Copyright Ó 1986, 1989, 1991 by Xerox Corporation. All rights reserved.
Michael Plass, January 13, 1992 2:33 pm PST
For creating halftone bricks and tiles.
DIRECTORY
ImagerSample USING [SampleMap],
ImagerTransformation USING [Transformation],
Prop USING [PropList];
ImagerBrick: CEDAR DEFINITIONS
~ BEGIN
Brick Shape
Transformation: TYPE ~ ImagerTransformation.Transformation;
BrickShape: TYPE ~ RECORD [sSize, fSize, phase: CARD];
BrickShapeFromDeltas: PROC [s0, f0, s1, f1: INT] RETURNS [BrickShape];
BrickSpec: TYPE ~ RECORD [brickShape: BrickShape, m: Transformation];
BrickSpecFromTransformedRectangle: PROC [w, h: REAL, clientToDevice: Transformation, allowedRelativeError: REAL ¬ 0.05, minLevels: CARD ¬ 1] RETURNS [BrickSpec];
BrickSpec.m is a perturbed version of clientToDevice that maps the brick exactly
allowedRelativeError controls how close m ought to be to clientToDevice
minLevels puts a lower limit on the number of pixels in the result
Bricks
Brick: TYPE ~ RECORD [maxSample: CARDINAL, sampleMap: ImagerSample.SampleMap, phase: NAT];
BrickFromDotScreen: PROC [pixelsPerDot: REAL, degrees: REAL, shape: REAL ¬ 0.5, allowedRelativeError: REAL ¬ 0.05, minLevels: CARD ¬ 16, maxSample: CARDINAL ¬ 255, pixelToDevice: Transformation ¬ NIL, trc: PROC [REAL] RETURNS [REAL] ¬ NIL] RETURNS [Brick];
pixelsPerDot is the number of "normalized" device pixels per halftone dot
degrees is the counterclockwise rotation
shape controls how elliptical the dots are; 0.0 and 1.0 give two different line screens, and 0.5 produces a dot symmetrical in x and y (before rotation). A shape parameter that is a little different from 0.5 usually gives a more uniform response curve.
allowedRelativeError, minLevels as above
maxSample is the maximum sample value in the output
pixelToDevice specifies a transformation from the "normalized" device pixels do the actual device pixels; this is useful to account for different scan directions and to allow for differing resolutions in the two directions.
trc is a specification of the desired output-to-input mapping effected by the brick; it should map the interval [0.0..1.0] monotonically onto itself.
FilterProc: TYPE ~ PROC [x, y: REAL] RETURNS [REAL];
A filter function defined on x in [-1..+1], y in [-1..+1], returning values over any range.
BrickFromFilter: PROC [brickSpec: BrickSpec, filter: FilterProc, maxSample: CARDINAL ¬ 255, trc: PROC [REAL] RETURNS [REAL] ¬ NIL] RETURNS [Brick];
Calls the FilterProc to generate the samples; linearizes the result.
maxSample and trc are as above
Halftone Specifications
This is a convenient centralized place for these types.
Toner: TYPE ~ MACHINE DEPENDENT {black, cyan, magenta, yellow, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15};
HalftoneProperties: TYPE ~ LIST OF HalftonePropertiesForSeparation;
HalftonePropertiesForSeparation: TYPE ~ RECORD [type: ATOM, toner: Toner, brick: ImagerBrick.Brick, propList: Prop.PropList ¬ NIL];
The type distingishes classes of bricks for various kinds of color.
END.