|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectPlanarImage
OpImage
PointOpImage
Combine
public class Combine
Computes a set of arbitrary linear combinations of the bands of many rendered source images,
using a specified matrix. The matrix size (numRows × numColumns) must
be equal to the following:
numRows: the number of desired destination bands.numColumns: the total number of source bands (i.e. the
sum of the number of source bands in all source images) plus one.
The number of source bands used to determine the matrix dimensions is given by the
following code regardless of the type of ColorModel the sources have:
int sourceBands = 0;
for (int i=0; i<sources.length; i++) {
sourceBands += sources[i].getSampleModel().getNumBands();
}
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 (not all from the same source image)
// 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];
}
}
In the special case where there is only one source, this method is equivalent to JAI's
"BandCombine" operation.
| coverage/geotk-coverage (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
Combine.Dyadic
Optimized Combine operation for dyadic (two sources) image. |
static interface |
Combine.Transform
Transforms the sample values for one pixel during a " Combine" operation. |
| Field Summary | |
|---|---|
static String |
OPERATION_NAME
The name of this operation in the JAI registry. |
protected Combine.Transform |
transform
The transform to apply on sample values before the linear combination, or null if none. |
| Fields inherited from class OpImage |
|---|
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler |
| Fields inherited from class PlanarImage |
|---|
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width |
| Constructor Summary | |
|---|---|
Combine(Vector<? extends RenderedImage> images,
double[][] matrix,
Combine.Transform transform,
RenderingHints hints)
Constructs an image with the specified matrix. |
|
| Method Summary | |
|---|---|
void |
computeRect(PlanarImage[] images,
WritableRaster dest,
Rectangle destRect)
Computes one tile. |
Vector<RenderedImage> |
getSources()
Returns the source images. |
| Methods inherited from class PointOpImage |
|---|
computeTile, dispose, isColormapOperation, mapDestRect, mapSourceRect, permitInPlaceOperation |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String OPERATION_NAME
protected final Combine.Transform transform
null if none.
| Constructor Detail |
|---|
public Combine(Vector<? extends RenderedImage> images,
double[][] matrix,
Combine.Transform transform,
RenderingHints hints)
throws MismatchedSizeException
images - The rendered sources.matrix - The linear combination coefficients as a matrix.transform - The transform to apply on sample values before the linear combination,
or null if none.hints - The rendering hints.
MismatchedSizeException - if some rows in the matrix argument doesn't
have the expected length.| Method Detail |
|---|
public Vector<RenderedImage> getSources()
getSources in interface RenderedImagegetSources in class PlanarImage
public void computeRect(PlanarImage[] images,
WritableRaster dest,
Rectangle destRect)
computeRect in class OpImageimages - The source images.dest - The raster to be filled in.destRect - The region within the raster to be filled.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||