DIRECTORY ImagerSample USING [Sample, SampleBuffer]; ImagerBrick: CEDAR DEFINITIONS ~ BEGIN Sample: TYPE ~ ImagerSample.Sample; SampleBuffer: TYPE ~ ImagerSample.SampleBuffer; Brick: TYPE ~ REF BrickRep; BrickRep: TYPE ~ RECORD [ sSize, fSize: NAT, -- "slow" and "fast" dimensions phase: NAT, -- phase shift for successive brick "layers", IN[0..fSize) u, v: NAT, -- values matrix was derived from samples: SEQUENCE size: NAT OF REAL ]; FilterProc: TYPE ~ PROC [x, y: REAL] RETURNS [REAL]; DotScreen: FilterProc; LineScreen: FilterProc; NewBrick: PROC [freq, angle: REAL, filter: FilterProc] RETURNS [Brick]; NewSquareBrick: PROC [size: NAT, p, q: INTEGER, pModulation, qModulation: REAL] RETURNS [Brick]; GetElement: PROC [brick: Brick, s, f: NAT] RETURNS [REAL]; ThresholdsFromBrick: PROC [brick: Brick, max: Sample, scratch: SampleBuffer _ NIL] RETURNS [SampleBuffer]; END. :ImagerBrick.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Doug Wyatt, May 18, 1985 2:45:00 pm PDT For creating halftone bricks. A filter function defined on x in [-1..+1], y in [-1..+1], returning values in [0..1] Handy filter functions for NewBrick. freq is the screen frequency, in pixels per dot (need not be an integer) angle is the angle of screen rotation, in degrees Makes a square brick with zero phase. Will return a dot screen if pModulation = qModulation > 0, a line screen if one of these is zero, otherwise something inbetween a dot and line screen. The screen angle will be arctan (p/q), and the period will be size/sqrt(p*p+q*q). Returns the sample value, IN[0..1], corresponding to location s, f. Returns an array of samples IN[0..max], iSize=brick.sSize, jSize=brick.fSize Κθ˜codešœ™Kšœ Οmœ1™