org.geotools.coverage.processing.operation
Class Recolor
java.lang.Object
org.geotools.coverage.processing.AbstractOperation
org.geotools.coverage.processing.Operation2D
org.geotools.coverage.processing.operation.Recolor
- All Implemented Interfaces:
- java.io.Serializable, org.opengis.coverage.processing.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
- Version:
- $Id: Recolor.java 30643 2008-06-12 18:27:03Z acuster $
- Author:
- Martin Desruisseaux
- See Also:
- Serialized Form
Field Summary |
static org.opengis.parameter.ParameterDescriptor |
COLOR_MAPS
The parameter descriptor for the color map. |
Constructor Summary |
Recolor()
Constructs a new "Recolor" operation. |
Method Summary |
org.opengis.coverage.Coverage |
doOperation(org.opengis.parameter.ParameterValueGroup parameters,
Hints hints)
Performs the color transformation. |
protected GridSampleDimension |
transformColormap(int[] ARGB,
int band,
GridSampleDimension sampleDimension,
org.opengis.parameter.ParameterValueGroup parameters)
Transforms the supplied RGB colors. |
Methods inherited from class org.geotools.coverage.processing.AbstractOperation |
ensureNonNull, equals, getDescription, getDocURL, getName, getNumSources, getParameters, getProcessor, getVendor, getVersion, hashCode, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
COLOR_MAPS
public static final org.opengis.parameter.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,
org.opengis.parameter.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 org.opengis.coverage.Coverage doOperation(org.opengis.parameter.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:
java.lang.IllegalArgumentException
- if the candidate image do not use an
IndexColorModel
.
Copyright © 1996-2010 Geotools. All Rights Reserved.