DIRECTORY ImagerPixelSeq, ImagerPixelMap, RasterFontIO; GridModulation: CEDAR DEFINITIONS ~ BEGIN PixelMap: TYPE ~ ImagerPixelMap.PixelMap; PixelSeq: TYPE ~ ImagerPixelSeq.PixelSeq; RealSeq: TYPE ~ REF RealSeqRep; RealSeqRep: TYPE ~ RECORD [SEQUENCE length: NAT OF REAL]; EdgeProjection: TYPE ~ REF EdgeProjectionRep; EdgeProjectionRep: TYPE ~ RECORD [ reductionFactor: NAT, weight: INT, sProjection: BOOLEAN, origin: INTEGER, size: NAT, buffer: PixelSeq, penalty: RealSeq, totalBadness: RealSeq, link: PixelSeq, bestEnd: NAT, swathStart: INTEGER, swathSize: NAT ]; OptimizationParameters: TYPE ~ RECORD [ evenness: REAL _ 1.0, penaltyWeight: REAL _ 1.0, edgePinning: REAL _ 1.0, maxOutputDeviation: REAL _ 1.0 ]; StrokeHistogram: TYPE ~ REF StrokeHistogramRep; StrokeHistogramRep: TYPE ~ RECORD [ size: NAT, count: PixelSeq ]; RunSizeMap: TYPE ~ PixelSeq; RunSizeMapFromHistogram: PUBLIC PROC [hist: StrokeHistogram, reductionFactor: NAT] RETURNS [RunSizeMap]; SimpleRunSizeMap: PUBLIC PROC [size: NAT, reductionFactor: NAT] RETURNS [RunSizeMap]; CreateEdgeProjection: PROC [sProjection: BOOLEAN, origin: INTEGER, size: NAT, reductionFactor: NAT, scratch: EdgeProjection _ NIL] RETURNS [EdgeProjection]; CreateStrokeHistogram: PROC [scratch: StrokeHistogram _ NIL] RETURNS [StrokeHistogram]; ProjectEdges: PROC [edgeProjection: EdgeProjection, pixelMap: PixelMap, runSizeMap: RunSizeMap]; AccumulateHistogram: PROC [strokeHistogram: StrokeHistogram, pixelMap: PixelMap, sProjection: BOOLEAN]; DetermineGrid: PROC [edgeProjection: EdgeProjection, param: OptimizationParameters]; EnumerateSampleCoordinates: PROC [edgeProjection: EdgeProjection, action: PROC [inputPixelCoord: INTEGER, outputPixelCoord: INTEGER]]; ModulatedSample: PROC [sProjection, fProjection: EdgeProjection, pixelMap: PixelMap] RETURNS [PixelMap]; ConvertPixelMap: PROC [pixelMap: PixelMap, reductionFactor: INT, param: OptimizationParameters, runSizeMap: RunSizeMap, sScratch, fScratch: EdgeProjection] RETURNS [result: PixelMap]; ComputeConvolutionKernel: PROC [reductionFactor: INT] RETURNS [PixelMap]; GraySample: PROC [sProjection, fProjection: EdgeProjection, pixelMap: PixelMap, kernel: PixelMap, pmScratch: REF ImagerPixelMap.PixelMapRep _ NIL] RETURNS [PixelMap]; ConvertGrayPixelMap: PROC [pixelMap: PixelMap, reductionFactor: INT, param: OptimizationParameters, runSizeMap: RunSizeMap, kernel: PixelMap, sScratch, fScratch: EdgeProjection, pmScratch: REF ImagerPixelMap.PixelMapRep _ NIL] RETURNS [result: PixelMap]; ConvertFont: PROC [input: RasterFontIO.InternalFont, reductionFactor: INT, param: OptimizationParameters] RETURNS [RasterFontIO.InternalFont]; END. xGridModulation.mesa Copyright (C) 1984, Xerox Corporation. All rights reserved. Michael Plass, October 17, 1985 2:19:25 pm PDT Parameters for controlling how the various things that are to be optimized for are to be weighted. Larger values of this encourage the grid lines to be more evenly spaced. The weight applied to contributions from the penalty array. Larger values of this encourage the grid lines around the edges to be displaced less from their ideal positions; may be important to get a consistent height. Limit on how far the features are allowed to move, expressed in terms of output pixels. Does the optimization step. Makes a convolution kernel of the appropriate size for the reductionFactor. The result is 16 bits per pixel, normalized to add to LAST[CARDINAL] Makes an 8 bit-per-pixel image. Look at the impl of this to see how to use the more basic operations. Êh˜Jšœ™J™