Class GammaEnhancement

All Implemented Interfaces:
Serializable, Cloneable, Encodable

public class GammaEnhancement extends EnhancementFunction
A gamma enhancement is an enhancement function formed by a power law y = (mx + b)^g relationship where g is the gamma value, set to 1/2.2 by default. This equation normalizes the value of x within the range using a linear enhancement, and then applies the power to encode the normalized value, typically for display of a grayscale intensity value on a screen. Since computer screens normally have a gamma correction value of 2.2, this makes the x value intensity look correct, when x represents an intensity such as albedo.
Since:
3.4.1
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • GammaEnhancement

      public GammaEnhancement(double[] range)
      Constructs a gamma enhancement from the data value range. The minimum and maximum data values are mapped to [0..1].
      Parameters:
      range - the enhancement range as [min, max].
  • Method Details

    • getGamma

      public double getGamma()
      Gets the gamma value for this function.
      Returns:
      the gamma value used in the normalization.
      Since:
      3.7.0
    • getInverse

      public double getInverse(double normValue)
      Description copied from class: EnhancementFunction
      Gets the inverse enhancement value.
      Specified by:
      getInverse in class EnhancementFunction
      Parameters:
      normValue - the normalized data value.
      Returns:
      the unnormalized data value.
    • evaluate

      public double evaluate(double[] variables)
      Evaluates the enhancement at the specified data value. The EnhancementFunction.getValue(double) method should be used instead of this method for evaluating enhancement values.
      Specified by:
      evaluate in class Function
      Parameters:
      variables - a double[1] specifying the data value.
      Returns:
      the enhancement value.
    • reset

      protected void reset()
      Description copied from class: EnhancementFunction
      Resets the enhancement function. This method performs no operation, but should be overridden by the subclass to set up internal variables according to the new range values and reverse flag.
      Overrides:
      reset in class EnhancementFunction
    • describe

      public String describe()
      Description copied from class: EnhancementFunction
      Gets a description of the function.
      Specified by:
      describe in class EnhancementFunction