Gray and RGB

The gray and RGB transfer modes are identical in nature except that they operate in different color spaces.

This category of transfer modes is comprised of a large number of classes. Rather than list all of the classes here, where only one class exists for a particular kind of operation that class is listed in the bullet list. Where there are a number of classes that preform the same operation, the bullet list explains how you can tell what the transfer mode operation does by the name of the class.

    The Blend transfer modes are useful for image classes that do not have an alpha channel, which would be the image classes that do not have an "A" in their name; for example, TGrayImage. When an image class does not have an alpha channel, even though opacity information is specified in the color definition, that opacity information is not used. See Chapter 6 for more information on the available image classes.

Compositing transfer modes

The Gray and RGB transfer modes are ideal for creating scenes composed of a set of irregularly shaped, transparent graphics. The transfer modes are based on transparent set theory where each position in the result can be fully covered by the source or destination, partially covered by the source or destination, or a mixture of the source and destination.

As discussed in Chapter 6, 2-D graphics are drawn into a 2-D image, and in the process, the 2-D graphics are converted to pixels. A 2-D image consists of the image and the graphics drawn into it. The 2-D graphics store their alpha channel information in the fill and frame paint specifications of their attribute bundles. All 2-D images whose names contain the letter "A" store their alpha channel information in the image.

The alpha channel defines the translucency of color. Depending on the alpha channel value specified, the graphic may be opaque (color present) or transparent (color absent). The opacity value determines how the fill and frame colors of the graphic blend with the fill and frame colors of the underlying image when the graphic is drawn to the image. Opacity also determines how colors blend when graphics are drawn over other graphics in an image.

To show how the various compositing transfer mode classes behave, these examples use the source and destination images shown in Figure 117. Each image is opaque in its top half and transparent in its bottom half.


Source over (SrcOver)

The source color is placed over the destination. The transparency of the source allows the destination to show through as shown in Figure 118.


Source around (SrcAround)

The source color is placed around the destination. The transparency of the destination allows the source to show through as shown in Figure 119.


Source inside (SrcIn)

The source that intersects the destination is placed in the new destination. The remaining destination is set to be fully transparent as shown in Figure 120.


Destination inside (DstIn)

The destination that intersects the source is placed in the new destination. The remaining destination is set to be fully transparent as shown in Figure 121.


Source outside (SrcOut)

The source that lies outside the destination is placed in the new destination. The remaining destination is set to be fully transparent as shown in Figure 122.


Destination outside (DstOut)

The destination that lies outside the source is placed in the new destination. The remaining destination is set to be fully transparent as shown in Figure 123.


Source atop (SrcAtop

The source is placed over the destination. The new destination retains the original destination transparency. The source that lies outside the destination is not copied as shown in Figure 124.


Destination atop (DstAtop)

The destination is placed over the source. The new destination retains the original transparency of the source. The destination that lies outside the source is not copied as shown in Figure 125.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker