8.12 Effects


A wide variety of effects are generated with HMatte that are part of the component hierarchy. The root of the hierarchy is an instance of HScene , leaf nodes are instances of HComponent, and intermediate nodes are instances of HContainer . Components within a container are ordered from back to front. An example is shown in Figure 8.17, where c3, a container, is the backmost component and c1 the frontmost. With the HMatte interface, the scene hierarchy can be modified by the inclusion of mattes (additional alpha sources), potentially for each member (see Figure 8.17 for an example composition).

Figure 8.17. An example of component mattes.

The mattes influence the rendering of the scene, and their operation can be visualized using a 2fiD or a layering model. Where pixels in a component already have an alpha value (e.g., from a PNG image), the alpha value from the component and the alpha value from the matte are multiplied together to obtain the actual alpha value to be used for that pixel.

A great variety of effects (e.g., wipes and fades) can be performed using matte animations. Matte animations are sequences of mattes where the active element is changed over time (recall Figure 8.13). Matte animations can be combined with other techniques, such as component movement, to produce additional effects.

8.12.1 HFlatEffectMatte

The HFlatEffectMatte class represents a matte that is constant over space but varies over time. It is specified as a sequence of floating-point values in the range 0.0 to 1.0 where:

  • 0.0 is fully transparent

  • Values between 0.0 and 1.0 are partially transparent to the nearest supported value

  • 1.0 is fully opaque

The data for any HFlatEffectMatte may be changed on the fly using the setMatteData() method. However, some implementations may be asynchronously referencing their content (i.e., through a separate implementation-specific animation thread). Therefore the following restrictions apply to the setMatteData() method:

  • The method is synchronized with any implementation-specific animation thread such that content cannot be changed while a different thread is using it.

  • If the animation was running the method should stop the animation in a synchronized manner before changing content.

  • The method should reset the animation to a starting position defined by the current play mode. The repeat count of the animation should be reset to 0.

  • If the animation was running, the method should start the animation.

8.12.2 HFlatMatte

The HFlatMatte class represents a matte that is constant over space and time. It is specified as a floating-point value in the range 0.0 to 1.0.

8.12.3 HImageMatte

The HImageMatte class represents a matte that varies over space but is constant over time, it can be specified by an image mask (a single channel image) where the pixels indicate matte transparency.

8.12.4 HImageEffectMatte

The HImageEffectMatte class represents a matte that varies over both space and time, it is specified as a sequence of image masks. The data for any HImageEffectMatte may be changed on the fly using the setMatteData() method. However, some implementations could be asynchronously referencing their content (i.e., through a separate implementation-specific animation thread). Therefore the following restrictions apply to the setMatteData() method:

  • The method is synchronized with any implementation-specific animation thread such that content cannot be changed while a different thread is using it.

  • If the animation was running, the method should stop the animation in a synchronized manner before changing content.

  • The method should reset the animation to a starting position defined by the current play mode. The repeat count of the animation should be reset to 0.

  • If the animation was running, the method should start the animation.

8.12.5 Matte Sizes and Offsets

When an HImageMatte or HImageEffectMatte is assigned to a component, the associated image (or images) is by default aligned with the component so that their origins, the pixel at (0,0), coincide. The offset of the matte with respect to the component can be altered using the setOffset() method of HImageMatte and HImageEffectMatte . Regions of the component outside the matte (resulting from either a matte being smaller than the component or from shifting the matte) are not matted.

8.12.6 Matte of Component Groups

A container is either grouped or ungrouped. When a container is ungrouped , its matte only influences the appearance of those regions of the container not covered by members of the container (i.e., exposed regions of the container's background). When a container is grouped, its matte influences the appearance of its background and all members of the container. For example, grouping a container and setting its matte to indicate 50% transparency should fade its background and all members of the container. If it is ungrouped only the background should fade.



ITV Handbook. Technologies and Standards
ITV Handbook: Technologies and Standards
ISBN: 0131003127
EAN: 2147483647
Year: 2003
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net