Commit 64b93b74 authored by Peter Billam's avatar Peter Billam

trying to summarise PS operators in html

parent 71e8fe0e
<HTML><HEAD><TITLE>PostScript Operators
</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8" />
<SCRIPT LANGUAGE="JavaScript"> <!--
// -->
</SCRIPT>
</HEAD><BODY BGCOLOR="#FFFFFF">
<CENTER><H2><A NAME="top">PostScript Operators
</A></H2>
</CENTER>
<P>
<B>Operand&nbsp;Stack&nbsp;Manipulation&nbsp;Operators</B> &nbsp;
<A HREF="stack_ops.html#pop">
pop</A>
<A HREF="stack_ops.html#exch">
exch</A>
<A HREF="stack_ops.html#dup">
dup</A>
<A HREF="stack_ops.html#copy">
copy</A>
<A HREF="stack_ops.html#index">
index</A>
<A HREF="stack_ops.html#roll">
roll</A>
<A HREF="stack_ops.html#clear">
clear</A>
<A HREF="stack_ops.html#count">
count</A>
<A HREF="stack_ops.html#mark">
mark</A>
<A HREF="stack_ops.html#cleartomark">
cleartomark</A>
<A HREF="stack_ops.html#counttomark">
counttomark</A>
<BR>
<B>Arithmetic,&nbsp;Math</B> &nbsp;
<A HREF="math_ops.html#add">
add</A>
<A HREF="math_ops.html#div">
div</A>
<A HREF="math_ops.html#idiv">
idiv</A>
<A HREF="math_ops.html#mod">
mod</A>
<A HREF="math_ops.html#mul">
mul</A>
<A HREF="math_ops.html#sub">
sub</A>
<A HREF="math_ops.html#abs">
abs</A>
<A HREF="math_ops.html#neg">
neg</A>
<A HREF="math_ops.html#ceiling">
ceiling</A>
<A HREF="math_ops.html#floor">
floor</A>
<A HREF="math_ops.html#round">
round</A>
<A HREF="math_ops.html#truncate">
truncate</A>
<A HREF="math_ops.html#sqrt">
sqrt</A>
<A HREF="math_ops.html#atan">
atan</A>
<A HREF="math_ops.html#cos">
cos</A>
<A HREF="math_ops.html#sin">
sin</A>
<A HREF="math_ops.html#exp">
exp</A>
<A HREF="math_ops.html#ln">
ln</A>
<A HREF="math_ops.html#log">
log</A>
<A HREF="math_ops.html#rand">
rand</A>
<A HREF="math_ops.html#srand">
srand</A>
<A HREF="math_ops.html#rrand">
rrand</A>
<BR>
<B>Array&nbsp;Operators</B> &nbsp;
array
[
]
length
get put
getinterval
putinterval
astore
aload
copy
forall
<BR>
<B>Packed&nbsp;Array&nbsp;Operators</B> &nbsp;
packedarray
currentpacking
setpacking
length
get
getinterval
aload
copy
forall
<BR>
<B>Dictionary&nbsp;Operators</B> &nbsp;
dict
&lt;&lt;
&gt;&gt;
length
maxlength
begin
end
def
load
store
get
put
undef
known
where
copy
forall
currentdict
errordict
$error
systemdict
userdict
globaldict
statusdict
countdictstack
dictstack
cleardictstack
<BR>
<B>String&nbsp;Operators</B> &nbsp;
string
length
get
put
getinterval
putinterval
copy
forall
anchorsearch
search
token
<BR>
<B>Relational,&nbsp;Boolean&nbsp;and&nbsp;Bitwise&nbsp;Operators</B> &nbsp;
eq
ne
ge
gt
le
lt
and
not
or
xor
true
false
bitshift
<BR>
<B>Control&nbsp;Operators</B> &nbsp;
exec
if
ifelse
for
repeat
loop
exit
stop
stopped
countexecstack
execstack
quit
start
<BR>
<B>Type,&nbsp;Attribute&nbsp;and&nbsp;Conversion</B> &nbsp;
type
cvlit
cvx
xcheck
executeonly
noaccess
readonly
rcheck
wcheck
cvi
cvn
cvr
cvrs
cvs
<BR>
<B>File&nbsp;Operators</B> &nbsp;
file
filter
closefile
read
write
readhexstring
writehexstring
readstring
writestring
readline
token
bytesavailable
flush
flushfile
resetfile
status
run
currentfile
deletefile
renamefile
filenameforall
setfileposition
fileposition
print
=
==
stack
pstack
printobject
writeobject
setobjectformat
currentobjectformat
<BR>
<B>Resource&nbsp;Operators</B> &nbsp;
defineresource
undefineresource
findresource
resourcestatus
resourceforall
<BR>
<B>Virtual&nbsp;Memory&nbsp;Operators</B> &nbsp;
save
restore
setglobal
currentglobal
gcheck
startjob
defineuserobject
execuserobject
undefineuserobject
UserObjects
<BR>
<B>Miscellaneous&nbsp;Operators</B> &nbsp;
bind
null
version
realtime
usertime
languagelevel
product
revision
serialnumber
echo
prompt
<BR>
<B>Graphics&nbsp;State&nbsp;Operators&nbsp;-&nbsp;Device&nbsp;Independent</B> &nbsp;
gsave
grestore
grestoreall
initgraphics
gstate
setgstate
currentgstate
seetlinewidth
currentlinewidth
setlinecap
currentlinecap
setlinejoin
currentlinejoin
setmiterlimit
currentmiterlimit
setstrokeadjust
currentstrokeadjust
setdash
currentdash
setcolorspace
currentcolorspace
setcolor
currentcolor
currentcolor
setgray
currentgray
sethsbcolor
currenthsbcolor
setrgbcolor
currentrgbcolor
setcmykcolor
currentcmykcolor
<BR>
<B>Graphics&nbsp;State&nbsp;Operators&nbsp;-&nbsp;Device&nbsp;Dependent</B> &nbsp;
sethalftone
currenthalftone
setscreen
currentscreen
setcolorscreen
currentcolorscreen
settransfer
currenttransfer
setcolortrnasfer
currentcolortransfer
setblackgeneration
currentblackgeneration
setundercolorremoval
currentundercolorremoval
setcolorrendering
currentcolorrendering
setflat
currentflat
setoverprint
currentoverprint
<BR>
<B>Coordinate&nbsp;System&nbsp;and&nbsp;Matrix&nbsp;Operators</B> &nbsp;
matrix
initmatrix
identmatrix
defaultmatrix
setmatrix
translate
scale
rotate
concat
concatmatrix
transform
dtransform
ltransform
idtransform
invertmatrix
<BR>
<B>Path&nbsp;Construction&nbsp;Operators</B> &nbsp;
newpath
currentpoint
moveto
rmoveto
lineto
rlineto
arc
arcn
arct
arcto
curveto
rcurveto
closepath
flattenpath
reversepath
strokepath
ustrokepath
charpath
uappend
clippath
setbbox
pathbbox
pathforall
upath
clip
eoclip
rectclip
ucache
<BR>
<B>Painting&nbsp;Operators</B> &nbsp;
erasepage
fill
eofill
stroke
ufill
ueofill
ustroke
rectfill
rectstroke
image
colorimage
imagemask
<BR>
<B>Insidedness&nbsp;Testing&nbsp;Operators</B> &nbsp;
infill
ineofill
inufill
inueofill
instroke
<BR>
<B>Form&nbsp;and&nbsp;Pattern&nbsp;Operators</B> &nbsp;
makepattern
setpattern
execform
<BR>
<B>Device&nbsp;Setup&nbsp;and&nbsp;Output&nbsp;Operators</B> &nbsp;
showpage
copypage
setpagedevice
currentpagedevice
nulldevice
<BR>
<B>Character&nbsp;and&nbsp;Font&nbsp;Operators</B> &nbsp;
definefont
undefinefont
findfont
scalefont
makefont
setfont
currentfont
rootfont
selectfont
show
ashow
widthshow
awidthshow
xshow
xyshow
glyphshow
stringwidth
cshow
kshow
FontDictionary
GlobalFontDictionary
StandardEncoding
ISOLatin1Encoding
findencoding
setcachedevice
setcachedevice2
setcharwidth
<BR>
<B>Interpreter&nbsp;Parameter&nbsp;Operators</B> &nbsp;
<BR>
<B>Display&nbsp;PostScript&nbsp;Operators</B> &nbsp;
<BR>
<B>Errors</B> &nbsp;
</P></BODY></HTML>
<HTML><HEAD><TITLE>PostScript Arithmetic and Maths Operators
</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8" />
<SCRIPT LANGUAGE="JavaScript"> <!--
// -->
</SCRIPT>
</HEAD><BODY BGCOLOR="#FFFFFF">
<CENTER><H2><A NAME="top">PostScript Arithmetic and Maths Operators
</A></H2>
</CENTER>
<P>
<A NAME="add"></A>
<I>num<SUB>1</SUB> &nbsp; num<SUB>2</SUB></I> &nbsp; <B>add</B>
&nbsp; =&gt; &nbsp; <I>sum</I><BR>
&nbsp; Returns <I>num</I><SUB>1</SUB> + <I>num</I><SUB>2</SUB>.
If both are integers and the sum is in range, the sum is an integer.
</P><P>
<A NAME="div"></A>
<I>num<SUB>1</SUB> &nbsp; num<SUB>2</SUB></I> &nbsp; <B>div</B>
&nbsp; =&gt; &nbsp; <I>quotient</I><BR>
&nbsp; Divides <I>num<SUB>1</SUB></I> by <I>num<SUB>2</SUB></I>
and returns a float.<BR> &nbsp; &nbsp; 3 2 div &nbsp; =&gt; &nbsp; 1.5<BR>
&nbsp; &nbsp; 4 2 div &nbsp; =&gt; &nbsp; 2.0<BR>
</P><P>
<A NAME="idiv"></A>
<I>int<SUB>1</SUB> &nbsp; int<SUB>2</SUB></I> &nbsp; <B>idiv</B>
&nbsp; =&gt; &nbsp; <I>quotient</I><BR>
&nbsp; Divides <I>int<SUB>1<//SUB></I> by <I>int<SUB>2</SUB></I>
and returns the integer part, with any fractional part discarded.<BR>
&nbsp; &nbsp; &nbsp;3 2 idiv &nbsp; =&gt; &nbsp; 1<BR>
&nbsp; &nbsp; &nbsp;4 2 idiv &nbsp; =&gt; &nbsp; 2<BR>
&nbsp; &nbsp; -5 2 idiv &nbsp; =&gt; &nbsp; -2<BR>
</P><P>
<A NAME="mod"></A>
<I>int<SUB>1</SUB> &nbsp; int<SUB>2</SUB>
</I> &nbsp; <B>mod</B> &nbsp; =&gt; &nbsp; <I>
remainder</I><BR>
&nbsp; Returns the remainder that results
from dividing <I>int<SUB>1</SUB></I> by <I>int<SUB>2</SUB><BR>
&nbsp; &nbsp; &nbsp;5 3 idiv &nbsp; =&gt; &nbsp; 2<BR>
&nbsp; &nbsp; &nbsp;5 2 idiv &nbsp; =&gt; &nbsp; 1<BR>
&nbsp; &nbsp; -5 3 idiv &nbsp; =&gt; &nbsp; -2<BR>
</P><P>
<A NAME="mul"></A>
<I>num<SUB>1</SUB> &nbsp; num<SUB>2</SUB></I>
</I> &nbsp; <B>mul</B> &nbsp; =&gt; &nbsp; <I>
product</I><BR>
&nbsp; Returns <I>num<SUB>1</SUB></I> * <I>num<SUB>2</SUB></I>.
If both are integers and the product is within range, it is also an integer.
</P><P>
<A NAME="sub"></A>
<I>num<SUB>1</SUB> &nbsp; num<SUB>2</SUB></I>
</I> &nbsp; <B>sub</B> &nbsp; =&gt; &nbsp; <I>
difference</I><BR>
&nbsp; Returns <I>num<SUB>1</SUB></I> - <I>num<SUB>2</SUB></I>.
If both are integers and the difference is within range, it is also an integer.
</P><P>
<A NAME="abs"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>abs</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Returns the absolute value of <I>num<SUB>1</SUB></I> without changing its type.<BR>
&nbsp; &nbsp; 4.5 abs &nbsp; =&gt; &nbsp; 4.5<BR>
&nbsp; &nbsp; -3 &nbsp; abs &nbsp; =&gt; &nbsp; 3<BR>
</P><P>
<A NAME="neg"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>neg</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Returns the negative of <I>num<SUB>1</SUB></I> without changing its type.<BR>
&nbsp; &nbsp; 4.5 neg &nbsp; =&gt; &nbsp; -4.5<BR>
&nbsp; &nbsp; -3 &nbsp; neg &nbsp; =&gt; &nbsp; 3<BR>
</P><P>
<A NAME="ceiling"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>ceiling</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Returns the least integer greater than or equal to <I>num<SUB>1</SUB></I> without changing its type.<BR>
&nbsp; &nbsp; 3.2 &nbsp;ceiling &nbsp; =&gt; &nbsp; 4.0<BR>
&nbsp; &nbsp; -4.8 ceiling &nbsp; =&gt; &nbsp; -4.0<br>
&nbsp; &nbsp; 99 &nbsp; ceiling &nbsp; =&gt; &nbsp; 99
</P><P>
<A NAME="floor"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>floor</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Returns the greatest integer less than or equal to
<I>num<SUB>1</SUB></I> without changing its type.<BR>
&nbsp; &nbsp; 3.2 &nbsp;floor &nbsp; =&gt; &nbsp; 3.0<BR>
&nbsp; &nbsp; -4.8 floor &nbsp; =&gt; &nbsp; -5.0<BR>
&nbsp; &nbsp; 99 &nbsp; floor &nbsp; =&gt; &nbsp; 99
</P><P>
<A NAME="round"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>round</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Returns the integer-value nearer to <I>num<SUB>1</SUB></I>
without changing its type.<BR>
&nbsp; &nbsp; 3.2 &nbsp;round &nbsp; =&gt; &nbsp; 3.0<BR>
&nbsp; &nbsp; 6.5 &nbsp;round &nbsp; =&gt; &nbsp; 7.0<BR>
&nbsp; &nbsp; -4.8 round &nbsp; =&gt; &nbsp; -5.0<BR>
&nbsp; &nbsp; -6.5 round &nbsp; =&gt; &nbsp; -6.0<BR>
&nbsp; &nbsp; 99 &nbsp; round &nbsp; =&gt; &nbsp; 99
</P><P>
<A NAME="truncate"></A>
<I>num<SUB>1</SUB></I> &nbsp; <B>truncate</B> &nbsp; =&gt; &nbsp;
<I>num<SUB>2</SUB></I><BR>
&nbsp; Truncates <I>num<SUB>1</SUB></I> toward zero by removing its fractional part,
without changing its type.<BR>
&nbsp; &nbsp; 3.2 &nbsp;truncate &nbsp; =&gt; &nbsp; 3.0<BR>
&nbsp; &nbsp; -4.8 truncate &nbsp; =&gt; &nbsp; -4.0<BR>
&nbsp; &nbsp; 99 &nbsp; truncate &nbsp; =&gt; &nbsp; 99
</P><P>
<A NAME="sqrt"></A>
<I>num</I> &nbsp; <B>sqrt</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Returns the square root of <I>num</I>, which must be non-negative.
The result is a real.
</P><P>
<A NAME="atan"></A>
<I>num &nbsp; den</I> &nbsp; <B>atan</B> &nbsp; =&gt; &nbsp; <I>
angle</I><BR>
&nbsp; Returns the angle (in degrees 0..360)
whose tangent is <I>num/den</I><BR>
&nbsp; &nbsp; 0 1 atan &nbsp; =&gt; &nbsp; 0.0<BR>
&nbsp; &nbsp; 1 0 atan &nbsp; =&gt; &nbsp; 90<BR>
&nbsp; &nbsp; -100 0 atan &nbsp; =&gt; &nbsp; 270<BR>
&nbsp; &nbsp; 4 4 atan &nbsp; =&gt; &nbsp; 45<BR>
</P><P>
<A NAME="cos"></A>
<I>angle</I> &nbsp; <B>cos</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Returns the cosine of <I>angle</I> (which is in degrees).<BR>
&nbsp; &nbsp; &nbsp;0 cos &nbsp; =&gt; &nbsp; 1.0<BR>
&nbsp; &nbsp; 90 cos &nbsp; =&gt; &nbsp; 0.0<BR>
</P><P>
<A NAME="sin"></A>
<I>angle</I> &nbsp; <B>sin</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Returns the sine of <I>angle</I> (which is in degrees).
</P><P>
<A NAME="exp"></A>
<I>base</I> &nbsp; <I>exponent</I> &nbsp; <B>exp</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Raises <I>base</I> to <I>exponent</I> power.
The result is always real.<BR>
&nbsp; &nbsp; 9 0.5 exp &nbsp; =&gt; &nbsp; 3.0<BR>
&nbsp; &nbsp; -9 -1 exp &nbsp; =&gt; &nbsp; -0.11111<BR>
</P><P>
<A NAME="ln"></A>
<I>num</I> &nbsp; <B>ln</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Returns the natural logarithm (base <I>e</I>) of <I>num</I>.
The result is a real.<BR>
&nbsp; &nbsp; &nbsp;10 ln &nbsp; =&gt; &nbsp; 2.30259<BR>
&nbsp; &nbsp; 100 ln &nbsp; =&gt; &nbsp; 4.60517<BR>
</P><P>
<A NAME="log"></A>
<I>num</I> &nbsp; <B>log</B> &nbsp; =&gt; &nbsp;
<I>real</I><BR>
&nbsp; Returns the common logarithm (base 10) of <I>num</I>.
The result is a real.<BR>
&nbsp; &nbsp; &nbsp;10 ln &nbsp; =&gt; &nbsp; 1.0<BR>
&nbsp; &nbsp; 100 ln &nbsp; =&gt; &nbsp; 2.0<BR>
</P><P>
<A NAME="rand"></A>
<B>rand</B> &nbsp; =&gt; &nbsp;
<I>int</I><BR>
&nbsp; Returns a random integer in the range 0 to 2<SUP>31</SUP> - 1
</P><P>
<A NAME="srand"></A>
<I>int</I> &nbsp; <B>srand</B> &nbsp; =&gt; &nbsp; -<BR>
&nbsp; Initialises the random number generator.
</P><P>
<A NAME="rrand"></A>
<B>rrand</B> &nbsp; =&gt; &nbsp;
<I>int</I><BR>
&nbsp; Returns the current state of the random number generator.
</P><CENTER><P>
Back to
<A HREF="index.html">index.html</A>
</P><CENTER></BODY></HTML>
<HTML><HEAD><TITLE>PostScript Stack Operators
</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8" />
<SCRIPT LANGUAGE="JavaScript"> <!--
// -->
</SCRIPT>
</HEAD><BODY BGCOLOR="#FFFFFF">
<CENTER><H2><A NAME="top">PostScript Stack Operators
</A></H2>
</CENTER>
<P>
<A NAME="pop"></A>
<I>any</I> &nbsp; <B>pop</B> &nbsp; =&gt; &nbsp; -<BR>
&nbsp; Removes the top element from the operand stack and discards it.
</P><P>
<A NAME="exch"></A>
<I>any<SUB>1</SUB> &nbsp; any<SUB>2</SUB>
</I> &nbsp; <B>exch</B> &nbsp; =&gt; &nbsp; <I>
any<SUB>2</SUB> &nbsp; any<SUB>1</SUB></I><BR>
&nbsp; Exchanges the top two elements.
</P><P>
<A NAME="dup"></A>
<I>any</I> &nbsp; <B>dup</B> &nbsp; =&gt; &nbsp;
<I>any</I> &nbsp; <I>any</I><BR>
&nbsp; Duplicates the top element.
</P><P>
<A NAME="copy"></A>
<I>any<SUB>1</SUB> . . . any<SUB>n</SUB> &nbsp; n
</I> &nbsp; <B>copy</B> &nbsp; =&gt; &nbsp; <I>
any<SUB>1</SUB> . . . any<SUB>n</SUB> &nbsp;
any<SUB>1</SUB> . . . any<SUB>n</SUB></I><BR>
&nbsp; Removes <I>n</I> and copies the top <I>n</I> elements.
</P><P>
<A NAME="index"></A>
<I>any<SUB>n</SUB> . . . any<SUB>o</SUB> &nbsp; n
</I> &nbsp; <B>index</B> &nbsp; =&gt; &nbsp; <I>
any<SUB>n</SUB> . . . any<SUB>o</SUB> &nbsp;
any<SUB>n</SUB></I><BR>
&nbsp; Removes <I>n</I> and copies the <I>n</I>'th element
to the top of the stack.
</P><P>
<A NAME="roll"></A>
<I>any<SUB>n-1</SUB></I> . . . <I>any<SUB>0</SUB> &nbsp; n &nbsp; j
</I> &nbsp; <B>roll</B> &nbsp; =&gt; &nbsp; <I>
any<SUB>(j-1) mod 1</SUB> . . . any<SUB>0</SUB> &nbsp;
any<SUB>n-1</SUB> . . . any<SUB>j mod n</SUB></I><BR>
&nbsp; Rolls the top <I>n</I> elements upwards by <I>j</I> steps.<BR>
&nbsp; &nbsp; (a) (b) (c) 3 -1 roll &nbsp; =&gt; &nbsp; (b) (c) (a)<BR>
&nbsp; &nbsp; (a) (b) (c) 3 &nbsp;1 roll &nbsp; =&gt; &nbsp; (c) (a) (b)<BR>
&nbsp; &nbsp; (a) (b) (c) 3 &nbsp;0 roll &nbsp; =&gt; &nbsp; (a) (b) (c)
</P><P>
<A NAME="clear"></A>
<B>clear</B>
</P><P>
<A NAME="count"></A>
<B>count</B>
</P><P>
<A NAME="mark"></A>
<B>mark</B>
</P><P>
<A NAME="cleartomark"></A>
<B>cleartomark</B>
</P><P>
<A NAME="counttomark"></A>
<B>counttomark</B>
</P><CENTER><P>
Back to
<A HREF="index.html">index.html</A>
</P><CENTER></BODY></HTML>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment