|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peakml.graphics.Colormap
public class Colormap
Defines different color models for visualization purposes (like heatmaps and graphs). A specific colormap can be created by using one of the enumerated integers defined in the class. An example of the use:
// create the colormap Colormap colormap = new Colormap(Colormap.JET); // print all the colors for (int i=0; i>16)&0xFF) + ", " + ((color>>8)&0xFF) + ", " + (color&0xFF)); }
Field Summary | |
---|---|
static int |
EXCEL
A standard excel color model, where each color tries to be as different from the rest as possible. |
static int |
GRAYSCALE
A greyscale color model. |
static int |
HEAT
A heat color model used to create heatmaps. |
static int |
HSV
A Hue-Saturation-Value colormodel. |
static int |
JET
A JET color model as used in Matlab. |
static int |
RAINBOW
|
static int |
REDBLACKGREEN
A color model ranging from red to black to green. |
static int |
REDGREEN
A color model ranging from red to white to green. |
static int |
WAVE
|
Constructor Summary | |
---|---|
Colormap(int type)
Constructor for creating the specified color model. |
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
createImage(int type,
int width,
int height)
|
int |
getColor(int index)
Returns an integer representation of the color at the given index. |
int |
getNrColors()
Returns the number of colors stored in this color model. |
int |
getType()
Returns the type of color model stored in the instance. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int JET
public static final int HSV
public static final int HEAT
public static final int EXCEL
public static final int GRAYSCALE
public static final int REDGREEN
public static final int REDBLACKGREEN
public static final int RAINBOW
public static final int WAVE
Constructor Detail |
---|
public Colormap(int type) throws java.lang.RuntimeException
type
- The type of color-model to be created.
java.lang.RuntimeException
Method Detail |
---|
public int getType()
public int getNrColors()
public int getColor(int index) throws java.lang.IndexOutOfBoundsException
getNrColors()
-1.
index
- The index where the color is located.
java.lang.IndexOutOfBoundsException
- Thrown when the index is out of bounds.public static java.awt.image.BufferedImage createImage(int type, int width, int height)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |