Catalano.Imaging.Tools
Class Curve
- java.lang.Object
-
- Catalano.Imaging.Tools.Curve
-
- All Implemented Interfaces:
- java.io.Serializable
public class Curve extends java.lang.Object implements java.io.SerializableCurve representation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Curve()Initialize a new instance of the Curve class.Curve(Curve curve)Initialize a new instance of the Curve class.Curve(float[] x, float[] y)Initialize a new instance of the Curve class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPoint(float kx, float ky)Add point in the curve.voidaddPoint(FloatPoint point)Add point in the curve.voidaddPoint(java.util.List<FloatPoint> points)Add collection of points.voidclear()Clear all the points.float[]getX()Get value of the x axis coordinates.float[]getY()Get value of the y axis coordinates.int[]makeLut()Create LUT.voidremovePoint(int index)Remove pointvoidsetX(float[] x)Set values of the x axis coordinates.voidsetXY(float[] x, float[] y)Set the values.voidsetY(float[] y)Set value of the y axis coordinates.static floatSpline(float x, int numKnots, float[] knots)Compute a Catmull-Rom spline.static floatSpline(float x, int numKnots, int[] xknots, int[] yknots)Compute a Catmull-Rom spline, but with variable knot spacing.
-
-
-
Constructor Detail
-
Curve
public Curve()
Initialize a new instance of the Curve class.
-
Curve
public Curve(Curve curve)
Initialize a new instance of the Curve class.- Parameters:
curve- Curve.
-
Curve
public Curve(float[] x, float[] y)Initialize a new instance of the Curve class.- Parameters:
x- X points.y- Y points.
-
-
Method Detail
-
getX
public float[] getX()
Get value of the x axis coordinates.- Returns:
- X axis coordinates.
-
setX
public void setX(float[] x)
Set values of the x axis coordinates.- Parameters:
x- X axis coordinates.
-
getY
public float[] getY()
Get value of the y axis coordinates.- Returns:
- Y axis coordinates.
-
setY
public void setY(float[] y)
Set value of the y axis coordinates.- Parameters:
y- Y axis coordinates.
-
setXY
public void setXY(float[] x, float[] y)Set the values.- Parameters:
x- X axis coordinates.y- Y axis coordinates.
-
addPoint
public void addPoint(java.util.List<FloatPoint> points)
Add collection of points.- Parameters:
points- Points.
-
addPoint
public void addPoint(FloatPoint point)
Add point in the curve.- Parameters:
point- Point.
-
addPoint
public void addPoint(float kx, float ky)Add point in the curve.- Parameters:
kx- X axis coordinate.ky- Y axis coordinate.
-
removePoint
public void removePoint(int index)
Remove point- Parameters:
index- Index.
-
clear
public void clear()
Clear all the points.
-
makeLut
public int[] makeLut()
Create LUT.- Returns:
- LUT.
-
Spline
public static float Spline(float x, int numKnots, float[] knots)Compute a Catmull-Rom spline.- Parameters:
x- the input parameternumKnots- the number of knots in the splineknots- the array of knots- Returns:
- the spline value
-
Spline
public static float Spline(float x, int numKnots, int[] xknots, int[] yknots)Compute a Catmull-Rom spline, but with variable knot spacing.- Parameters:
x- the input parameternumKnots- the number of knots in the splinexknots- the array of knot x valuesyknots- the array of knot y values- Returns:
- the spline value
-
-
DataMelt 3.0 © DataMelt by jWork.ORG