Class AddConstToCollectionDescriptor

All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class AddConstToCollectionDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "AddConstToCollection" operation.

The AddConstToCollection operation takes a collection of rendered images and an array of double constants, and for each rendered image in the collection adds a constant to every pixel of its corresponding band. If the number of constants supplied is less than the number of bands of a source image then the same constant from entry 0 is applied to all the bands. Otherwise, a constant from a different entry is applied to each band.

The operation will attempt to store the result images in the same collection class as that of the source images. If a new instance of the source collection class can not be created, then the operation will store the result images in a java.util.Vector. There will be the same number of images in the output collection as in the source collection.

Resource List
Name Value
GlobalName AddConstToCollection
LocalName AddConstToCollection
Description Adds constants to a collection of rendered images.
Version 1.0
arg0Desc The constants to be added.

Parameter List
Name Class Type Default Value
constants double[] {0.0}

See Also:
CollectionImage, Collection, OperationDescriptor, Serialized Form

Field Summary
Fields inherited from class
Fields inherited from interface
Constructor Summary
Method Summary
static Collection createCollection(Collection source0, double[] constants, RenderingHints hints)
          Adds constants to a collection of rendered images.
 boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
          Validates input source and parameter.
Methods inherited from class
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, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public AddConstToCollectionDescriptor()

Method Detail


public boolean validateArguments(String modeName,
                                 ParameterBlock args,
                                 StringBuffer msg)
Validates input source and parameter.

Specified by:
validateArguments in interface OperationDescriptor
validateArguments in class OperationDescriptorImpl
modeName - the operation mode name
args - Input arguments, including source(s) and/or parameter(s).
msg - A string that may contain error messages.
See Also:
OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer), OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)


public static Collection createCollection(Collection source0,
                                          double[] constants,
                                          RenderingHints hints)
Adds constants to a collection of rendered images.

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

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