CHAPTER 3
176
Syntax
Type 4 functions also make it possible to include a wide variety of halftone spot
functions without the loss of accuracy that comes from sampling, and without
adding to the list of predefined spot functions (see Section 6.4.2, “Spot
functions.
The language that can be used in a type 4 function contains expressions involving
integers, real numbers, and boolean values only. There are no composite data
structures such as strings or arrays, no procedures, and no variables or names.
information on these operators, see Appendix B of the
PostScript Language
Reference,
Third Edition.) Although the semantics are those of the corresponding
PostScript operators, a PostScript interpreter is not required.
TABLE 3.39 Operators in type 4 functions
OPERATOR TYPE
OPERATORS
Arithmetic operators
abs
add
atan
ceiling
cos
and
bitshift
eq
if
copy
dup
cvi
cvr
div
exp
floor
idiv
ln
log
mod
mul
neg
round
sin
sqrt
sub
truncate
Relational, boolean,
and bitwise operators
Conditional operators
Stack operators
false
ge
gt
ifelse
exch
index
le
lt
ne
not
or
true
xor
pop
roll
The operand syntax for type 4 functions follows PDF conventions rather than
PostScript conventions. The entire code stream defining the function is enclosed
in braces
{ }
. Braces also delimit expressions that are executed conditionally by the
if
and
ifelse
operators:
boolean
{
expression
} if
boolean
{
expression
1
} {
expression
2
} ifelse
This construct is purely syntactic; unlike in PostScript, no “procedure objects” are
involved.