| java.lang.Object org.geotools.coverage.processing.ColorMap
Constructor Summary | |
public | ColorMap() Creates an initially empty color map. | public | ColorMap(Color[] colors) Creates a color map initialized to the specified color ramp to be applied on
. | public | ColorMap(Map colorMap) Creates a color map initialized to the specified map. |
Method Summary | |
public boolean | equals(Object object) Compares this color map with the specified object for equality. | public Color[] | getColors(CharSequence category) Returns the color ramp for the given category.
Parameters: category - The , orColorMap.ANY_QUANTITATIVE_CATEGORY for fetching the colors toapply to any quantitative category. | public MeasurementRange | getGeophysicsRange(CharSequence category) Returns the range of geophysics values for the given category.
Parameters: category - The , orColorMap.ANY_QUANTITATIVE_CATEGORY for fetching the range toapply to any quantitative category. | public NumberRange | getRelativeRange(CharSequence category) Returns the relative range of values for the given category.
Parameters: category - The , orColorMap.ANY_QUANTITATIVE_CATEGORY for fetching the relativerange to apply to any quantitative category. | public boolean | getResetUnspecifiedColors() If
true , the ARGB values corresponding to any
not specified in this color map will be reset to the color specified
by the category. | public int | hashCode() Returns a hash code value for this color map. | public GridSampleDimension | recolor(GridSampleDimension sampleDimension, int[] ARGB) Applies to the specified sample dimension the colors given to this color map. | public void | setColor(CharSequence category, Color color) Applies a uniform color to the given (usually qualitative) category. | public void | setColors(CharSequence category, Color[] colors) Applies a color ramp to the given (usually quantitative) category. | public void | setGeophysicsRange(CharSequence category, MeasurementRange range) Sets a range of geophysics values for the color ramp associated with a quantitative category.
For example if the category "Height" applies to geophysics values in the range
[0..500] metres and if a range of [100..400] metres is defined as below:
setRelativeRange("Height", new MeasurementRange(0, 100, SI.METRE));
setColors("Height", myColorPalette);
Then
myColorPalette will applies to pixel values in the range [100..400] instead
of [0..500].
| public void | setRelativeRange(CharSequence category, NumberRange range) Sets a relative range of values for the color ramp associated to a quantitative category.
For example if the category "Height" applies to pixel values in the range
[0..200] and if a relative range of [20%..80%] is defined as below:
setRelativeRange("Height", new NumberRange(20, 80));
setColors("Height", myColorPalette);
Then
myColorPalette will applies to pixel values in the range [40..160] instead
of [0..200].
| public void | setResetUnspecifiedColors(boolean reset) If
true , the ARGB values corresponding to any
not specified in this color map will be reset to the color specified
by the category. | public String | toString() Returns a string representation of this color map. |
ANY_QUANTITATIVE_CATEGORY | final public static CharSequence ANY_QUANTITATIVE_CATEGORY(Code) | | A special category name meaning "any quantitative value".
|
ColorMap | public ColorMap()(Code) | | Creates an initially empty color map.
|
ColorMap | public ColorMap(Color[] colors)(Code) | | Creates a color map initialized to the specified color ramp to be applied on
.
|
ColorMap | public ColorMap(Map colorMap)(Code) | | Creates a color map initialized to the specified map.
Parameters: map - A map of (,) pairs. |
equals | public boolean equals(Object object)(Code) | | Compares this color map with the specified object for equality.
|
getResetUnspecifiedColors | public boolean getResetUnspecifiedColors()(Code) | | If
true , the ARGB values corresponding to any
not specified in this color map will be reset to the color specified
by the category. The default value is
false .
|
hashCode | public int hashCode()(Code) | | Returns a hash code value for this color map.
|
recolor | public GridSampleDimension recolor(GridSampleDimension sampleDimension, int[] ARGB)(Code) | | Applies to the specified sample dimension the colors given to this color map. This method
iterates throug every
in the given sample dimension. For
each category with a
matching one of the (name,
colors) or (name, range) entries given to this color map,
the
Category.recolor recolor method is invoked on that category and the result
inserted into a new sample dimension to be returned.
If the optional
ARGB array is non-null, then the ARGB colors for recolorized
categories will be written in this array. Only the elements with index in the
will be overwritten; other elements
will not be modified.
NOTE: The
and
ranges are taken in account for the
ARGB array only; they do not have impact on the categories to be
included in the returned sample dimension.
Parameters: sampleDimension - The sample dimension to recolorize. Parameters: ARGB - An optional array where to store the ARGB values of recolorized categories,or null if none. A new sample dimension, or sampleDimension if no color change were applied. See Also: Category.recolor |
setColor | public void setColor(CharSequence category, Color color)(Code) | | Applies a uniform color to the given (usually qualitative) category.
Parameters: category - The for which to set the color. Parameters: color - A uniform color to apply to the specified category, or null for removing the color mapping. See Also: ColorMap.recolor |
setColors | public void setColors(CharSequence category, Color[] colors)(Code) | | Applies a color ramp to the given (usually quantitative) category.
The color array may have any length; colors will be interpolated as needed.
Parameters: category - The for which to setthe colors, or ColorMap.ANY_QUANTITATIVE_CATEGORY if the colors should apply toany quantitative category. Parameters: colors - The colors to apply to the specified category, or null or an empty array for removing the color mapping. See Also: ColorMap.recolor |
setGeophysicsRange | public void setGeophysicsRange(CharSequence category, MeasurementRange range)(Code) | | Sets a range of geophysics values for the color ramp associated with a quantitative category.
For example if the category "Height" applies to geophysics values in the range
[0..500] metres and if a range of [100..400] metres is defined as below:
setRelativeRange("Height", new MeasurementRange(0, 100, SI.METRE));
setColors("Height", myColorPalette);
Then
myColorPalette will applies to pixel values in the range [100..400] instead
of [0..500]. This is typically used in order to augment the contrast in a range of values
of special interest.
This method is exclusive with
ColorMap.setRelativeRange .
Parameters: category - The for which to set the geophysics range. Parameters: range - The minimal and maximal values for the color ramp. A null value removes the range mapping. See Also: ColorMap.recolor
|
setRelativeRange | public void setRelativeRange(CharSequence category, NumberRange range)(Code) | | Sets a relative range of values for the color ramp associated to a quantitative category.
For example if the category "Height" applies to pixel values in the range
[0..200] and if a relative range of [20%..80%] is defined as below:
setRelativeRange("Height", new NumberRange(20, 80));
setColors("Height", myColorPalette);
Then
myColorPalette will applies to pixel values in the range [40..160] instead
of [0..200]. This is typically used in order to augment the contrast in a range of values
of special interest.
This method is exclusive with
ColorMap.setGeophysicsRange .
Parameters: category - The for which to set the relative range. Parameters: range - The minimal and maximal relative values for the color ramp, as percentagesbetween 0 and 100. A null value removes the range mapping. See Also: ColorMap.recolor
|
setResetUnspecifiedColors | public void setResetUnspecifiedColors(boolean reset)(Code) | | If
true , the ARGB values corresponding to any
not specified in this color map will be reset to the color specified
by the category. The default value is
false .
|
toString | public String toString()(Code) | | Returns a string representation of this color map.
|
|
|