Class SimpleGammaMapping

java.lang.Object
imagingbook.common.color.gamma.SimpleGammaMapping
All Implemented Interfaces:
GammaMapping

public class SimpleGammaMapping extends Object implements GammaMapping

Defines the basic "gamma correction" used for converting linear to non-linear color component values. The mapping function consists of a non-linear part only. Note that gamma specifies the nominal γ parameter for the forward (i.e., linear to non-linear) mapping, e.g., γ ~ 1/2.2 for Adobe RGB. See Sec. 3.7.2 of [1] for more details.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/14
  • Constructor Details

    • SimpleGammaMapping

      public SimpleGammaMapping(double gamma)
      Constructor.
      Parameters:
      gamma - nominal γ value for the forward mapping (e.g., γ ~ 1/2.2 for Adobe RGB)
  • Method Details

    • applyFwd

      public double applyFwd(double a)
      Description copied from interface: GammaMapping
      Forward Gamma mapping (from linear to non-linear component values).
      Specified by:
      applyFwd in interface GammaMapping
      Parameters:
      a - linear component value in [0,1]
      Returns:
      the gamma-corrected (non-linear) component value
    • applyInv

      public double applyInv(double b)
      Description copied from interface: GammaMapping
      Inverse Gamma mapping (from non-linear to linear component values).
      Specified by:
      applyInv in interface GammaMapping
      Parameters:
      b - non-linear (Gamma-corrected) component value in [0,1]
      Returns:
      the linear component value