next up previous
Next: Composited Effects Up: Animation and Compositing Previous: The SWController

The Compositor

The Compositor class is a subclass of SWCompositor, with its primary role being the relaxation of membership requirements of its members. The member object of a Compositor is only required to implement the ImageSpec interface, in which case, the Compositor creates the TwoDSprite that presents that image data in its display space. If a TwoDSprite itself is added to the Compositor, it is added directly as a member, since TwoDSprite also implements the ImageSpec interface.

If the new member implements the Transformable interface, then its current matrix will be set on its TwoDSprite presenter. If the new member implements the Compositable interface, then its current GraphicsMode is applied to its TwoDSprite presenter. These actions simplify the adding of members to the Compositor. However, once added, your application will need to deal directly with the member's TwoDSprite presenter to alter the Matrix or GraphicsMode of the sprite.

Note that most of the functionality of the Compositor is within the SWCompositor abstract class. It is only in the membership requirements that the Compositor specializes the SWCompositor -- specifically in the creation, removal, and retrieval of a member's TwoDSprite presenter.



Dave Marshall
10/4/2001