Class LogarithmicTransform1D.Base10

All Implemented Interfaces:
Serializable, Parameterized, LenientComparable, org.opengis.referencing.operation.MathTransform, org.opengis.referencing.operation.MathTransform1D
Enclosing class:
LogarithmicTransform1D

static final class LogarithmicTransform1D.Base10 extends LogarithmicTransform1D
Special case for base 10 taking advantage of extra precision provided by Math.log10(double).
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • LOG_10

      private static final double LOG_10
      The natural logarithm of 10.
      See Also:
    • INSTANCE

      static final LogarithmicTransform1D.Base10 INSTANCE
      Commonly used instance with no offset.
    • offset

      private final double offset
      The offset to add to the logarithm.
      Note: the offset could be handled by a concatenation with LinearTransform1D. instead of 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 Details

    • Base10

      private Base10(double offset)
      Creates a new instance with the given offset.
      See Also:
  • Method Details

    • create

      public static LogarithmicTransform1D.Base10 create(double offset)
      Creates a new instance with the given offset.
    • base

      double base()
      Returns the base of this logarithmic function.
      Overrides:
      base in class LogarithmicTransform1D
    • lnBase

      double lnBase()
      Returns the natural logarithm of the base of this logarithmic function. More specifically, returns Math.log(LogarithmicTransform1D.base()).
      Overrides:
      lnBase in class LogarithmicTransform1D
    • offset

      double offset()
      Returns the offset applied after this logarithmic function.
      Overrides:
      offset in class LogarithmicTransform1D
    • derivative

      public double derivative(double value)
      Gets the derivative of this function at a value.
      Specified by:
      derivative in interface org.opengis.referencing.operation.MathTransform1D
      Overrides:
      derivative in class LogarithmicTransform1D
      Parameters:
      value - the value where to evaluate the derivative.
      Returns:
      the derivative at the specified point.
    • pow

      double pow(double value)
      Returns the base of this logarithmic transform raised to the given power.
      Overrides:
      pow in class LogarithmicTransform1D
      Parameters:
      value - the power to raise the base.
      Returns:
      the base of this transform raised to the given power.
    • log

      double log(double value)
      Returns the logarithm of the given value in the base of this logarithmic transform. This method is similar to LogarithmicTransform1D.transform(double) except that the offset is not added.
      Overrides:
      log in class LogarithmicTransform1D
      Parameters:
      value - the value for which to compute the log.
      Returns:
      the log of the given value in the base used by this transform.
    • transform

      public double transform(double value)
      Transforms the specified value.
      Specified by:
      transform in interface org.opengis.referencing.operation.MathTransform1D
      Overrides:
      transform in class LogarithmicTransform1D
      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:
      transform in interface org.opengis.referencing.operation.MathTransform
      Overrides:
      transform in class LogarithmicTransform1D
      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 positions in a list of coordinate values.
      Specified by:
      transform in interface org.opengis.referencing.operation.MathTransform
      Overrides:
      transform in class LogarithmicTransform1D
      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 positions in a list of coordinate values.
      Specified by:
      transform in interface org.opengis.referencing.operation.MathTransform
      Overrides:
      transform in class LogarithmicTransform1D
      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:
      transform in interface org.opengis.referencing.operation.MathTransform
      Overrides:
      transform in class LogarithmicTransform1D
      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 Apache SIS 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 considered equals to this math transform.
      See Also: