|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.media.jai.OperationDescriptorImpl javax.media.jai.operator.BandCombineDescriptor
An 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.
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 | com.sun.media.jai |
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 | The matrix specifying the band combination. |
Name | Class Type | Default Value |
---|---|---|
matrix | double[][] | NO_PARAMETER_DEFAULT |
OperationDescriptor
,
Serialized FormField Summary |
Fields inherited from class javax.media.jai.OperationDescriptorImpl |
sourceNames |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
BandCombineDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
double[][] matrix,
RenderingHints hints)
Performs arbitrary interband linear combination using a specified matrix. |
static RenderableOp |
createRenderable(RenderableImage source0,
double[][] matrix,
RenderingHints hints)
Performs arbitrary interband linear combination using a specified matrix. |
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer message)
Validates the input source and parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BandCombineDescriptor()
Method Detail |
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 OperationDescriptor
validateArguments
in class OperationDescriptorImpl
modeName
- the operation mode nameargs
- Input arguments, including source(s) and/or parameter(s).message
- A string that may contain error messages.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 RenderedOp create(RenderedImage source0, double[][] matrix, 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.hints
- The RenderingHints
to use.
May be null
.
RenderedOp
destination.
IllegalArgumentException
- if source0
is null
.
IllegalArgumentException
- if matrix
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0, double[][] matrix, 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.hints
- The RenderingHints
to use.
May be null
.
RenderableOp
destination.
IllegalArgumentException
- if source0
is null
.
IllegalArgumentException
- if matrix
is null
.JAI
,
ParameterBlockJAI
,
RenderableOp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |