Package com.ribs.pdf

Class PDFFunction

java.lang.Object
com.ribs.pdf.PDFFunction
Direct Known Subclasses:
ArrayFunction, PDFInterpolationFunction, PDFSampledFunction, PDFStitchingFunction

public abstract class PDFFunction extends Object
  • Field Details

    • Sampled

      public static final int Sampled
      See Also:
    • ExponentialInterpolation

      public static final int ExponentialInterpolation
      See Also:
    • Stitching

      public static final int Stitching
      See Also:
    • PostScriptCalculator

      public static final int PostScriptCalculator
      See Also:
    • functionType

      public int functionType
    • inputDomain

      public float[] inputDomain
    • outputRange

      public float[] outputRange
    • returnValues

      public float[] returnValues
    • inputValues

      public float[] inputValues
  • Constructor Details

    • PDFFunction

      public PDFFunction()
    • PDFFunction

      public PDFFunction(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 Details

    • getInstance

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

      public void initializeParameters(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)