Previous Next


                                         527
SECTION 7.2                                           Basic Compositing Computations



  shape that is 1.0 in the unmasked portions and 0.0 in the masked portions. The
  shape of a group object is the union of the shapes of the objects it contains.
  Note: Mathematically, elementary objects have “hard” edges, with a shape value
  of either 0.0 or 1.0 at every point. However, when such objects are rasterized to
  device pixels, the shape values along the boundaries may be anti-aliased, taking
  on fractional values representing fractional coverage of those pixels. When such
  anti-aliasing is performed, it is important to treat the fractional coverage as shape
  rather than opacity.
• Mask shape. Shape values for compositing an object can be taken from an addi-
  tional source, or soft mask, independent of the object itself. (See Section 7.4,
  “Soft Masks,” for a discussion of how such a mask might be generated.) The use
  of a soft mask to modify the shape of an object or group, called soft clipping, can
  produce effects such as a gradual transition between an object and its backdrop,
  as in a vignette.
• Constant shape. The source shape can be modified at every point by a scalar
  shape constant. This is merely a convenience, since the same effect could be
  achieved with a shape mask whose value is the same everywhere.
• Object opacity. Elementary objects have an opacity of 1.0 everywhere. The
  opacity of a group object is the result of the opacity computations for all of the
  objects it contains.
• Mask opacity. Opacity values, like shape values, can be provided by a soft mask
  independent of the object being composited.
• Constant opacity. The source opacity can be modified at every point by a scalar
  opacity constant. It is useful to think of this value as the “current opacity,” anal-
  ogous to the current color used when painting elementary objects.

All of these shape and opacity inputs range in value from 0.0 to 1.0, with a default
value of 1.0. The intent is that any of the inputs make the painting operation more
transparent as it goes toward 0.0. If more than one input goes toward 0.0, the ef-
fect is compounded. This is achieved mathematically by simply multiplying the
three inputs of each type, producing intermediate values called the source shape
and the source opacity:
fs = fj × fm × fk
qs = qj × qm × qk

where the variables have the meanings shown in Table 7.4.

Previous Next