org.geotools.coverage.processing.operation
Class Recolor
Object
AbstractOperation
Operation2D
Recolor
- All Implemented Interfaces:
- Serializable, Operation
public final class Recolor
- extends Operation2D
Operation replacing the colors of a org.geotools.coverage.grid.GridCoverage
.
This operation accepts one argument, ColorMaps
, which must be an instance of
ColorMap
.
- Since:
- 2.3
- Author:
- Martin Desruisseaux
- See Also:
- Serialized Form
- Module:
modules/library/coverage (gt-coverage.jar)
Constructor Summary |
Recolor()
Constructs a new "Recolor" operation. |
Methods inherited from class AbstractOperation |
ensureNonNull, equals, getDescription, getDocURL, getName, getNumSources, getParameters, getProcessor, getVendor, getVersion, hashCode, toString |
COLOR_MAPS
public static final ParameterDescriptor COLOR_MAPS
- The parameter descriptor for the color map.
Recolor
public Recolor()
- Constructs a new "Recolor" operation.
transformColormap
protected GridSampleDimension transformColormap(int[] ARGB,
int band,
GridSampleDimension sampleDimension,
ParameterValueGroup parameters)
- Transforms the supplied RGB colors.
- Parameters:
ARGB
- Alpha, Red, Green and Blue components to transform.band
- The band number, from 0 to the number of bands in the image -1.sampleDimension
- The sample dimension of band band
.parameters
- The user-supplied parameters.
- Returns:
- A sample dimension identical to
sampleDimension
except for the
colors. Subclasses may conservatively returns sampleDimension
. - See Also:
ColorMap.recolor(org.geotools.coverage.GridSampleDimension, int[])
doOperation
public Coverage doOperation(ParameterValueGroup parameters,
Hints hints)
- Performs the color transformation. This method invokes the
transformColormap(...)
method with current RGB
colormap, the source SampleDimension
and the supplied parameters.
- Specified by:
doOperation
in class AbstractOperation
- Parameters:
parameters
- The parameters.hints
- Rendering hints (ignored in this implementation).
- Returns:
- The result as a coverage.
- Throws:
IllegalArgumentException
- if the candidate image do not use an
IndexColorModel
.
Copyright © 1996-2009 Geotools. All Rights Reserved.