Class EnhancementFunctionFactory

java.lang.Object
noaa.coastwatch.render.EnhancementFunctionFactory

public class EnhancementFunctionFactory extends Object
The EnhancementFunctionFactory creates enhancement functions using a simple set of specifications. This is useful when receiving input from the user or a file, and the input must be used to create a function.
Since:
3.1.9
Author:
Peter Hollemans
  • Constructor Details

    • EnhancementFunctionFactory

      public EnhancementFunctionFactory()
  • Method Details

    • create

      public static EnhancementFunction create(String functionType, double[] range)
      Creates a new enhancement function based on a set of specifications.
      Parameters:
      functionType - the type of function desired. Supported function types are 'linear', 'log', and 'stepN' where N is the number of steps in the function, for example 'step10'. Each type may be extended with '-reverse' to indicate a reversal of the range, ie: equivalent to calling EnhancementFunction.setReverse(boolean) after creation.
      range - the function range as [min, max].
      Returns:
      the new enhancement function.
      Throws:
      IllegalArgumentException - if the function type is not supported.
    • convert

      public static EnhancementFunction convert(EnhancementFunction source, String functionType)
      Converts an enhancement function to a new function type. The new function has the same range as the source function.
      Parameters:
      source - the source function to be converted.
      functionType - the new function type to convert to, either 'linear', 'log', or 'stepN' where N is the step count.
      Returns:
      the new converted enhancement function.
      Throws:
      IllegalArgumentException - if the function type is not supported.
      See Also: