|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object comirva.visu.colormap.ColorMap
public class ColorMap
This class implements a colormap, i.e. a mapping from a normalized range [0,1] to a defined set of colors.
Constructor Summary | |
---|---|
ColorMap(Color lowerMargin,
Color upperMargin)
Creates a ColorMap with defined mapping colors for the lower and upper margin of the value range. |
|
ColorMap(Color lowerMargin,
Color upperMargin,
int granularity)
Creates a ColorMap with defined mapping colors for the lower and upper margin of the value range and the specified granularity. |
Method Summary | |
---|---|
void |
addColor(Color col,
int position)
Defines a new sampling point of the ColorMap. |
Color |
getColor(double value)
Returns the color defined in the ColorMap for the specified value, where the argument value must be normalized, i.e. in the range [0,1]. |
void |
invert()
Inverts each color of the ColorMap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorMap(Color lowerMargin, Color upperMargin)
lowerMargin
- the Color for the value 0upperMargin
- the Color for the value 1public ColorMap(Color lowerMargin, Color upperMargin, int granularity)
lowerMargin
- the Color for the value 0upperMargin
- the Color for the value 1granularity
- the number of different Colors available in the ColorMapMethod Detail |
---|
public void addColor(Color col, int position)
col
- the Color to be addedposition
- the index in the range [0, granularity-1]
where the sampling point is to be insertedpublic Color getColor(double value)
value
must be normalized, i.e. in the range [0,1].
value
- the normalized double value for which the color should be returned
value
passed as argumentpublic void invert()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |