Package noaa.coastwatch.render
Class GammaEnhancement
java.lang.Object
noaa.coastwatch.util.Function
noaa.coastwatch.render.EnhancementFunction
noaa.coastwatch.render.GammaEnhancement
- All Implemented Interfaces:
Serializable,Cloneable,Encodable
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:
-
Field Summary
Fields inherited from class noaa.coastwatch.render.EnhancementFunction
range, reverse -
Constructor Summary
ConstructorsConstructorDescriptionGammaEnhancement(double[] range) Constructs a gamma enhancement from the data value range. -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Gets a description of the function.doubleevaluate(double[] variables) Evaluates the enhancement at the specified data value.doublegetGamma()Gets the gamma value for this function.doublegetInverse(double normValue) Gets the inverse enhancement value.protected voidreset()Resets the enhancement function.Methods inherited from class noaa.coastwatch.render.EnhancementFunction
clone, equals, getRange, getReverse, getValue, normalize, setRange, setReverseMethods inherited from class noaa.coastwatch.util.Function
getEncoding, useEncoding
-
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:EnhancementFunctionGets the inverse enhancement value.- Specified by:
getInversein classEnhancementFunction- 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. TheEnhancementFunction.getValue(double)method should be used instead of this method for evaluating enhancement values. -
reset
protected void reset()Description copied from class:EnhancementFunctionResets 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:
resetin classEnhancementFunction
-
describe
Description copied from class:EnhancementFunctionGets a description of the function.- Specified by:
describein classEnhancementFunction
-