javax.media.jai.operator
Class BandSelectDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.BandSelectDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class BandSelectDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "BandSelect" operation.

The BandSelect operation chooses N bands from a rendered or renderable source image and copies the pixel data of these bands to the destination image in the order specified. The bandIndices parameter specifies the source band indices, and its size (bandIndices.length) determines the number of bands of the destination image. The destination image may have ay number of bands, and a particular band of the source image may be repeated in the destination image by specifying it multiple times in the bandIndices parameter.

Each of the bandIndices value should be a valid band index number of the source image. For example, if the source only has two bands, then 1 is a valid band index, but 3 is not. The first band is numbered 0.

The destination pixel values are defined by the pseudocode:

 dst[x][y][b] = src[x][y][bandIndices[b]];
 

Resource List
Name Value
GlobalName BandSelect
LocalName BandSelect
Vendor com.sun.media.jai
Description Selects n number of bands from an image.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/BandSelectDescriptor.html
Version 1.0
arg0Desc The indices of the selected bands.

Parameter List
Name Class Type Default Value
bandIndices int[] NO_PARAMETER_DEFAULT

See Also:
OperationDescriptor, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
BandSelectDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, int[] bandIndices, RenderingHints hints)
          Selects n number of bands from an image.
static RenderableOp createRenderable(RenderableImage source0, int[] bandIndices, RenderingHints hints)
          Selects n number of bands from an image.
 boolean validateArguments(String modeName, ParameterBlock args, StringBuffer message)
          Validates the input source and parameters.
 
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, 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

BandSelectDescriptor

public BandSelectDescriptor()
Constructor.

Method Detail

validateArguments

public boolean validateArguments(String modeName,
                                 ParameterBlock args,
                                 StringBuffer message)
Validates the input source and parameters.

In addition to the standard checks performed by the superclass method, this method checks that "bandIndices" has a length of at least 1 and does not contain any values less than 0 or greater than the number of source bands minus 1.

Specified by:
validateArguments in interface OperationDescriptor
Overrides:
validateArguments in class OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - Input arguments, including source(s) and/or parameter(s).
message - 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)

create

public static RenderedOp create(RenderedImage source0,
                                int[] bandIndices,
                                RenderingHints hints)
Selects n number of bands from an image.

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

Parameters:
source0 - RenderedImage source 0.
bandIndices - The indices of the selected bands.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if bandIndices is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

createRenderable

public static RenderableOp createRenderable(RenderableImage source0,
                                            int[] bandIndices,
                                            RenderingHints hints)
Selects n number of bands from an image.

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

Parameters:
source0 - RenderableImage source 0.
bandIndices - The indices of the selected bands.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
IllegalArgumentException - if bandIndices is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp