<> <> <> <> DIRECTORY ImagerPath USING [PathProc], ImagerScanConverter USING [DevicePath, DeviceRectangle], ImagerTransformation USING [Transformation], Vector2 USING [VEC]; ImagerStroke: CEDAR DEFINITIONS ~ BEGIN VEC: TYPE ~ Vector2.VEC; DevicePath: TYPE ~ ImagerScanConverter.DevicePath; DeviceRectangle: TYPE ~ ImagerScanConverter.DeviceRectangle; StrokeStyle: TYPE ~ { square, -- Square off ends after extending the stroke by half its width butt, -- Square off ends flush with the endpoint round, -- Round ends with a semicircular cap roundWithRoundJoints -- Round ends and joints }; DevicePathFromStroke: PROC [ pathProc: ImagerPath.PathProc, pathData: REF, width: REAL, style: StrokeStyle, closed: BOOL, clientToDevice: ImagerTransformation.Transformation, clipBox: DeviceRectangle, scratch: DevicePath _ NIL -- for re-use of storage ] RETURNS [devicePath: DevicePath]; Bezier: TYPE ~ RECORD [b0, b1, b2, b3: VEC]; -- Bezier control points for a cubic curve Subdivide: PROC [bezier: Bezier, vertex: PROC[VEC], tolerance: REAL _ 0.5]; FlatBezier: PROC [bezier: Bezier, epsilon: REAL] RETURNS [BOOLEAN]; Split: PROC [bezier: Bezier] RETURNS[firstHalf, secondHalf: Bezier]; END. <<>>