SECTION 3.9
175
Functions
The last function applies to
x
values in the last subdomain, which includes the
upper bound:
Bounds
k−2
x
Domain
1
. The value of
k
may be 1, in which case
the
Bounds
array is empty and the single item in the
Functions
array applies to all
x
values,
Domain
0
x
Domain
1
.
The
Encode
array contains 2
×
k
numbers. A value
x
from the
ith
subdomain is
encoded as follows:
·
x′
=
Interpolate
(
x
,
Bounds
i
1
,
Bounds
i
,
Encode
2i
,
Encode
2i
+
1
)
for 0
i
<
k.
In this equation,
Bounds
−1
means
Domain
0
, and
Bounds
k−1
means
Domain
1
. If the last bound,
Bounds
k−2
, is equal to
Domain
1
, then
x
is defined to
be
Encode
2i
.
The stitching function is designed to make it easy to combine several functions to
be used within one shading pattern over different parts of the shading’s domain.
(Shading patterns are discussed in Section 4.6.3, “Shading Patterns.”) The same
effect could be achieved by creating a separate shading dictionary for each of the
functions, with adjacent domains. However, since each shading would have
similar parameters, and because the overall effect is one shading, it is more con-
venient to have a single shading with multiple function definitions.
Also, type 3 functions provide a general mechanism for inverting the domains of
1-input functions. For example, consider a function
f
with a
Domain
of
[ 0.0 1.0 ]
and a stitching function
g
with a
Domain
of
[ 0.0 1.0 ]
, a
Functions
array
containing
f,
and an
Encode
array of
[ 1.0 0.0 ]
. In effect,
g
(x)
=
f
(1
x).
3.9.4 Type 4 (PostScript Calculator) Functions
A type 4 function
(PDF 1.3),
also called a PostScript calculator function, is
represented as a stream containing code written in a small subset of the PostScript
language. Although any function can be sampled (in a type 0 PDF function) and
others can be described with exponential functions (type 2 in PDF), type 4
functions offer greater flexibility and potentially greater accuracy. For example, a
tint transformation function for a hexachrome (six-component)
DeviceN
color
space with an alternate color space of
DeviceCMYK
(see “DeviceN Color Spaces”
on page 268) requires a 6-in, 4-out function. If such a function were sampled with
m
values for each input variable, the number of samples, 4
×
m
6
, could be
prohibitively large. In practice, such functions are often written as short, simple
PostScript functions. (See implementation note 43 in Appendix H.)
Index Bookmark Pages Text
Previous Next
Pages: Index All Pages
This HTML file was created by VeryPDF PDF to HTML Converter product.