All Packages Class Hierarchy This Package Previous Next Index
Class com.jhlabs.image.Gradient
java.lang.Object
|
+----com.jhlabs.image.ArrayColormap
|
+----com.jhlabs.image.Gradient
- public class Gradient
- extends com.jhlabs.image.ArrayColormap
- implements java.lang.Cloneable, 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.
Each knot can be given a type of interpolation. These are:
- LINEAR - linear interpolation to next knot
- SPLINE - spline interpolation to next knot
- CONSTANT - no interpolation - the colour is constant to the next knot
- HUE_CW - interpolation of hue clockwise to next knot
- HUE_CCW - interpolation of hue counter-clockwise to next knot
-
CIRCLE_DOWN
-
-
CIRCLE_UP
-
-
CONSTANT
-
-
HUE_CCW
-
-
HUE_CW
-
-
knotTypes
-
-
LINEAR
-
-
numKnots
-
-
RGB
-
-
SPLINE
-
-
xKnots
-
-
yKnots
-
-
Gradient()
-
-
addKnot(int, int, int)
-
-
clone()
-
-
copyTo(Gradient)
-
-
getKnot(int)
-
-
getKnotBlend(int)
-
-
getKnotType(int)
-
-
knotAt(int)
-
-
randomGradient()
-
-
randomize()
-
-
removeKnot(int)
-
-
setColor(int, int)
-
-
setKnot(int, int)
-
-
setKnotBlend(int, int)
-
-
setKnotPosition(int, int)
-
-
setKnotType(int, int)
-
-
splitSpan(int)
-
RGB
public static final int RGB
HUE_CW
public static final int HUE_CW
HUE_CCW
public static final int HUE_CCW
LINEAR
public static final int LINEAR
SPLINE
public static final int SPLINE
CIRCLE_UP
public static final int CIRCLE_UP
CIRCLE_DOWN
public static final int CIRCLE_DOWN
CONSTANT
public static final int CONSTANT
numKnots
public int numKnots
xKnots
public int xKnots[]
yKnots
public int yKnots[]
knotTypes
public byte knotTypes[]
Gradient
public Gradient()
clone
public java.lang.Object clone()
- Overrides:
- clone in class com.jhlabs.image.ArrayColormap
copyTo
public void copyTo(com.jhlabs.image.Gradient g)
setColor
public void setColor(int n,
int color)
getKnot
public int getKnot(int n)
setKnot
public void setKnot(int n,
int color)
setKnotType
public void setKnotType(int n,
int type)
getKnotType
public int getKnotType(int n)
setKnotBlend
public void setKnotBlend(int n,
int type)
getKnotBlend
public byte getKnotBlend(int n)
addKnot
public void addKnot(int x,
int color,
int type)
removeKnot
public void removeKnot(int n)
splitSpan
public void splitSpan(int n)
setKnotPosition
public void setKnotPosition(int n,
int x)
knotAt
public int knotAt(int x)
randomize
public void randomize()
randomGradient
public static com.jhlabs.image.Gradient randomGradient()
All Packages Class Hierarchy This Package Previous Next Index