railo.runtime.img.filter
Class SplineColormap

java.lang.Object
  extended by railo.runtime.img.filter.ArrayColormap
      extended by railo.runtime.img.filter.SplineColormap
All Implemented Interfaces:
Cloneable, Colormap

public class SplineColormap
extends ArrayColormap

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.


Constructor Summary
SplineColormap()
          Construct a SplineColormap.
SplineColormap(int[] xKnots, int[] yKnots)
          Construct a SplineColormap.
 
Method Summary
 void addKnot(int x, int color)
          Add a new knot.
 int getKnot(int n)
          Get a knot color.
 void removeKnot(int n)
          Remove a knot.
 void setKnot(int n, int color)
          Set a knot color.
 void setKnotPosition(int n, int x)
          Set a knot position.
 
Methods inherited from class railo.runtime.img.filter.ArrayColormap
clone, getColor, getMap, setColor, setColorInterpolated, setColorRange, setColorRange, setMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplineColormap

public SplineColormap()
Construct a SplineColormap.


SplineColormap

public SplineColormap(int[] xKnots,
                      int[] yKnots)
Construct a SplineColormap.

Parameters:
xKnots - the knot positions
yKnots - the knot colors
Method Detail

setKnot

public void setKnot(int n,
                    int color)
Set a knot color.

Parameters:
n - the knot index
color - the color
See Also:
getKnot(int)

getKnot

public int getKnot(int n)
Get a knot color.

Parameters:
n - the knot index
Returns:
the knot color
See Also:
setKnot(int, int)

addKnot

public void addKnot(int x,
                    int color)
Add a new knot.

Parameters:
x - the knot position
color - the color
See Also:
removeKnot(int)

removeKnot

public void removeKnot(int n)
Remove a knot.

Parameters:
n - the knot index
See Also:
addKnot(int, int)

setKnotPosition

public void setKnotPosition(int n,
                            int x)
Set a knot position.

Parameters:
n - the knot index
x - the knot position


Copyright © 2012 Railo