ImagerStroke.mesa
Copyright © 1984, 1985, 1986 by Xerox Corporation. All rights reserved.
Michael Plass, May 19, 1985 1:07:07 pm PDT
Doug Wyatt, February 24, 1986 4:13:34 pm PST
DIRECTORY
ImagerPath USING [PathProc, MoveToProc, LineToProc, CurveToProc, ConicToProc],
ImagerPen USING [Pen],
ImagerTransformation USING [Transformation],
Real USING [LargestNumber],
Vector2 USING [VEC];
ImagerStroke: CEDAR DEFINITIONS
~
BEGIN
VEC: TYPE ~ Vector2.VEC;
bigReal:
REAL ~ Real.LargestNumber;
PathFromStroke:
PROC [path: ImagerPath.PathProc, closed:
BOOL,
width:
REAL, end:
INT, joint:
INT, m: ImagerTransformation.Transformation,
moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc,
conicTo: ImagerPath.ConicToProc, curveTo: ImagerPath.CurveToProc
];
Produces the outline of a stroke in device, view or surface coordinates, given a path for the centerline in client coordinates.
SquareEndWithNoDirection:
SIGNAL;
May be raised as an informational signal by PathFromStroke; should be turned into an appearance warning by Interpress.
PenStroke:
PROC [path: ImagerPath.PathProc, pen: ImagerPen.Pen, closed:
BOOL,
moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc,
conicTo: ImagerPath.ConicToProc, curveTo: ImagerPath.CurveToProc,
end:
PROC [p:
VEC, v:
VEC, i0, i1: VertexIndex],
joint:
PROC [p:
VEC, v0, v1:
VEC, i0, i1: VertexIndex]
];
This is a more basic routine. Produces the outline of a stroke, given a path for the centerline. The input path is in a coordinate system with one unit per pixel. The output outlines wind counterclockwise in this coordinate system. The pen must be convex.
Dashes:
PROC [path: ImagerPath.PathProc,
patternLen:
NAT, pattern:
PROC [i:
NAT]
RETURNS [
REAL], offset, length:
REAL,
moveTo: ImagerPath.MoveToProc, lineTo: ImagerPath.LineToProc,
conicTo: ImagerPath.ConicToProc, curveTo: ImagerPath.CurveToProc
];
Produces dash segments, given a path and dash specification.
END.