PDGraphics.mesa
Michael Plass, May 9, 1983 2:55 pm
A baby graphics package for testing out the PD file writer.
DIRECTORY IPImagerBasic, IPScan, PDFileWriter, Rope, PressFontReader, XFontCache;
PDGraphics: CEDAR DEFINITIONS = BEGIN
Pair: TYPE = IPImagerBasic.Pair;
PDState: TYPE = PDFileWriter.PDState;
Toner: TYPE = PDFileWriter.Toner;
Context: TYPE = REF ContextRec;
ContextRec: TYPE = RECORD [
transform: Transform,
pdState: PDFileWriter.PDState,
devicePath: IPScan.DevicePath,
clippers: NAT ← 0,
path: LIST OF PathItem,
grayTileRef: ARRAY Toner OF ARRAY [0..64) OF PDFileWriter.LoadReference,
fontCache: XFontCache.FontCache
];
PathItem: TYPE = RECORD [pathItemType: PathItemType, pair: Pair];
PathItemType: TYPE = {move, knot, control};
Transform: TYPE = RECORD [a: REAL ← 1, b: REAL ← 0, c: REAL ← 0, d: REAL ← 1, e: REAL ← 0, f: REAL ← 0];
NewHornetContext: PROC [fileName: Rope.ROPE] RETURNS [context: Context];
NewPuffinContext: PROC [fileName: Rope.ROPE] RETURNS [context: Context];
SetGray: PROC [context: Context, gray: REAL];
SetColor: PROC [context: Context, hue, saturation, value: REAL];
SetBlack: PROC [context: Context];
SetWhite: PROC [context: Context];
SetFunnyGray: PROC [context: Context, gray: REAL, toner: Toner];
TransformPoint: PROC [context: Context, p: Pair] RETURNS [device: Pair];
TransformVector: PROC [context: Context, v: Pair] RETURNS [device: Pair];
Concat: PROC [context: Context, transform: Transform];
Translate: PROC [context: Context, v: Pair];
Scale: PROC [context: Context, s: REAL];
Rotate: PROC [context: Context, degrees: REAL];
MoveTo: PROC [context: Context, x, y: REAL];
LineTo: PROC [context: Context, x, y: REAL];
CurveTo: PROC [context: Context, x1, y1, x2, y2, x3, y3: REAL];
DrawArea: PROC [context: Context];
DrawConvexQuadrilateral: PROC [context: Context, p1, p2, p3, p4: Pair];
ClipArea: PROC [context: Context, exclude: BOOLEANFALSE];
PopClipper: PROC [context: Context];
DrawChars: PROC [context: Context, font: PressFontReader.Font, map: PROC[PROC[CHAR]]];
DrawRope: PROC [context: Context, font: PressFontReader.Font, rope: Rope.ROPE];
DrawChar: PROC [context: Context, font: PressFontReader.Font, char: CHAR];
END.