public class GeorColormap
extends java.lang.Object
The definition of GeoRaster colormap is a superset of definition of Java IndexColorModel. In a GeoRaster colormap, the data type of the value component is double and all values are not necessarily continuous as with Java IndexColorModel; all cell values falling into the range [value1, value2) will be mapped to Red/Green/Blue/Alpha indexed by value value1.
Two constructors are provided: one is the default constructor without parameters, and the other constructor allows you to specify the length of GeorColormapEntry array, in which case the constructor will create a GeorColormapEntry array based on the length.
In this class, methods are provided for retrieving and setting the GeorColormapEntry array and each individual entry.
The following two methods defined in the class SublayerInfo are used to retrieve and set colormap in the GeoRaster metadata through an instance of GeorColormap:
public GeorColormap getColormap(); public void setColormap(GeorColormap colormap);
Constructor and Description |
---|
GeorColormap()
Constructs a
GeorColormap object. |
GeorColormap(int length)
Constructs a
GeorColormap object with the given array length. |
Modifier and Type | Method and Description |
---|---|
GeorColormapEntry[] |
getColormapEntries()
Returns the GeorColormapEntry array.
|
GeorColormapEntry |
getColormapEntry(double value)
Returns a GeorColormap entry indexed by a given value.
|
GeorColormapEntry |
getColormapEntry(int entryNo)
Returns a GeorColormap entry indexed by a given entry number.
|
boolean |
setColormapEntries(double[] value, int[] red, int[] green, int[] blue, java.lang.Double[] alpha)
Sets the GeorColormapEntry array by specifying five individual component arrays.
|
boolean |
setColormapEntries(GeorColormapEntry[] colormapEntries)
Sets the GeorColormapEntry array.
|
boolean |
setColormapEntry(double value, int red, int green, int blue, java.lang.Double alpha)
Sets a GeorColormapEntry based on value.
|
boolean |
setColormapEntry(int entryNo, double value, int red, int green, int blue, java.lang.Double alpha)
Sets a GeorColormapEntry based on entryNo.
|
public GeorColormap()
GeorColormap
object.public GeorColormap(int length)
GeorColormap
object with the given array length.length
- length of GeorColormapEntry arraypublic GeorColormapEntry[] getColormapEntries()
public boolean setColormapEntries(double[] value, int[] red, int[] green, int[] blue, java.lang.Double[] alpha)
value
- cell value arrayred
- red component arraygreen
- green component arrayblue
- blue component arrayalpha
- alpha component arraypublic boolean setColormapEntries(GeorColormapEntry[] colormapEntries)
colormapEntries
- GeorColormapEntry arraypublic boolean setColormapEntry(int entryNo, double value, int red, int green, int blue, java.lang.Double alpha)
entryNo
- index of GeorColormapEntry array, from 0 to (array length-1)value
- cell valuered
- red color componentgreen
- green color componentblue
- blue color componentalpha
- alpha color componentpublic boolean setColormapEntry(double value, int red, int green, int blue, java.lang.Double alpha)
value
- cell valuered
- red color componentgreen
- green color componentblue
- blue color componentalpha
- alpha color componentpublic GeorColormapEntry getColormapEntry(int entryNo)
entryNo
- entry numberpublic GeorColormapEntry getColormapEntry(double value)
value
- cell value