org.geotoolkit.referencing.operation.transform
Class LogarithmicTransform1D

Object
  extended by FormattableObject
      extended by AbstractMathTransform
          extended by AbstractMathTransform1D
              extended by LogarithmicTransform1D
All Implemented Interfaces:
Serializable, Formattable, Parameterized, LenientComparable, MathTransform, MathTransform1D

@Immutable
public class LogarithmicTransform1D
extends AbstractMathTransform1D
implements Serializable

A one dimensional, logarithmic transform. This transform is the inverse of ExponentialTransform1D. Input values x are converted into output values y using the following equation:

y  =  offset + logbase(x)
 =  offset + ln(x)/ln(base)
See any of the following providers for a list of programmatic parameters:

Since:
2.0
Version:
3.18
Author:
Martin Desruisseaux (IRD, Geomatys)
See Also:
ExponentialTransform1D, LinearTransform1D, Serialized Form
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class AbstractMathTransform
AbstractMathTransform.Inverse
 
Field Summary
 double base
          The base of the logarithm.
 double offset
          The offset to add to the logarithm.
 
Fields inherited from class FormattableObject
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE
 
Constructor Summary
protected LogarithmicTransform1D(double base, double offset)
          Constructs a new logarithmic transform.
 
Method Summary
protected  int computeHashCode()
          Computes a hash value for this transform.
static MathTransform1D create(double base)
          Constructs a new logarithmic transform without offset.
static MathTransform1D create(double base, double offset)
          Constructs a new logarithmic transform which include the given offset after the logarithm.
 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.
 ParameterDescriptorGroup getParameterDescriptors()
          Returns the parameter descriptors for this math transform.
 ParameterValueGroup getParameterValues()
          Returns the parameter values for this math transform.
 MathTransform1D inverse()
          Creates the inverse transform of this object.
 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
derivative, getSourceDimensions, getTargetDimensions
 
Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, ensureNonNull, equals, formatWKT, getName, hashCode, isIdentity, 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
isIdentity, toWKT, transform
 

Field Detail

base

public final double base
The base of the logarithm.


offset

public final double offset
The offset to add to the logarithm.
Note: The offset could be handled by a concatenation with LinearTransform1D instead than an explicit field in this class. However the offset + logbase(x) formula is extensively used as a transfer function in grid coverages. Consequently we keep this explicit field for performance reasons.

Constructor Detail

LogarithmicTransform1D

protected LogarithmicTransform1D(double base,
                                 double offset)
Constructs a new logarithmic transform. This constructor is provided for subclasses only. Instances should be created using the factory method, which may returns optimized implementations for some particular argument values.

Parameters:
base - The base of the logarithm (typically 10).
offset - The offset to add to the logarithm.
Method Detail

create

public static MathTransform1D create(double base)
Constructs a new logarithmic transform without offset.

Parameters:
base - The base of the logarithm (typically 10).
Returns:
The math transform.
Since:
3.17

create

public static MathTransform1D create(double base,
                                     double offset)
Constructs a new logarithmic transform which include the given offset after the logarithm.

Parameters:
base - The base of the logarithm (typically 10).
offset - The offset to add to the logarithm.
Returns:
The math transform.

getParameterDescriptors

public ParameterDescriptorGroup getParameterDescriptors()
Returns the parameter descriptors for this math transform.

Specified by:
getParameterDescriptors in interface Parameterized
Overrides:
getParameterDescriptors in class AbstractMathTransform
Returns:
The parameter descriptors for this math transform, or null.
See Also:
OperationMethod.getParameters()

getParameterValues

public ParameterValueGroup getParameterValues()
Returns the parameter values for this math transform.

Specified by:
getParameterValues in interface Parameterized
Overrides:
getParameterValues in class AbstractMathTransform
Returns:
A copy of the parameter values for this math transform.
See Also:
SingleOperation.getParameterValues()

inverse

public MathTransform1D inverse()
Creates the inverse transform of this object.

Specified by:
inverse in interface MathTransform
Specified by:
inverse in interface MathTransform1D
Overrides:
inverse in class AbstractMathTransform1D

derivative

public double derivative(double value)
Gets the derivative of this function at a value.

Specified by:
derivative in interface MathTransform1D

transform

public double transform(double value)
Transforms the specified value.

Specified by:
transform in interface MathTransform1D

transform

protected void transform(double[] srcPts,
                         int srcOff,
                         double[] dstPts,
                         int dstOff)
Transforms a single coordinate in a list of ordinal values.

Overrides:
transform in class AbstractMathTransform1D
Parameters:
srcPts - 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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      double[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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 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.

transform

public void transform(float[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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 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.

transform

public void transform(double[] srcPts,
                      int srcOff,
                      float[] dstPts,
                      int dstOff,
                      int numPts)
Transforms many coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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 coordinates in a list of ordinal values.

Specified by:
transform in interface MathTransform
Overrides:
transform in class AbstractMathTransform
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.

computeHashCode

protected int computeHashCode()
Computes a hash value for this transform. This method is invoked by AbstractMathTransform.hashCode() when first needed.

Overrides:
computeHashCode in class AbstractMathTransform
Returns:
The hash code value. This value may change between different execution of the Geotk library.

equals

public boolean equals(Object object,
                      ComparisonMode mode)
Compares the specified object with this math transform for equality.

Specified by:
equals in interface LenientComparable
Overrides:
equals in class AbstractMathTransform
Parameters:
object - The object to compare with this transform.
mode - The strictness level of the comparison. Default to STRICT.
Returns:
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.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.