|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jhlabs.image.ArrayColormap
public class ArrayColormap
A colormap implemented with an array of colors. This corresponds to the IndexColorModel class.
Field Summary | |
---|---|
protected int[] |
map
The array of colors. |
Constructor Summary | |
---|---|
ArrayColormap()
Construct an all-black colormap. |
|
ArrayColormap(int[] map)
Construct a colormap with the given map. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
int |
getColor(float v)
Convert a value in the range 0..1 to an RGB color. |
int[] |
getMap()
Get the array of colors for the colormap. |
void |
setColor(int index,
int color)
Set one element of the colormap to a given color. |
void |
setColorInterpolated(int index,
int firstIndex,
int lastIndex,
int color)
Set the color at "index" to "color". |
void |
setColorRange(int firstIndex,
int lastIndex,
int color)
Set a range of the colormap to a single color. |
void |
setColorRange(int firstIndex,
int lastIndex,
int color1,
int color2)
Set a range of the colormap, interpolating between two colors. |
void |
setMap(int[] map)
Set the array of colors for the colormap. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int[] map
Constructor Detail |
---|
public ArrayColormap()
public ArrayColormap(int[] map)
map
- the array of ARGB colorsMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public void setMap(int[] map)
map
- the colorsgetMap()
public int[] getMap()
setMap(int[])
public int getColor(float v)
getColor
in interface Colormap
v
- a value in the range 0..1
setColor(int, int)
public void setColorInterpolated(int index, int firstIndex, int lastIndex, int color)
index
- the position to setfirstIndex
- the position of the first color from which to interpolatelastIndex
- the position of the second color from which to interpolatecolor
- the color to setpublic void setColorRange(int firstIndex, int lastIndex, int color1, int color2)
firstIndex
- the position of the first colorlastIndex
- the position of the second colorcolor1
- the first colorcolor2
- the second colorpublic void setColorRange(int firstIndex, int lastIndex, int color)
firstIndex
- the position of the first colorlastIndex
- the position of the second colorcolor
- the colorpublic void setColor(int index, int color)
index
- the position of the colorcolor
- the colorgetColor(float)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |