public class ColorMap
extends java.lang.Object
Constructor and Description |
---|
ColorMap(int[] map,
double min,
double max)
Creates a new ColorMap instance using the given internal color map
array and minimum and maximum index values.
|
Modifier and Type | Method and Description |
---|---|
int |
getColor(double val)
Returns the color associated with the given value.
|
int[] |
getColorPalette()
Gets the internal color palette, an int array of color values.
|
double |
getMaxValue()
Gets the maximum value that corresponds to the last
color in the color map.
|
double |
getMinValue()
Gets the minimum value that corresponds to the first
color in the color map.
|
void |
setColorPalette(int[] palette)
Sets the internal color palette, an int array of color values.
|
void |
setMaxValue(double maxValue)
Sets the maximum value that corresponds to the last
color in the color map.
|
void |
setMinValue(double minValue)
Sets the minimum value that corresponds to the first
color in the color map.
|
public ColorMap(int[] map, double min, double max)
map
- the color palette, an int array of color valuesmin
- the minimum value in the color mapmax
- the maximum value in the color mappublic int getColor(double val)
val
- the value for which to retrieve the colorpublic int[] getColorPalette()
public void setColorPalette(int[] palette)
palette
- the new palette.public double getMaxValue()
public void setMaxValue(double maxValue)
maxValue
- the new max index value.public double getMinValue()
public void setMinValue(double minValue)
minValue
- the new min index value.Copyright ? 2013 Regents of the University of California