maspack.render.color
Class GreyscaleColorMap

java.lang.Object
  extended by maspack.render.color.ColorMapBase
      extended by maspack.render.color.GreyscaleColorMap
All Implemented Interfaces:
java.lang.Cloneable, CompositeProperty, HasProperties, ColorMap, Clonable, Scannable

public class GreyscaleColorMap
extends ColorMapBase

Interpolates greyscale color values

Author:
Antonio

Field Summary
static double defaultMaxBrightness
           
static double defaultMinBrightness
           
 double myMaxBrightness
           
 double myMinBrightness
           
static PropertyList myProps
           
 
Constructor Summary
GreyscaleColorMap()
          Creates a default grayscale color map
GreyscaleColorMap(double min, double max)
          Creates a grayscale map with specified min and max brightness values
 
Method Summary
 GreyscaleColorMap clone()
          Returns a clone of this composite property.
 GreyscaleColorMap copy()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 double getBrightness(double a)
          Interpolates a brightness value with parameter a in [0,1]
 DoubleInterval getBrightnessRange()
          Gets the brightness range
 java.awt.Color getColor(double a)
          Returns an interpolated color
 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 setBrightnessRange(double min, double max)
          Sets the greyscale range [min, max].
 void setBrightnessRange(DoubleInterval range)
          Sets the greyscale range [min, max].
 
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

defaultMinBrightness

public static double defaultMinBrightness

defaultMaxBrightness

public static double defaultMaxBrightness

myMinBrightness

public double myMinBrightness

myMaxBrightness

public double myMaxBrightness

myProps

public static PropertyList myProps
Constructor Detail

GreyscaleColorMap

public GreyscaleColorMap()
Creates a default grayscale color map


GreyscaleColorMap

public GreyscaleColorMap(double min,
                         double max)
Creates a grayscale map with specified min and max brightness values

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

setBrightnessRange

public void setBrightnessRange(double min,
                               double max)
Sets the greyscale range [min, max]. If max < min, then colors will be interpolated from bright to dark


setBrightnessRange

public void setBrightnessRange(DoubleInterval range)
Sets the greyscale range [min, max]. If max < min, then colors will be interpolated from bright to dark


getBrightnessRange

public DoubleInterval getBrightnessRange()
Gets the brightness range


getBrightness

public double getBrightness(double a)
Interpolates a brightness value with parameter a in [0,1]


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

clone

public GreyscaleColorMap clone()
                        throws java.lang.CloneNotSupportedException
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
Throws:
java.lang.CloneNotSupportedException

copy

public GreyscaleColorMap copy()
Specified by:
copy in class ColorMapBase