Previous Next
517
SECTION 7.2 Basic Compositing Computations
mnemonic subscript indicating which of several color values is being referred to;
for instance, Cs stands for “source color.” Shape and opacity values are denoted re-
spectively by the letters f (for “form factor”) and q (for “opaqueness”)—again with
a mnemonic subscript, such as qs for “source opacity.” The symbol α (alpha)
stands for a product of shape and opacity values.
In certain computations, one or more variables may have undefined values; for
instance, when opacity is zero, the corresponding color is undefined. A quantity
can also be undefined if it results from division by zero. In any formula that uses
such an undefined quantity, the quantity has no effect on the ultimate result
because it is subsequently multiplied by zero or otherwise canceled out. The sig-
nificant point is that while any arbitrary value can be chosen for such an unde-
fined quantity, the computation must not malfunction because of exceptions
caused by overflow or division by zero. It is convenient to adopt the further con-
vention that 0 ÷ 0 = 0.
7.2.2 Basic Compositing Formula
The primary change in the imaging model to accommodate transparency is in
how colors are painted. In the transparent model, the result of painting (the result
color) is a function of both the color being painted (the source color) and the color
it is painted over (the backdrop color). Both of these colors may vary as a function
of position on the page; however, this section focuses on some fixed point on the
page and assumes a fixed backdrop and source color.
Other parameters in this computation are the alpha, which controls the relative
contributions of the backdrop and source colors, and the blend function, which
specifies how they are combined in the painting operation. The resulting basic
color compositing formula (or just basic compositing formula for short) determines
the result color produced by the painting operation:
⎛ αs ⎞ αs
C r = ⎜1 – ----- ⎟ × C b + ----- × [ ( 1 – α b ) × C s + α b × B ( C b , C s ) ]
⎝ αr ⎠ αr
where the variables have the meanings shown in Table 7.1.
Previous Next