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.


Variable Index

 o map
The array of colors.

Constructor Index

 o ArrayColormap()
Construct an all-black colormap
 o ArrayColormap(int[])
Construct a colormap with the given map

Method Index

 o clone()
 o getColor(double)
Convert a value in the range 0..1 to an RGB color.
 o getMap()
 o setColorInterpolated(int, int, int, int)
Set the color at "index" to "color".
 o setColorRange(int, int, int)
 o setMap(int[])

Variables

 o map
 protected int map[]
The array of colors.

Constructors

 o ArrayColormap
 public ArrayColormap()
Construct an all-black colormap

 o ArrayColormap
 public ArrayColormap(int map[])
Construct a colormap with the given map

Parameters:
map - the array of ARGB colors

Methods

 o clone
 public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
 o setMap
 public void setMap(int map[])
 o getMap
 public int[] getMap()
 o 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
 o 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.

 o setColorRange
 public void setColorRange(int firstIndex,
                           int lastIndex,
                           int color)

All Packages  Class Hierarchy  This Package  Previous  Next  Index