jsky.image
Class ImageColormap

java.lang.Object
  extended by jsky.image.ImageColormap
All Implemented Interfaces:
java.lang.Cloneable

public class ImageColormap
extends java.lang.Object
implements java.lang.Cloneable

Manages the colormap for an image and provides methods to select a predefined colormap and perform operations on it, such as rotate, shift, and stretch.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Field Summary
protected  javax.media.jai.LookupTableJAI colorLookupTable
          Used to make a color image froma grayscale image using a selected colormap
protected  java.lang.String colorLookupTableName
          Name of the current color lookup table
protected  byte[][] colorLut
          Copy of current color lookup table data to use for shift, rotate, scale ops
static java.lang.String DEFAULT_COLOR_LUT
          Default color lookup table to use
protected  float[] intensityLookupTable
          Used to modify the order of the colors in the color lookup table
protected  java.lang.String intensityLookupTableName
          Name of the current intensity lookup table
protected static int NUM_COLORS
          The number of colors in the display image
 
Constructor Summary
ImageColormap()
          Default constructor: Initialize with the default colormap.
 
Method Summary
 java.lang.Object clone()
          Return a shallow copy
 boolean equals(ImageColormap colormap)
          Return true if this object is equivalent to the given one.
 javax.media.jai.LookupTableJAI getColorLookupTable()
          Return the current lookup table used to add color to a grayscale image.
 java.lang.String getColorLookupTableName()
          Return the name of the current color lookup table
 java.lang.String getIntensityLookupTableName()
          Return the name of the current intensity lookup table
 void resetColormap()
          Reset the colormap shift, rotate and scale settings to 0.
 void rotateColormap(int amount)
          Rotate the colormap by the given amount.
 void saveColormap()
          Save the current colormap state for the next shift, rotate or scale operation.
 void scaleColormap(int amount)
          Scale the colormap by the given amount.
 void setColorLookupTable(java.lang.String name)
          Create a color RGB lookup table that can be added to the image processing chain, so that we can manipulate the image colors.
 void setDefaultColormap()
          Reset the colormap to the default.
 void setIntensityLookupTable(java.lang.String name)
          Create an intensity lookup table that can be added to the image processing chain to rearrange the order of the colors in the colormap.
 void shiftColormap(int amount)
          Shift the colormap by the given amount.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colorLookupTable

protected javax.media.jai.LookupTableJAI colorLookupTable
Used to make a color image froma grayscale image using a selected colormap


colorLookupTableName

protected java.lang.String colorLookupTableName
Name of the current color lookup table


colorLut

protected byte[][] colorLut
Copy of current color lookup table data to use for shift, rotate, scale ops


intensityLookupTable

protected float[] intensityLookupTable
Used to modify the order of the colors in the color lookup table


intensityLookupTableName

protected java.lang.String intensityLookupTableName
Name of the current intensity lookup table


DEFAULT_COLOR_LUT

public static final java.lang.String DEFAULT_COLOR_LUT
Default color lookup table to use

See Also:
Constant Field Values

NUM_COLORS

protected static final int NUM_COLORS
The number of colors in the display image

See Also:
Constant Field Values
Constructor Detail

ImageColormap

public ImageColormap()
Default constructor: Initialize with the default colormap.

Method Detail

setColorLookupTable

public void setColorLookupTable(java.lang.String name)
Create a color RGB lookup table that can be added to the image processing chain, so that we can manipulate the image colors.

Parameters:
name - the name of the colormap table to use. This is currently One of: "Background", "Blue", "Heat", "Isophot", "Light", "Pastel", "Ramp", "Real", "Smooth", "Staircase", "Standard". User defined maps will be implemented in a later release.

setIntensityLookupTable

public void setIntensityLookupTable(java.lang.String name)
Create an intensity lookup table that can be added to the image processing chain to rearrange the order of the colors in the colormap.

Parameters:
name - the name of the intensity lookup table to use. This is currently One of: "Equal", "Exponential", "Gamma", "Jigsaw", "Lasritt", "Logarithmic", "Negative", "Negative Log", "Ramp", "Staircase". User defined intensity lookup tables will be implemented in a later release.

saveColormap

public void saveColormap()
Save the current colormap state for the next shift, rotate or scale operation.


rotateColormap

public void rotateColormap(int amount)
Rotate the colormap by the given amount.


shiftColormap

public void shiftColormap(int amount)
Shift the colormap by the given amount.


scaleColormap

public void scaleColormap(int amount)
Scale the colormap by the given amount.


setDefaultColormap

public void setDefaultColormap()
Reset the colormap to the default.


resetColormap

public void resetColormap()
Reset the colormap shift, rotate and scale settings to 0.


getColorLookupTable

public javax.media.jai.LookupTableJAI getColorLookupTable()
Return the current lookup table used to add color to a grayscale image.


getColorLookupTableName

public java.lang.String getColorLookupTableName()
Return the name of the current color lookup table


getIntensityLookupTableName

public java.lang.String getIntensityLookupTableName()
Return the name of the current intensity lookup table


equals

public boolean equals(ImageColormap colormap)
Return true if this object is equivalent to the given one.


clone

public java.lang.Object clone()
Return a shallow copy

Overrides:
clone in class java.lang.Object