Demo
The Layers demo on the following page utilizes the JAI
Collections class to store and manipulate a number of
images as a group. Operations are typically performed
simultaneously on the entire collection. This demo
is a simple multi-layered paint program. The top
row of buttons are used to select the currently active
layer. The left mouse button can be used to paint a
free hand path using a small white rectangle. When the
mouse is released, the composited result will be shown
in the bottom destination window. The sliders are used
to contol the percentage of contribution for each layer
to the resultant image. This demo is intended to show
the basic use of collections and collection operators.
JAI
JAI collections contain rendered or renderable images.
They can also contain collections that include collections
of images. Some examples of JAI collections include image
stacks and image pyramids, often referred to as mip maps.
The AddCollection operation used in this demo takes a collection of rendered images and proportionaly adds them together to form a single output image. See the code for details on the order of operations (multiply individuals then add the group).
Theory
The collection class is primarily a mechanism used to
group images together where an operation is applied
equally to the entire group.