Previous Next


                                          312
CHAPTER 4                                                                       Graphics



which varies linearly between 0.0 and 1.0 as t varies across the domain from t0 to
t1 , as specified by the dictionary’s Domain entry. The center and radius of each
blend circle are given by the following parametric equations:
x c(s) = x 0 + s × ( x 1 – x 0 )
y c(s) = y 0 + s × ( y 1 – y 0 )
 r(s) = r 0 + s × ( r 1 – r 0 )

Each value of s between 0.0 and 1.0 determines a corresponding value of t, which
is passed as the input argument to the function(s) defined by the shading dictio-
nary’s Function entry. This yields the component values of the color with which
to fill the corresponding blend circle. For values of s not lying between 0.0 and
1.0, the boolean elements of the shading dictionary’s Extend array determine
whether and how the shading is extended. If the first of the two elements is true,
the shading is extended beyond the defined starting circle to values of s less than
0.0; if the second element is true, the shading is extended beyond the defined
ending circle to s values greater than 1.0.

Note that either of the starting and ending circles may be larger than the other. If
the shading is extended at the smaller end, the family of blend circles continues as
far as that value of s for which the radius of the blend circle r (s) = 0. If the shading
is extended at the larger end, the blend circles continue as far as that s value for
which r (s) is large enough to encompass the shading’s entire bounding box
(BBox). Extending the shading can thus cause painting to extend beyond the
areas defined by the two circles themselves. The two examples in the rightmost
column of Plate 11 depict the results of extending the shading at the smaller and
larger ends, respectively.

Conceptually, all of the blend circles are painted in order of increasing values of s,
from smallest to largest. Blend circles extending beyond the starting circle are
painted in the same color defined by the shading dictionary’s Function entry for
the starting circle (t = t0 , s = 0.0). Blend circles extending beyond the ending cir-
cle are painted in the color defined for the ending circle (t = t1 , s = 1.0). The
painting is opaque, with the color of each circle completely overlaying those pre-
ceding it. Therefore, if a point lies within more than one blend circle, its final col-
or is that of the last of the enclosing circles to be painted, corresponding to the
greatest value of s.

Previous Next