org.jscience.media.pictures.filters
Class SplineColormap

java.lang.Object
  extended by org.jscience.media.pictures.filters.ArrayColormap
      extended by org.jscience.media.pictures.filters.SplineColormap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Colormap

public class SplineColormap
extends ArrayColormap
implements java.io.Serializable

A Colormap implemented using Catmull-Rom colour splines. The map has a variable number of knots with a minimum of four. The first and last knots give the tangent at the end of the spline, and colours are interpolated from the second to the second-last knots.

See Also:
Serialized Form

Field Summary
 int numKnots
          DOCUMENT ME!
 int[] xKnots
          DOCUMENT ME!
 int[] yKnots
          DOCUMENT ME!
 
Fields inherited from class org.jscience.media.pictures.filters.ArrayColormap
map
 
Constructor Summary
SplineColormap()
          Creates a new SplineColormap object.
SplineColormap(int[] xKnots, int[] yKnots)
          Creates a new SplineColormap object.
 
Method Summary
 void addKnot(int x, int color)
          DOCUMENT ME!
 int getKnot(int n)
          DOCUMENT ME!
 void removeKnot(int n)
          DOCUMENT ME!
 void setKnot(int n, int color)
          DOCUMENT ME!
 void setKnotPosition(int n, int x)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.media.pictures.filters.ArrayColormap
clone, getColor, getMap, setColor, setColorInterpolated, setColorRange, setColorRange, setMap
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numKnots

public int numKnots
DOCUMENT ME!


xKnots

public int[] xKnots
DOCUMENT ME!


yKnots

public int[] yKnots
DOCUMENT ME!

Constructor Detail

SplineColormap

public SplineColormap()
Creates a new SplineColormap object.


SplineColormap

public SplineColormap(int[] xKnots,
                      int[] yKnots)
Creates a new SplineColormap object.

Parameters:
xKnots - DOCUMENT ME!
yKnots - DOCUMENT ME!
Method Detail

getKnot

public int getKnot(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

setKnot

public void setKnot(int n,
                    int color)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
color - DOCUMENT ME!

addKnot

public void addKnot(int x,
                    int color)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
color - DOCUMENT ME!

removeKnot

public void removeKnot(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!

setKnotPosition

public void setKnotPosition(int n,
                            int x)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
x - DOCUMENT ME!