Class FunctionType2


  • public class FunctionType2
    extends PDFFunction
    A type 2 function is an exponential interpolation function, which maps from one input value to n output values using a simple exponential formula.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float[] c0
      the function's value at zero for the n outputs
      private float[] c1
      the function's value at one for the n outputs
      private float n
      the exponent
    • Constructor Summary

      Constructors 
      Constructor Description
      FunctionType2()
      Creates a new instance of FunctionType2
    • Field Detail

      • c0

        private float[] c0
        the function's value at zero for the n outputs
      • c1

        private float[] c1
        the function's value at one for the n outputs
      • n

        private float n
        the exponent
    • Constructor Detail

      • FunctionType2

        public FunctionType2()
        Creates a new instance of FunctionType2
    • Method Detail

      • parse

        protected void parse​(PDFObject obj)
                      throws java.io.IOException
        Read the zeros, ones and exponent
        Specified by:
        parse in class PDFFunction
        Throws:
        java.io.IOException
      • doFunction

        protected void doFunction​(float[] inputs,
                                  int inputOffset,
                                  float[] outputs,
                                  int outputOffset)
        Calculate the function value for the input. For each output (j), the function value is: C0(j) + x^N * (C1(j) - C0(j))
        Specified by:
        doFunction in class PDFFunction
        Parameters:
        inputs - guaranteed to be at least as big as getNumInputs() and all values within range
        inputOffset - the offset into the inputs array to read from
        outputs - guaranteed to be at least as big as getNumOutputs(), but not yet clipped to domain
        outputOffset - the offset into the output array to write to
      • getN

        public float getN()
        Get the exponent
      • setN

        protected void setN​(float n)
        Set the exponent
      • getC0

        public float getC0​(int index)
        Get the values at zero
      • setC0

        protected void setC0​(float[] c0)
        Set the values at zero
      • getC1

        public float getC1​(int index)
        Get the values at one
      • setC1

        protected void setC1​(float[] c1)
        Set the values at one