> that's fully generalized (but [can] special-case out to optimized
A little more cribbing from SIGGRAPH 82 (Warnock/Wyatt).
Concise stencil/paint API.
display_context {
interface_to_device;
current position (cpx, cpy) in DCS;
transformation matrix T;
clipping_region CR;
}
Device NewXXXDevice (<optional params>);
Image NewXXXImage (<optional params>);
DisplayContext NewDisplayContext (Device device);
(x,y) GetCurrentPosition (DisplayContext dc);
void SetCurrentPosition (DisplayContext dc, x, y);
Trajectory NewTrajectory (x, y);
Trajectory LineTo (Trajectory t, x, y);
Trajectory CurveTo (Trajectory t, x1, y1, x2, y2, x3, y3);
Trajectory Close (Trajectory t);
Trajectory Rectangle (xl, yl, xu, yu);
Shape NewShape ();
Shape AddToShape (Shape s, Trajectory t);
Shape MakeLineShape (Shape brush, Trajectory t);
Source MakeColorSource (hue, sat, bright);
Source MakeImageSource (Image image);
void DrawShape (DisplayContext dc, Shape shape, Source source);
void DrawMask (DisplayContext dc, Image mask, Source source);
void SetClipShape (DisplayContext dc, Shape shape);
void Translate (DisplayContext dc, x, y);
void Rotate (DisplayContext dc, angle);
void Scale (DisplayContext dc, sx, sy);
void Concatenate (DisplayContext dc, Matrix m);
Matrix GetMatrix (DisplayContext dc);
FontId MakeFont (<font name>);
void DisplayChar (Char c, FontId f);
void DisplayText (String s, FontId f);
<metrics> GetCharMetrics (Char c, FontId f);
_________Internal _ Operations________________________
PS ___________ Warnock/Wyatt _____ Algorithm _________
(automatic) Shape Mapping (Matrix Transforms)
flattenpath Shape Approximation (deCasteljau)
Shape Reduction
clip clippath Shape Clipping (Weiler/Atherton)