javax.media.jai.operator
Class AddCollectionDescriptor

java.lang.Object
  |
  +--javax.media.jai.OperationDescriptorImpl
        |
        +--javax.media.jai.operator.AddCollectionDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class AddCollectionDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "AddCollection" operation.

The AddCollection operation takes a collection of rendered or renderable source images, and adds every set of pixels, one from each source image of the corresponding position and band. No additional parameters are required.

There is no restriction on the actual class type used to represent the source collection, but all elements of the collection must be instances of RenderedImage or RenderableImage depending on the mode. The number of images in the collection may vary from 2 to n. The source images may have different numbers of bands and data types.

By default, the destination image bounds are the intersection of all of the source image bounds. If any of the two sources are completely disjoint, the destination will have a width and a height of 0. The number of bands of the destination image is equal to the minimum number of bands of all the sources, and the data type is the biggest data type of all the sources. If the result of the operation underflows/overflows the minimum/maximum value supported by the destination data type, then it will be clamped to the minimum/maximum value respectively.

The destination pixel values are defined by the pseudocode:

 dst[x][y][b] = 0;
 for (int i = 0; i < numSources; i++) {
     dst[x][y][b] += srcs[i][x][y][b];
 }
 

Resource List
Name Value
GlobalName AddCollection
LocalName AddCollection
Vendor com.sun.media.jai
Description Adds a collection of rendered images.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/AddCollectionDescriptor.html
Version 1.0

No parameters are needed for this operation.

See Also:
RenderedImage, RenderableImage, Collection, OperationDescriptor, Serialized Form

Fields inherited from class javax.media.jai.OperationDescriptorImpl
resources, sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
AddCollectionDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(Collection source0, RenderingHints hints)
          Adds a collection of images.
static RenderableOp createRenderable(Collection source0, RenderingHints hints)
          Adds a collection of images.
protected  boolean validateSources(String modeName, ParameterBlock args, StringBuffer msg)
          Validates input source collection.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddCollectionDescriptor

public AddCollectionDescriptor()
Constructor.
Method Detail

validateSources

protected boolean validateSources(String modeName,
                                  ParameterBlock args,
                                  StringBuffer msg)
Validates input source collection.
Overrides:
validateSources in class OperationDescriptorImpl
Following copied from class: javax.media.jai.OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - a ParameterBlock that has the sources
msg - A string that may contain error messages.
Throws:
IllegalArgumentException - if any of the input parameters are null.
See Also:
OperationDescriptorImpl.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)

create

public static RenderedOp create(Collection source0,
                                RenderingHints hints)
Adds a collection of images.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - Collection source 0.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

createRenderable

public static RenderableOp createRenderable(Collection source0,
                                            RenderingHints hints)
Adds a collection of images.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.createRenderable(String,ParameterBlock,RenderingHints).

Parameters:
source0 - Collection source 0.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp