Class PDFFunction

  • Direct Known Subclasses:
    ArrayFunction, InterpolationFunction, SampledFunction, StitchingFunction

    public abstract class PDFFunction
    extends java.lang.Object
    This is an abstract superclass for all objects implementing PDF functions. PDF functions come in several flavors, but their basic job is to take a set of n input values and return m output values.
    • Field Detail

      • ExponentialInterpolation

        public static final int ExponentialInterpolation
        See Also:
        Constant Field Values
      • functionType

        public int functionType
      • inputDomain

        public float[] inputDomain
      • outputRange

        public float[] outputRange
      • returnValues

        public float[] returnValues
      • inputValues

        public float[] inputValues
    • Constructor Detail

      • PDFFunction

        public PDFFunction()
      • PDFFunction

        public PDFFunction​(java.util.Map functionDict,
                           PDFFile srcFile)
        Constructor - takes the pdf function dictionary and the file it came from.
      • PDFFunction

        public PDFFunction​(PDFStream functionStream,
                           PDFFile srcFile)
        Constructor for functions which take a stream
    • Method Detail

      • getInstance

        public static PDFFunction getInstance​(java.lang.Object function,
                                              PDFFile srcFile)
        Reads the function dictionary and creates an instance of the appropriate PDFFunction subclass
      • initializeParameters

        public void initializeParameters​(java.util.Map functionDict,
                                         PDFFile srcFile)
        Read the function parameters
      • numInputValues

        public int numInputValues()
        Returns the number of parameters this function takes as input
      • numOutputValues

        public int numOutputValues()
        Returns the number of values this function returns. Should be overridden by subclasses that don't require outputRange.
      • evaluate

        public float[] evaluate​(float[] inputs)
        Evaluate the function. Note that the return value array is reused, so if you need to save the results around for any length of time, you should copy them out.
      • clipToRange

        public void clipToRange​(float[] vals,
                                float[] range,
                                float[] clipped)
        Used internally by all function types to clip both the input and the output values to the Range and Domain values.
      • function_implementation

        public abstract void function_implementation​(float[] in,
                                                     float[] out)