public class BandCombineDescriptor
extends javax.media.jai.OperationDescriptorImpl
OperationDescriptor
describing the "BandCombine" operation.
The BandCombing operation computes a set of arbitrary linear combinations of the bands of a rendered or renderable source image, using a specified matrix. The matrix must a number of rows equal to the number of desired destination bands and a number of columns equal to the number of source bands plus one. In other words, the array may be constructed using the syntax:
double[][] matrix = new double[destBands][sourceBands + 1];
The number of source bands used to determine the matrix dimensions is given by source.getSampleModel().getNumBands()
regardless of the
type of ColorModel
the source has.
This descriptor also provides support for optional ROIs or nodata in the source image. The support for these features can be achieved by skipping the data which are not valid during computations.
The extra column in the matrix contains constant values each of which is added to the respective band of the destination. The transformation is therefore defined by the pseudocode:
// s = source pixel // d = destination pixel for (int i = 0; i < destBands; i++) { d[i] = matrix[i][sourceBands]; for (int j = 0; j < sourceBands; j++) { d[i] += matrix[i][j] * s[j]; } }
If the result of the computation underflows/overflows the minimum/maximum value supported by the destination image, then it will be clamped to the minimum/maximum value respectively.
Name | Value |
---|---|
GlobalName | BandCombine |
LocalName | BandCombine |
Vendor | it.geosolutions.jaiext |
Description | Performs arbitrary interband linear combination using a specified matrix. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/BandCombineDescriptor.html |
Version | 1.0 |
arg0Desc | Matrix used in computation. | arg1Desc | Optional ROI object to use in computation. | arg2Desc | Optional Range of NoData values to use in computation. | arg3Desc | Destination no data value used when all the pixel band values are NoData. |
Name | Class Type | Default Value |
---|---|---|
matrix | double[][] | NO_PARAMETER_DEFAULT |
roi | javax.media.jai.ROI | null |
nodata | it.geosolutions.jaiext.range.Range | null |
destNoData | double | 0 |
Constructor and Description |
---|
BandCombineDescriptor()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static javax.media.jai.RenderedOp |
create(RenderedImage source0,
double[][] matrix,
javax.media.jai.ROI roi,
Range nodata,
double destinationNoData,
RenderingHints hints)
Performs arbitrary interband linear combination using a specified matrix and checking ROI and NoData if defined.
|
static javax.media.jai.RenderableOp |
createRenderable(RenderableImage source0,
double[][] matrix,
javax.media.jai.ROI roi,
Range nodata,
double destinationNoData,
RenderingHints hints)
Performs arbitrary interband linear combination using a specified matrix and checking ROI and NoData if defined.
|
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer message)
Validates the input source and parameters.
|
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
public boolean validateArguments(String modeName, ParameterBlock args, StringBuffer message)
In addition to the standard checks performed by the superclass method, this method checks that "matrix" has at least 1 row and (source bands + 1) columns.
The number of source bands is considered to be equal to source.getSampleModel().getNumBands()
.
validateArguments
in interface javax.media.jai.OperationDescriptor
validateArguments
in class javax.media.jai.OperationDescriptorImpl
public static javax.media.jai.RenderedOp create(RenderedImage source0, double[][] matrix, javax.media.jai.ROI roi, Range nodata, double destinationNoData, RenderingHints hints)
Creates a ParameterBlockJAI
from all supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.matrix
- The matrix specifying the band combination.roi
- Optional ROI object used in computationnodata
- Optional range object used for checking the presence of nodatadestinationNoData
- value for replacing the source nodata valueshints
- The RenderingHints
to use. May be null
.RenderedOp
destination.JAI
,
ParameterBlockJAI
,
RenderedOp
public static javax.media.jai.RenderableOp createRenderable(RenderableImage source0, double[][] matrix, javax.media.jai.ROI roi, Range nodata, double destinationNoData, RenderingHints hints)
Creates a ParameterBlockJAI
from all supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.matrix
- The matrix specifying the band combination.roi
- Optional ROI object used in computationnodata
- Optional range object used for checking the presence of nodatadestinationNoData
- value for replacing the source nodata valueshints
- The RenderingHints
to use. May be null
.RenderableOp
destination.JAI
,
ParameterBlockJAI
,
RenderableOp
Copyright © 2006–2015 GeoSolutions. All rights reserved.