maspack.render.color
Class InterpolatingColorMap

java.lang.Object
  extended by maspack.render.color.ColorMapBase
      extended by maspack.render.color.InterpolatingColorMap
All Implemented Interfaces:
java.lang.Cloneable, CompositeProperty, HasProperties, ColorMap, Clonable, Scannable
Direct Known Subclasses:
JetColorMap, RainbowColorMap

public abstract class InterpolatingColorMap
extends ColorMapBase


Field Summary
static java.awt.Color[] defaultColorArray
           
static PropertyList myProps
           
 
Constructor Summary
InterpolatingColorMap()
           
 
Method Summary
 InterpolatingColorMap clone()
          Returns a clone of this composite property.
abstract  InterpolatingColorMap copy()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 java.awt.Color getColor(double a)
          Returns an interpolated color
static java.awt.Color[] getColorArray(java.lang.String colorString)
          Parses a string listing colors in hex format to generate an array of Color objects
 java.lang.String getColorString()
           
static java.lang.String getColorString(java.awt.Color[] carray)
          Creates a string listing an array of colors of the form "0x________ 0x________ ..."
 void getHSV(double a, double[] hsv)
          Fills an array with the interpolated color values in HSV format
 void getHSV(double a, float[] hsv)
          Fills an array with the interpolated color values in HSV format
 void getRGB(double a, double[] rgb)
          Fills an array with the interpolated color values in RGB format
 void getRGB(double a, float[] rgb)
          Fills an array with the interpolated color values in RGB format
 void setColorArray(java.awt.Color[] colors)
          Sets the list of colors within which to interpolate.
 void setColorString(java.lang.String str)
           
 
Methods inherited from class maspack.render.color.ColorMapBase
getColor3Value, getColor4Value, getProperty, getPropertyHost, getPropertyInfo, getSubClasses, isWritable, scan, setPropertyHost, setPropertyInfo, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultColorArray

public static final java.awt.Color[] defaultColorArray

myProps

public static PropertyList myProps
Constructor Detail

InterpolatingColorMap

public InterpolatingColorMap()
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class ColorMapBase
Returns:
static information for all exported properties

setColorArray

public void setColorArray(java.awt.Color[] colors)
Sets the list of colors within which to interpolate. These colors are evenly distributed in the interval [0, 1], and interpolation is linear between any pairs


getColorString

public java.lang.String getColorString()

setColorString

public void setColorString(java.lang.String str)

getColor

public java.awt.Color getColor(double a)
Description copied from interface: ColorMap
Returns an interpolated color

Parameters:
a - input, usually in the range [0,1]
Returns:
the color

getRGB

public void getRGB(double a,
                   double[] rgb)
Description copied from interface: ColorMap
Fills an array with the interpolated color values in RGB format

Parameters:
a - input, usually in the range [0,1]
rgb - output color

getRGB

public void getRGB(double a,
                   float[] rgb)
Description copied from interface: ColorMap
Fills an array with the interpolated color values in RGB format

Parameters:
a - input, usually in the range [0,1]
rgb - output color

getHSV

public void getHSV(double a,
                   double[] hsv)
Description copied from interface: ColorMap
Fills an array with the interpolated color values in HSV format

Parameters:
a - input, usually in the range [0,1]
hsv - output color

getHSV

public void getHSV(double a,
                   float[] hsv)
Description copied from interface: ColorMap
Fills an array with the interpolated color values in HSV format

Parameters:
a - input, usually in the range [0,1]
hsv - output color

getColorString

public static java.lang.String getColorString(java.awt.Color[] carray)
Creates a string listing an array of colors of the form "0x________ 0x________ ..."


getColorArray

public static java.awt.Color[] getColorArray(java.lang.String colorString)
Parses a string listing colors in hex format to generate an array of Color objects


copy

public abstract InterpolatingColorMap copy()
Specified by:
copy in class ColorMapBase

clone

public InterpolatingColorMap clone()
Description copied from interface: CompositeProperty
Returns a clone of this composite property.

Specified by:
clone in interface CompositeProperty
Specified by:
clone in interface Clonable
Overrides:
clone in class ColorMapBase
Returns:
clone of this property