ImagerStroke.mesa
Michael Plass, February 6, 1984 1:34:15 pm PST
Doug Wyatt, July 3, 1984 1:11:15 pm PDT
DIRECTORY
ImagerBasic USING [Bezier, Pair, PathMapType, Transformation],
ImagerScanConverter USING [DevicePath, DeviceRectangle];
ImagerStroke: CEDAR DEFINITIONS
~ BEGIN
DevicePath: TYPE ~ ImagerScanConverter.DevicePath;
DeviceRectangle: TYPE ~ ImagerScanConverter.DeviceRectangle;
Bezier: TYPE ~ ImagerBasic.Bezier;
StrokeEnd: TYPE ~ {
square, -- Square off the end after extending the stroke by half its width
butt, -- Square off the end flush with the endpoint
round -- Round the end with a semicircular cap
};
DevicePathFromStroke: PROC [
pathMap: ImagerBasic.PathMapType,
pathData: REF,
clientToDevice: ImagerBasic.Transformation,
width: REAL,
strokeEnd: StrokeEnd,
closed: BOOLEAN,
clipBox: DeviceRectangle,
scratch: DevicePath ← NIL -- for re-use of storage
] RETURNS [devicePath: DevicePath];
Subdivide: PROC [bezier: Bezier, vertex: PROC[ImagerBasic.Pair], tolerance: REAL ← 0.5];
FlatBezier: PROC [bezier: Bezier, epsilon: REAL] RETURNS [BOOLEAN];
Split: PROC [bezier: Bezier] RETURNS[firstHalf, secondHalf: Bezier];
END.