Class ConstantTransform1D
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
org.apache.sis.referencing.operation.transform.LinearTransform1D
org.apache.sis.referencing.operation.transform.ConstantTransform1D
- All Implemented Interfaces:
Serializable,Parameterized,LinearTransform,LenientComparable,org.opengis.referencing.operation.MathTransform,org.opengis.referencing.operation.MathTransform1D
A one dimensional, constant transform. Output values are set to a constant value regardless of input values.
This class is a special case of
LinearTransform1D in which LinearTransform1D.scale = 0 and
LinearTransform1D.offset = constant. However, this specialized ConstantTransform1D class is
faster.
ConstantTransform1D behavior differs from LinearTransform1D behavior is one aspect:
NaN values are ignored and converted to the constant value. By contrast, LinearTransform1D let
those values to NaN. Overwriting NaN by the constant value is required by org.apache.sis.coverage.
- Since:
- 0.5
- Version:
- 0.5
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
AbstractMathTransform1D.Inverse -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ConstantTransform1DA transform for the one constant.private static final longSerial number for inter-operability with different versions.(package private) static final ConstantTransform1DA transform for the positive zero constant.Fields inherited from class org.apache.sis.referencing.operation.transform.LinearTransform1D
NEGATE, offset, scaleFields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
MAXIMUM_BUFFER_SIZE, MAXIMUM_FAILURES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubletransform(double value) Transforms the specified value.voidtransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.voidtransform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.Methods inherited from class org.apache.sis.referencing.operation.transform.LinearTransform1D
computeHashCode, constant, create, deltaTransform, derivative, derivative, equals, getMatrix, getParameterDescriptors, getParameterValues, inverse, isAffine, isIdentity, toString, transformMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform1D
getSourceDimensions, getTargetDimensionsMethods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
beforeFormat, equals, formatTo, getContextualParameters, getDomain, hashCode, isInverseEquals, mismatchedDimension, transform, tryConcatenateMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.operation.MathTransform
getSourceDimensions, getTargetDimensions, toWKT, transform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
ZERO
A transform for the positive zero constant. -
ONE
A transform for the one constant.
-
-
Constructor Details
-
ConstantTransform1D
ConstantTransform1D(double offset) Constructs a new constant transform.- Parameters:
offset- theoffsetterm in the linear equation.
-
-
Method Details
-
transform
public double transform(double value) Transforms the specified value.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform1D- Overrides:
transformin classLinearTransform1D- Parameters:
value- the value to transform.- Returns:
- the transformed value.
-
transform
public void transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classLinearTransform1D- Parameters:
srcPts- 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 thansrcPts.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.
-
transform
public void transform(float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classLinearTransform1D- Parameters:
srcPts- 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 thansrcPts.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.
-
transform
public void transform(double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classLinearTransform1D- Parameters:
srcPts- 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.
-
transform
public void transform(float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) Transforms many positions in a list of coordinate values.- Specified by:
transformin interfaceorg.opengis.referencing.operation.MathTransform- Overrides:
transformin classLinearTransform1D- Parameters:
srcPts- 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.
-