All Packages Class Hierarchy This Package Previous Next Index
Class com.jhlabs.image.ArrayColormap
java.lang.Object
|
+----com.jhlabs.image.ArrayColormap
- public class ArrayColormap
- extends java.lang.Object
- implements com.jhlabs.image.Colormap, java.lang.Cloneable, java.io.Serializable
A colormap implemented with an array of colors. This corresponds to the IndexColorModel class.
-
map
- The array of colors.
-
ArrayColormap()
- Construct an all-black colormap
-
ArrayColormap(int[])
- Construct a colormap with the given map
-
clone()
-
-
getColor(double)
- Convert a value in the range 0..1 to an RGB color.
-
getMap()
-
-
setColorInterpolated(int, int, int, int)
- Set the color at "index" to "color".
-
setColorRange(int, int, int)
-
-
setMap(int[])
-
map
protected int map[]
- The array of colors.
ArrayColormap
public ArrayColormap()
- Construct an all-black colormap
ArrayColormap
public ArrayColormap(int map[])
- Construct a colormap with the given map
- Parameters:
- map - the array of ARGB colors
clone
public java.lang.Object clone()
- Overrides:
- clone in class java.lang.Object
setMap
public void setMap(int map[])
getMap
public int[] getMap()
getColor
public int getColor(double v)
- Convert a value in the range 0..1 to an RGB color.
- Parameters:
- v - a value in the range 0..1
- Returns:
- an RGB color
setColorInterpolated
public void setColorInterpolated(int index,
int firstIndex,
int lastIndex,
int color)
- Set the color at "index" to "color". Entries are interpolated linearly from
the existing entries at "firstIndex" and "lastIndex" to the new entry.
firstIndex < index < lastIndex must hold.
setColorRange
public void setColorRange(int firstIndex,
int lastIndex,
int color)
All Packages Class Hierarchy This Package Previous Next Index