PixelGraphics.mesa
Contains utilities for doing various kinds of graphing, especially related to working on a raster, and drawing splines.
Eric Nickell, April 25, 1985 7:54:10 am PST
PixelGraphics: CEDAR DEFINITIONS = BEGIN
Point: TYPE ~ RECORD [x, y: INT];
Cubic: TYPE ~ RECORD [ax, ay, bx, by, cx, cy, dx, dy: REAL];
InterpolatePoints: PROC [p0, p1: Point, proc: PROC [p: Point]];
Interpolates the points in the line segment between p0 and p1, calling proc for each one.
Note that no call is made for point p0, but one is made for p1.
Line: PROC [p0, p1: Point] RETURNS [LIST OF Point];
Returns the list of points which constitute the line between p0 and p1.
The points returned will be in order, but no guarantee is made as to which endpoint is found at the beginning of the LIST and which is at the end.
Lines: PROC [p: LIST OF Point] RETURNS [LIST OF Point];
Returns the list of points which constitute the lines between successive points in p.
The points returned will be in order, but no guarantee is made as to which endpoint is found at the beginning of the LIST and which is at the end.
InterpolateLines: PROC [vertices: LIST OF Point, proc: PROC [p: Point]];
Same as Lines above, except that calls proc for each point, instead of placing in a list
Spline: PROC [m: Cubic, segments: CARDINAL] RETURNS [LIST OF Point];
Finds the set of interpolation points for the spline, breaking the spline into segments parts.
InterpolateSpline: PROC [m: Cubic, segments: CARDINAL, proc: PROC [p: Point]];
Same as Spline above, except that calls proc for each point, instead of placing in a list
Bezier: PROC [p1, p2, p3, p4: Point] RETURNS [m: Cubic];
Generates the Cubic matrix for a Bezier spline given the four control points.
Simple: PROC [p1, p2, p3, p4: Point] RETURNS [m: Cubic];
Generates the Cubic matrix for a Cubic spline given the four control points.
BSpline: PROC [p1, p2, p3, p4: Point] RETURNS [m: Cubic];
Generates the Cubic matrix for a B-Spline given the four control points.
CatmullRom: PROC [p1, p2, p3, p4: Point] RETURNS [m: Cubic];
Generates the Cubic matrix for a Catmull-Rom spline given the four control points.
Hermite: PROC [p1, q1, p2, q2: Point] RETURNS [m: Cubic];
Generates the Cubic matrix for a Hermite spline given the two control points and the tangent vectors at those points.
END.