Basic Compositing Computations in Java

Creator ANSI/AIM Code 39 in Java Basic Compositing Computations
72 Basic Compositing Computations
Make Code 39 Extended In Java
Using Barcode generator for Java Control to generate, create Code-39 image in Java applications.
This section describes the basic computations for compositing a single object with its backdrop These computations will be extended in Section 73, Transparency Groups, to cover groups consisting of multiple objects
Bar Code Drawer In Java
Using Barcode generation for Java Control to generate, create bar code image in Java applications.
S E CTIO N 7 2
Bar Code Scanner In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
Basic Compositing Computations
Code39 Drawer In Visual C#.NET
Using Barcode generation for .NET framework Control to generate, create Code 39 Extended image in VS .NET applications.
721 Basic Notation for Compositing Computations
Print USS Code 39 In VS .NET
Using Barcode generation for ASP.NET Control to generate, create Code 39 image in ASP.NET applications.
In general, variable names in this chapter consisting of a lowercase letter denote a scalar quantity, such as an opacity; uppercase letters denote a value with multiple scalar components, such as a color In the descriptions of the basic color compositing computations, color values are generally denoted by the letter C, with a 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 respectively 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 unde ned values; for instance, when opacity is zero, the corresponding color is unde ned A quantity can also be unde ned if it results from division by zero In any formula that uses such an unde ned quantity, the quantity has no effect on the ultimate result, because it is subsequently multiplied by zero or otherwise canceled out The signi cant point is that while any arbitrary value can be chosen for such an unde ned quantity, the computation must not malfunction because of exceptions caused by over ow or division by zero It is convenient to adopt the further convention that 0 0 = 0
Encoding USS Code 39 In VS .NET
Using Barcode creator for .NET Control to generate, create ANSI/AIM Code 39 image in .NET applications.
722 Basic Compositing Formula
Code 3/9 Generation In Visual Basic .NET
Using Barcode encoder for Visual Studio .NET Control to generate, create Code 39 Extended image in .NET applications.
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, but for the purposes of this section we will focus our attention on some xed point on the page and assume a xed 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 speci es how they are combined in the painting operation The resulting basic
Creating UCC.EAN - 128 In Java
Using Barcode printer for Java Control to generate, create GS1 128 image in Java applications.
CHA P TE R 7
Barcode Encoder In Java
Using Barcode generation for Java Control to generate, create bar code image in Java applications.
Transparency
Generate Code 128B In Java
Using Barcode drawer for Java Control to generate, create Code 128B image in Java applications.
color compositing formula (or just basic compositing formula for short) determines the result color produced by the painting operation:
Make Barcode In Java
Using Barcode creator for Java Control to generate, create bar code image in Java applications.
s s C r = 1 ----- C b + ----- [ ( 1 b ) C s + b B ( C b , C s ) ] r r
Draw Data Matrix ECC200 In Java
Using Barcode creator for Java Control to generate, create Data Matrix ECC200 image in Java applications.
where the variables have the meanings shown in Table 71
USD8 Generator In Java
Using Barcode generation for Java Control to generate, create USD - 8 image in Java applications.
TABLE 71 Variables used in the basic compositing formula
EAN-13 Scanner In Visual Studio .NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in .NET framework applications.
VARIABLE MEANING
Draw Data Matrix ECC200 In VS .NET
Using Barcode creation for ASP.NET Control to generate, create DataMatrix image in ASP.NET applications.
Cb Cs Cr
Bar Code Recognizer In .NET Framework
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
Backdrop color Source color Result color Backdrop alpha Source alpha Result alpha Blend function
Code 128A Printer In .NET Framework
Using Barcode generation for ASP.NET Control to generate, create Code 128A image in ASP.NET applications.
b s r
Barcode Creator In Visual Studio .NET
Using Barcode maker for ASP.NET Control to generate, create bar code image in ASP.NET applications.
B ( Cb , Cs )
Data Matrix 2d Barcode Decoder In VS .NET
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in .NET framework applications.
This is actually a simpli ed form of the compositing formula in which the shape and opacity values are combined and represented as a single alpha value; the more general form is presented later This function is based on the over operation de ned in the article Compositing Digital Images, by Porter and Duff (see the Bibliography), extended to include a blend mode in the region of overlapping coverage The following sections elaborate on the meaning and implications of this formula
Bar Code Generation In VB.NET
Using Barcode drawer for VS .NET Control to generate, create bar code image in Visual Studio .NET applications.
723 Blending Color Space
Note that the compositing formula shown above is actually a vector function: the colors it operates on are represented in the form of n-element vectors, where n is the number of components required by the color space in which compositing is performed The ith component of the result color Cr is obtained by applying the compositing formula to the ith components of the constituent colors Cb , Cs , and B(Cb , Cs ) The result of the computation thus depends on the color space in
S E CTIO N 7 2
Basic Compositing Computations
which the colors are represented For this reason, the color space used for compositing, called the blending color space, is explicitly made part of the transparent imaging model When necessary, backdrop and source colors are converted to the blending color space prior to the compositing computation Of the PDF color spaces described in Section 45, Color Spaces, the following are supported as blending color spaces:
DeviceGray DeviceRGB DeviceCMYK CalGray CalRGB ICCBased color spaces equivalent to those above (including calibrated CMYK)
The Lab space and ICCBased spaces that represent lightness and chromaticity separately (such as L*a*b*, L*u*v*, and HSV) are not allowed as blending color spaces, because the compositing computations in such spaces do not give meaningful results when applied separately to each component In addition, an ICCBased space used as a blending color space must be bidirectional; that is, the ICC pro le must contain both AToB and BToA transformations The blending color space is consulted only for process colors Although blending can also be done on individual spot colors speci ed in a Separation or DeviceN color space, such colors are never converted to a blending color space (except in the case where they rst revert to their alternate color space, as described under Separation Color Spaces on page 201 and DeviceN Color Spaces on page 205) Instead, the speci ed color components are blended individually with the corresponding components of the backdrop The blend functions for the various blend modes assume that the range for each color component is 00 to 10 and that the color space is additive The former condition is true for all of the allowed blending color spaces, but the latter is not In particular, the DeviceCMYK, Separation, and DeviceN spaces are subtractive When performing blending operations in subtractive color spaces, it is assumed that the color component values are complemented (subtracted from 10) before the blend function is applied and that the results of the function are then complemented back before being used This adjustment makes the effects of the vari-