org.apache.sis.referencing.operation.transform

## Class TransferFunction

- Object
- - TransferFunction

- All Implemented Interfaces:
    Serializable, Cloneable

      public class TransferFunction
      extends Object
      implements Cloneable, Serializable

  The function converting raster sample values to geophysics values. The function is usually linear, but can sometime be logarithmic or exponential. The later occur most often when measuring concentration of something.

  Supported transfer function types
  Type | Equation
  --- | ---
  `LINEAR` | y = scale⋅x + offset
  `LOGARITHMIC` | y = scale⋅logbase(x) + offset
  `EXPONENTIAL` | y = scale⋅basex + offset

  Missing values
  This `TransferFunction` class handles only the continuous part of transfer functions. This class does not handle missing values other than `NaN`. For a more complete class with support for non-NaN missing values, see `GridSampleDimension`.
  Serialization
  Serialized instances of this class are not guaranteed to be compatible with future SIS versions. Serialization should be used only for short term storage or RMI between applications running the same SIS version.
  Since:
    0.5
  See Also:
    Serialized Form

  Defined in the `sis-referencing` module

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransferFunction()` Creates a transfer function initialized to the identity transform.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TransferFunction` | `clone()` Returns a clone of this transfer function.
    `double` | `getBase()` Returns the logarithm or exponent base in the transfer function.
    `double` | `getOffset()` Returns the offset of the transfer function.
    `double` | `getScale()` Returns the scale factor of the transfer function.
    `MathTransform1D` | `getTransform()` Returns the transform from sample values to geophysics values, as specified by the current properties of this `TransferFunction`.
    `TransferFunctionType` | `getType()` Returns the transfer function type (linear, logarithmic or exponential).
    `void` | `setBase(double base)` Sets the logarithm or exponent base in the transfer function.
    `void` | `setOffset(double offset)` Sets the offset of the transfer function.
    `void` | `setScale(double scale)` Sets the scale factor of the transfer function.
    `void` | `setTransform(MathTransform1D function)` Sets the transform from sample values to geophysics values.
    `void` | `setType(TransferFunctionType type)` Sets the transfer function type.
    `String` | `toString()` Returns a string representation of this transfer function for debugging purpose.

    - ### Methods inherited from class Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TransferFunction

          public TransferFunction()

      Creates a transfer function initialized to the identity transform.

  - ### Method Detail

    - #### getType

          public TransferFunctionType getType()

      Returns the transfer function type (linear, logarithmic or exponential).
      Returns:
        the transfer function type.

    - #### setType

          public void setType(TransferFunctionType type)

      Sets the transfer function type. The default value is `TransferFunctionType​.LINEAR`.
      Parameters:
        `type` - the transfer function type.

    - #### getBase

          public double getBase()

      Returns the logarithm or exponent base in the transfer function. This value is always 1 for `TransferFunctionType​.LINEAR`, and usually (but not necessarily) 10 for the logarithmic and exponential types.
      Returns:
        the logarithmic or exponent base.

    - #### setBase

          public void setBase(double base)

      Sets the logarithm or exponent base in the transfer function. This value is ignored for `TransferFunctionType​.LINEAR`. For other supported types, the default value is 10.
      Parameters:
        `base` - the new logarithm or exponent base.

    - #### getScale

          public double getScale()

      Returns the scale factor of the transfer function.
      Returns:
        the scale factor.

    - #### setScale

          public void setScale(double scale)

      Sets the scale factor of the transfer function. The default value is 1.
      Parameters:
        `scale` - the new scale factor.

    - #### getOffset

          public double getOffset()

      Returns the offset of the transfer function.
      Returns:
        the offset.

    - #### setOffset

          public void setOffset(double offset)

      Sets the offset of the transfer function. The default value is 0.
      Parameters:
        `offset` - the new offset.

    - #### getTransform

          public MathTransform1D getTransform()

      Returns the transform from sample values to geophysics values, as specified by the current properties of this `TransferFunction`.
      Returns:
        the transform from sample to geophysics values.

    - #### setTransform

          public void setTransform(MathTransform1D function)
                            throws IllegalArgumentException

      Sets the transform from sample values to geophysics values. This method infers the base, scale and offset values from the given transform.
      Parameters:
        `function` - the transform to set.
      Throws:
        `IllegalArgumentException` - if this method does not recognize the given transform.

    - #### clone

          public TransferFunction clone()

      Returns a clone of this transfer function.
      Overrides:
        `clone` in class `Object`
      Returns:
        a clone of this transfer function.
      Since:
        0.8

    - #### toString

          @Debug
          public String toString()

      Returns a string representation of this transfer function for debugging purpose. The string returned by this method may change in any future SIS version.
      Overrides:
        `toString` in class `Object`
      Returns:
        a string representation of this transfer function.

Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.