|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFormattableObject
AbstractMathTransform
AbstractMathTransform1D
LinearTransform1D
@Immutable public class LinearTransform1D
A one dimensional, linear transform. Input values x are converted into output values y using the following equation:
y = x × scale + offsetThis class is the same as a 2×2 affine transform. However, this specialized
LinearTransform1D class is faster. This kind of transform is extensively
used by GridCoverage2D.
See any of the following providers for a list of programmatic parameters:
LogarithmicTransform1D,
ExponentialTransform1D,
Serialized Form
| referencing/geotk-referencing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class AbstractMathTransform |
|---|
AbstractMathTransform.Inverse |
| Field Summary | |
|---|---|
static LinearTransform1D |
IDENTITY
The identity transform. |
double |
offset
The value to add to input values. |
double |
scale
The value which is multiplied to input values. |
| Fields inherited from class FormattableObject |
|---|
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE |
| Constructor Summary | |
|---|---|
protected |
LinearTransform1D(double scale,
double offset)
Constructs a new linear transform. |
| Method Summary | |
|---|---|
protected int |
computeHashCode()
Computes a hash value for this transform. |
static LinearTransform1D |
create(double scale,
double offset)
Constructs a new linear transform. |
Matrix |
derivative(DirectPosition point)
Gets the derivative of this transform at a point. |
double |
derivative(double value)
Gets the derivative of this function at a value. |
boolean |
equals(Object object,
ComparisonMode mode)
Compares the specified object with this math transform for equality. |
Matrix |
getMatrix()
Returns this transform as an affine transform matrix. |
ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptors for this math transform. |
ParameterValueGroup |
getParameterValues()
Returns the matrix elements as a group of parameters values. |
MathTransform1D |
inverse()
Creates the inverse transform of this object. |
boolean |
isIdentity()
Tests whether this transform does not move any points. |
boolean |
isIdentity(double tolerance)
Tests whether this transform does not move any points by using the provided tolerance. |
double |
transform(double value)
Transforms the specified value. |
protected void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
Transforms a single coordinate in a list of ordinal values. |
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
void |
transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
Transforms many coordinates in a list of ordinal values. |
| Methods inherited from class AbstractMathTransform1D |
|---|
getSourceDimensions, getTargetDimensions |
| Methods inherited from class AbstractMathTransform |
|---|
createTransformedShape, derivative, ensureNonNull, equals, formatWKT, getName, hashCode, rollLongitude, transform, transform |
| Methods inherited from class FormattableObject |
|---|
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface MathTransform |
|---|
getSourceDimensions, getTargetDimensions, toWKT, transform |
| Methods inherited from interface LenientComparable |
|---|
equals |
| Field Detail |
|---|
public static final LinearTransform1D IDENTITY
public final double scale
public final double offset
| Constructor Detail |
|---|
protected LinearTransform1D(double scale,
double offset)
scale - The scale term in the linear equation.offset - The offset term in the linear equation.| Method Detail |
|---|
public static LinearTransform1D create(double scale,
double offset)
scale - The scale term in the linear equation.offset - The offset term in the linear equation.
public ParameterDescriptorGroup getParameterDescriptors()
getParameterDescriptors in interface ParameterizedgetParameterDescriptors in class AbstractMathTransformnull.OperationMethod.getParameters()public ParameterValueGroup getParameterValues()
getParameterValues in interface ParameterizedgetParameterValues in class AbstractMathTransformSingleOperation.getParameterValues()public Matrix getMatrix()
getMatrix in interface LinearTransform
public MathTransform1D inverse()
throws NoninvertibleTransformException
inverse in interface MathTransforminverse in interface MathTransform1Dinverse in class AbstractMathTransform1DNoninvertibleTransformExceptionpublic boolean isIdentity()
isIdentity in interface MathTransformisIdentity in class AbstractMathTransformpublic boolean isIdentity(double tolerance)
isIdentity in interface LinearTransformtolerance - The tolerance factor.
true if this transform is the identity oneXMatrix.isIdentity(double)
public Matrix derivative(DirectPosition point)
throws TransformException
derivative in interface MathTransformderivative in class AbstractMathTransform1Dpoint - Ignored for a linear transform. Can be null.
TransformException - if the derivative can't be evaluated at the specified point.public double derivative(double value)
derivative in interface MathTransform1Dvalue - Ignored for a linear transform. Can be NaN.
public double transform(double value)
transform in interface MathTransform1D
protected void transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
transform in class AbstractMathTransform1DsrcPts - The array containing the source point coordinates.srcOff - The offset to the point to be transformed in the source array.dstPts - the array into which the transformed point coordinate are returned.
May be the same than srcPts.dstOff - The offset to the location of the transformed point that is
stored in the destination array.
public void transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the first point to be transformed in the source array.dstPts - The array into which the transformed point coordinates are returned.
May be the same than srcPts.dstOff - The offset to the location of the first transformed point that is
stored in the destination array.numPts - The number of point objects to be transformed.
public void transform(float[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the first point to be transformed in the source array.dstPts - The array into which the transformed point coordinates are returned.
May be the same than srcPts.dstOff - The offset to the location of the first transformed point that is
stored in the destination array.numPts - The number of point objects to be transformed.
public void transform(double[] srcPts,
int srcOff,
float[] dstPts,
int dstOff,
int numPts)
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the first point to be transformed in the source array.dstPts - The array into which the transformed point coordinates are returned.dstOff - The offset to the location of the first transformed point that is
stored in the destination array.numPts - The number of point objects to be transformed.
public void transform(float[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the first point to be transformed in the source array.dstPts - The array into which the transformed point coordinates are returned.dstOff - The offset to the location of the first transformed point that is
stored in the destination array.numPts - The number of point objects to be transformed.protected int computeHashCode()
AbstractMathTransform.hashCode()
when first needed.
computeHashCode in class AbstractMathTransform
public boolean equals(Object object,
ComparisonMode mode)
true if the following conditions are meet:
object is an instance of the same class than this. We require the
same class because there is no interface for the various kinds of transform.The parameter values are not compared because subclasses can typically compare those values more efficiently by accessing to their member fields.
equals in interface LinearTransformequals in interface LenientComparableequals in class AbstractMathTransformobject - The object to compare with this transform.mode - The strictness level of the comparison. Default to STRICT.
true if the given object is a transform of the same class and if, given
identical source position, the transformed position would be the equals.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||