org.apache.pdfbox.pdmodel.common.function

## Class PDFunctionType2

- java.lang.Object
- - org.apache.pdfbox.pdmodel.common.function.PDFunction
  - - org.apache.pdfbox.pdmodel.common.function.PDFunctionType2

All Implemented Interfaces:
  COSObjectable

    public class PDFunctionType2
    extends PDFunction

This class represents a Type 2 (exponential interpolation) function in a PDF document.

Author:
  Ben Litchfield

### Constructor Summary

Constructors
Constructor and Description
`PDFunctionType2(COSBase function)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`float[]` `eval(float[] input)` Performs exponential interpolation Evaluates the function at the given input.
`COSArray` `getC0()` Returns the C0 values of the function, 0 if empty.
`COSArray` `getC1()` Returns the C1 values of the function, 1 if empty.
`int` `getFunctionType()` Returns the function type.
`float` `getN()` Returns the exponent of the function.
`String` `toString()`

### Methods inherited from class org.apache.pdfbox.pdmodel.common.function.PDFunction

`clipToRange, clipToRange, create, eval, getCOSObject, getDomainForInput, getNumberOfInputParameters, getNumberOfOutputParameters, getPDStream, getRangeForOutput, getRangeValues, interpolate, setDomainValues, setRangeValues`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PDFunctionType2

    public PDFunctionType2(COSBase function)

Constructor.

Parameters:
  `function` - The function.

### Method Detail

#### getFunctionType

    public int getFunctionType()

Returns the function type. Possible values are: 0 - Sampled function 2 - Exponential interpolation function 3 - Stitching function 4 - PostScript calculator function

Specified by:
  `getFunctionType` in class `PDFunction`
Returns:
  the function type.

#### eval

    public float[] eval(float[] input)
                 throws IOException

Performs exponential interpolation Evaluates the function at the given input. ReturnValue = f(input)

Specified by:
  `eval` in class `PDFunction`
Parameters:
  `input` - The array of input values for the function. In many cases will be an array of a single value, but not always.
Returns:
  The of outputs the function returns based on those inputs. In many cases will be an array of a single value, but not always.
Throws:
  `IOException` - if something went wrong processing the function.

#### getC0

    public COSArray getC0()

Returns the C0 values of the function, 0 if empty.

Returns:
  a COSArray with the C0 values

#### getC1

    public COSArray getC1()

Returns the C1 values of the function, 1 if empty.

Returns:
  a COSArray with the C1 values

#### getN

    public float getN()

Returns the exponent of the function.

Returns:
  the float value of the exponent

#### toString

    public String toString()

Overrides:
  `toString` in class `PDFunction`