PSImager.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Doug Wyatt, May 6, 1987 3:49:14 pm PDT
Graphics state operators
GSave:
PROC [self: Ref];
save graphics state
GRestore:
PROC [self: Ref];
restore graphics state
GRestoreAll:
PROC [self: Ref];
restore to bottommost graphics state
InitGraphics:
PROC [self: Ref];
reset graphics state parameters
SetLineWidth:
PROC [self: Ref, width:
REAL];
set line width
CurrentLineWidth:
PROC [self: Ref]
RETURNS [
REAL];
return current line width
LineCap:
TYPE ~ {butt, round, square};
SetLineCap:
PROC [self: Ref, cap: LineCap];
set shape of ends for stroke
CurrentLineCap:
PROC [self: Ref]
RETURNS [LineCap];
return current line cap
LineJoin:
TYPE ~ {miter, round, bevel};
SetLineJoin:
PROC [self: Ref, join: LineJoin];
set shape of corners for stroke
CurrentLineJoin:
PROC [self: Ref]
RETURNS [LineJoin];
return current line join
SetMiterLimit:
PROC [self: Ref, limit:
REAL];
set miter length limit
CurrentMiterLimit:
PROC [self: Ref]
RETURNS [
REAL];
return current miter limit
Dash: TYPE ~ REF DashRep;
DashRep: TYPE ~ RECORD [offset: REAL, array: SEQUENCE len: NAT OF REAL];
DashArray:
TYPE ~
REF DashArrayRep;
SetDash:
PROC [self: Ref, dash: Dash];
-- *****
set dash pattern for stroking
CurrentDash:
PROC [self: Ref]
RETURNS [Dash];
-- *****
return current dash pattern
SetFlat:
PROC [self: Ref, flat:
REAL];
set flatness tolerance
CurrentFlat:
PROC [self: Ref]
RETURNS [
REAL];
return current flatness
SetGray:
PROC [self: Ref, gray:
REAL];
set color to gray value from 0 (black) to 1 (white)
CurrentGray:
PROC [self: Ref]
RETURNS [
REAL];
return current gray
HSBColor:
TYPE ~
RECORD [hue, sat, brt:
REAL];
SetHSBColor:
PROC [self: Ref, color: HSBColor];
set color given hue, saturation, brightness
CurrentHSBColor:
PROC [self: Ref]
RETURNS [HSBColor];
return current color hue, saturation, brightness
RGBColor:
TYPE ~
RECORD [red, green, blue:
REAL];
SetRGBColor:
PROC [self: Ref, color: RGBColor];
set color given red, green, blue
CurrentRGBColor:
PROC [self: Ref]
RETURNS [RGBColor];
return current color red, green, blue
Screen: TYPE ~ REF ScreenRep;
ScreenRep: TYPE ~ RECORD [...];
SetScreen: PROC [self: Ref, screen: Screen]; -- *****
set halftone screen
CurrentScreen: PROC [self: Ref] RETURNS [Screen]; -- *****
return current halftone screen
Coordinate system and matrix operators
InitMatrix:
PROC [self: Ref];
set CTM to device default
DefaultMatrix:
PROC [self: Ref]
RETURNS [Matrix];
-- *****
return device default matrix
CurrentMatrix:
PROC [self: Ref]
RETURNS [Matrix];
-- *****
return CTM
SetMatrix:
PROC [self: Ref, matrix: Matrix];
-- *****
replace CTM by matrix
Translate:
PROC [self: Ref, t:
VEC];
translate user space by t
Scale:
PROC [self: Ref, s:
VEC];
scale user space by s
Rotate:
PROC [self: Ref, angle:
REAL];
rotate user space by angle degrees
Concat:
PROC [self: Ref, matrix: Matrix];
replace CTM by matrix x CTM
Transform:
PROC [self: Ref, p:
VEC];
transform point p by CTM
DTransform:
PROC [self: Ref, d:
VEC];
transform distance d by CTM
ITransform:
PROC [self: Ref, p:
VEC];
inverse transform point p by CTM
IDTransform:
PROC [self: Ref, d:
VEC];
inverse transform distance d by CTM
Path construction operators
NewPath:
PROC [self: Ref];
initialize current path to be empty
CurrentPoint:
PROC [self: Ref]
RETURNS [
VEC];
return current point coordinates
MoveTo:
PROC [self: Ref, p:
VEC];
set current point to p
RMoveTo:
PROC [self: Ref, d:
VEC];
relative moveto
LineTo:
PROC [self: Ref, p:
VEC];
append straight line to p
RLineTo:
PROC [self: Ref, d:
VEC];
relative lineto
Arc:
PROC [self: Ref, p:
VEC, r:
REAL, ang1, ang2:
REAL];
append counterclockwise arc
ArcN:
PROC [self: Ref, p:
VEC, r:
REAL, ang1, ang2:
REAL];
append clockwise arc
ArcTo:
PROC [self: Ref, p1, p2:
VEC, r:
REAL]
RETURNS [t1, t2:
VEC];
append tangent arc
CurveTo:
PROC [self: Ref, p1, p2, p3:
VEC];
append Bezier cubic section
RCurveTo:
PROC [self: Ref, d1, d2, d3:
VEC];
relative curveto
ClosePath:
PROC [self: Ref];
connect subpath back to its starting point
FlattenPath:
PROC [self: Ref];
convert curves to sequences of straight lines
ReversePath:
PROC [self: Ref];
reverse direction of current path
StrokePath:
PROC [self: Ref];
compute outline of stroked path
CharPath:
PROC [self: Ref, string:
ROPE, outline:
BOOL];
append character outline to current path
ClipPath:
PROC [self: Ref];
set current path to clipping path
Box:
TYPE ~
RECORD [ll, ur:
VEC];
PathBox:
PROC [self: Ref]
RETURNS [Box];
return bounding box of current path
PathForAll:
PROC [self: Ref,
move: PROC [p: VEC],
line: PROC [p: VEC],
curve: PROC [p1, p2, p3: VEC],
close: PROC,
];
enumerate current path
InitClip:
PROC [self: Ref];
set clip path to device default
Clip:
PROC [self: Ref, eo:
BOOL ←
FALSE];
establish new clipping path; if eo, use even-odd rule
Painting operators
ErasePage:
PROC [self: Ref];
paint current page white
Fill:
PROC [self: Ref, eo:
BOOL ←
FALSE];
fill current path with current color; if eo, use even-odd rule
Stroke:
PROC [self: Ref];
draw line along current path
Image:
PROC [self: Ref, width, height:
INT, bitsPerSample:
INT, matrix: Matrix, stream:
STREAM];
-- *****
render sampled image onto current page
ImageMask:
PROC [self: Ref, width, height:
INT, invert:
BOOL, matrix: Matrix, stream:
STREAM];
-- *****
render mask onto current page
Character and font operators
Font: TYPE ~ REF FontRep;
SetFont:
PROC [self: Ref, font: Font];
-- *****
set font dictionary
CurrentFont:
PROC [self: Ref]
RETURNS [Font];
-- *****
return current font dictionary
Show:
PROC [self: Ref, string:
ROPE];
print characters of string on page
AShow:
PROC [self: Ref, a:
VEC, string:
ROPE];
add a to width of each char while showing string
WidthShow:
PROC [self: Ref, c:
VEC, char:
CHAR, string:
ROPE];
add c to width of char while showing string
AWidthShow:
PROC [self: Ref, c:
VEC, char:
CHAR, a:
VEC, string:
ROPE];
combined effects of ashow and widthshow
KShow:
PROC [self: Ref, proc:
PROC, string:
ROPE];
-- *****
execute proc between characters shown
StringWidth:
PROC [self: Ref, string:
ROPE]
RETURNS [
VEC];
width of string in current font