DIRECTORY ImagerPath USING [LineToProc, MoveToProc, PathProc], ImagerSample USING [EdgeAction], ImagerTransformation USING [Transformation], SF USING [Box, BoxAction, BoxGenerator, maxBox]; ImagerScanConverter: CEDAR DEFINITIONS ~ BEGIN PathProc: TYPE ~ ImagerPath.PathProc; Transformation: TYPE ~ ImagerTransformation.Transformation; Box: TYPE ~ SF.Box; maxBox: Box ~ SF.maxBox; BoxAction: TYPE ~ SF.BoxAction; DevicePath: TYPE ~ REF DevicePathRep; DevicePathRep: TYPE; Create: PROC RETURNS [DevicePath]; Destroy: PROC [devicePath: DevicePath]; SetTolerance: PROC [devicePath: DevicePath, tolerance: REAL]; SetPath: PROC [devicePath: DevicePath, path: PathProc, transformation: Transformation ¬ NIL, clipBox: Box ¬ maxBox]; CreatePath: PROC [path: PathProc, transformation: Transformation ¬ NIL, clipBox: Box ¬ maxBox ] RETURNS [DevicePath]; Pair: TYPE ~ RECORD [s, f: REAL]; SetBounds: PROC [devicePath: DevicePath, box: SF.Box]; -- resets to null region MoveTo: PROC [devicePath: DevicePath, pt: Pair]; LineTo: PROC [devicePath: DevicePath, pt: Pair]; ParTo: PROC [devicePath: DevicePath, p1, p2: Pair]; -- parabola CurveTo: PROC [devicePath: DevicePath, p1, p2, p3: Pair]; -- cubic Bezier ConicTo: PROC [devicePath: DevicePath, p1, p2: Pair, r: REAL]; -- conic section BoundingBox: PROC [devicePath: DevicePath, clipBox: Box ¬ maxBox] RETURNS [Box]; NumberOfBoxes: PROC [devicePath: DevicePath] RETURNS [INT]; ConvertToBoxes: PROC [devicePath: DevicePath, oddWrap: BOOL ¬ FALSE, clipBox: Box ¬ maxBox, boxAction: BoxAction]; ConvertToManhattanPolygon: PROC [devicePath: DevicePath, oddWrap: BOOL ¬ FALSE, clipBox: Box ¬ maxBox] RETURNS [LIST OF Box]; Monotone: PROC [devicePath: DevicePath] RETURNS [BOOL]; GenerateEdges: PROC [devicePath: DevicePath, edgeAction: ImagerSample.EdgeAction]; ObjectsFromPath: PROC [path: PathProc, clipBox: Box, objectProc: PROC [Box, SF.BoxGenerator], devicePath: DevicePath]; PathToLines: PROC [moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc, path: ImagerPath.PathProc, transformation: ImagerTransformation.Transformation ¬ NIL, tolerance: REAL]; END. B ImagerScanConverter.mesa Copyright Σ 1984, 1985, 1986, 1989, 1991 by Xerox Corporation. All rights reserved. Michael Plass, August 16, 1991 5:15 pm PDT Doug Wyatt, March 7, 1986 2:06:19 pm PST The DevicePath structure holds the (private) representation of the outline. Create/Destroy Asserts devicePath won't be used anymore. Loading the outline sets the tolerance field in the devicepath. This controls the accuracy of the scan conversion when calling SetPath with this DevicePath, and should be positive. Loads an outline (described by the PathProc) into devicePath. Short for Create + SetPath Loading the outline (continued) Lower-level access to the workings of SetPath Getting the scan-converted results A tight bounding box, clipped to clipBox. Guaranteed to be an upper bound, should be close to the actual. This is the normal output mechanism; boxAction is called for each box of the region. Satisfies assertion for an ImagerManhattan.Polygon. Says whether the area is a monotone region, and hence subject to rapid scan conversion. Enumerates the edges, sorted by increasing sMin. Really useful just for monotone regions. Makes a separate call to objectProc for each trajectory of the path. The Box passed to objectProc is a bounding box for the trajectory, and the BoxGenerator generates the individual boxes. approximates the supplied path by line segments, and maps out using the supplied moveTo and lineTo procs. If transformation is NIL, path coordinates will not be transformed. the tolerance parameter controls the accuracy of the approximation - it should be positive. Κ2•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ΟeœI™TK™*K™(—K˜šΟk ˜ Kšœ žœ$˜4Kšœ žœ˜ Kšœžœ˜,Kšžœžœ(˜0—K˜KšΠblœžœž ˜&šœž˜K˜Kšœ žœ˜%Kšœžœ'˜;Kšœžœžœ˜Kšœžœ˜šœ žœžœ ˜K˜—Kšœ žœžœ˜%šœžœ˜KšœK™K——headšœ™šΟnœžœžœ˜"K˜—š œžœ˜'Kšœ)™)——™š  œžœ%žœ˜=Kšœ‘™‘K˜—š œžœKžœ˜tKšœ=™=K˜—š  œžœ4žœžœ˜vKšœ™——™K™-Kšœžœžœžœ˜!Kš  œžœžœΟc˜OKš œžœ$˜0Kš œžœ$˜0Kš œžœ)‘ ˜?Kš œžœ-‘˜IKš œžœ+žœ‘˜O—™"š  œžœ1žœ˜PKšœ)™)K™—š  œžœžœžœ˜;K™?K™—š œžœ#žœžœ0˜sKšœT™TK˜—š œžœ#žœžœžœžœžœ˜}K™3K˜—š œžœžœžœ˜7K™WK˜—š  œžœ?˜RK™ZK˜—š œžœ,žœžœ(˜vJšœ½™½K˜—š  œžœ‘žœ žœ˜ΈKšœ‹™‹K™——Kšžœ˜K˜—…—FΊ