|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcae.viewer3d.post.DefaultColorMapper
public class DefaultColorMapper
Map colors on values. This class properly handle set of values including Float.NEGATIVE_INFINITY, but positive infinity will lead to unexpected behavior.
| Constructor Summary | |
|---|---|
DefaultColorMapper()
Create a color mapper with the following caracteristics: min=0 max=1 palletteSize=1 |
|
DefaultColorMapper(float[] values,
int paletteSize)
Create a mapper for a given set of values |
|
DefaultColorMapper(float min,
float max,
boolean infinity,
int paletteSize)
Create a mapper for a set of values whose only min and max are known |
|
| Method Summary | |
|---|---|
float |
getMax()
Get the greatest value |
float |
getMin()
Get the finit smallest value |
byte[] |
getPalette()
Return the palette in the RGB format. |
boolean |
isNegativeInfinity()
Return true is the set of value contains Float.NEGATIVE_INFINITY |
int |
map(float value)
Return the color index in the palette for the given value. |
java.awt.Color |
mapColor(float value)
Return the color for the given value. |
void |
mapColor(float value,
int[] dst,
int index)
Set the color associated to the value into the destination array This is a continues mapping (.e. the returned value may not be in the palette). |
void |
setMax(float max)
Set the greatest value |
void |
setMin(float min)
Set the finit smallest value |
void |
setNegativeInfinity(boolean b)
Specifiy that the working set of value contains Float.NEGATIVE_INFINITY. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultColorMapper()
public DefaultColorMapper(float[] values,
int paletteSize)
values - Extract the min and max value from this arraypaletteSize - The number of color to generate
public DefaultColorMapper(float min,
float max,
boolean infinity,
int paletteSize)
max - greated valuemin - smallest finit valueinfinity - true if the values include Float.NEGATIVE_INFINITY| Method Detail |
|---|
public byte[] getPalette()
getPalette in interface ColorMapperpublic int map(float value)
map in interface ColorMapperpublic java.awt.Color mapColor(float value)
mapColor in interface ColorMapper
public void mapColor(float value,
int[] dst,
int index)
mapColor in interface ColorMapperpublic void setMin(float min)
public void setMax(float max)
public void setNegativeInfinity(boolean b)
public float getMin()
public float getMax()
public boolean isNegativeInfinity()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||