Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.common.function

public Class PDFunctionType2

extends PDFunction
Class Inheritance
Imports
org.apache.pdfbox.cos.COSArray, .COSBase, .COSFloat, .COSName, .COSNumber, java.io.IOException

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

Field Summary

Modifier and TypeField and Description
private final COSArray
c0

The C0 values of the exponential function.

private final COSArray
c1

The C1 values of the exponential function.

private final float
exponent

The exponent value of the exponential function.

Constructor Summary

AccessConstructor and Description
public
PDFunctionType2(COSBase
The function.
function
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public float[]
eval(float[]
The array of input values for the function. In many cases will be an array of a single value, but not always.
input
)

Implements abstract org.apache.pdfbox.pdmodel.common.function.PDFunction.eval.

Performs exponential interpolation Evaluates the function at the given input.

public COSArray

Returns:

a COSArray with the C0 values
getC0
()

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

public COSArray

Returns:

a COSArray with the C1 values
getC1
()

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

public int
public float

Returns:

the float value of the exponent
getN
()

Returns the exponent of the function.

public String
toString()

Overrides org.apache.pdfbox.pdmodel.common.function.PDFunction.toString.

Returns a string representation of the object.

Inherited from org.apache.pdfbox.pdmodel.common.function.PDFunction:
clipToRangeclipToRangecreategetCOSObjectgetDomainForInputgetNumberOfInputParametersgetNumberOfOutputParametersgetPDStreamgetRangeForOutputgetRangeValuesinterpolatesetDomainValuessetRangeValues

Field Detail

c0back to summary
private final COSArray c0

The C0 values of the exponential function.

c1back to summary
private final COSArray c1

The C1 values of the exponential function.

exponentback to summary
private final float exponent

The exponent value of the exponential function.

Constructor Detail

PDFunctionType2back to summary
public PDFunctionType2(COSBase function)

Constructor.

Parameters
function:COSBase

The function.

Method Detail

evalback to summary
public float[] eval(float[] input) throws IOException

Implements abstract org.apache.pdfbox.pdmodel.common.function.PDFunction.eval.

Doc from org.apache.pdfbox.pdmodel.common.function.PDFunction.eval.

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

Parameters
input:float[]

The array of input values for the function. In many cases will be an array of a single value, but not always.

Returns:float[]

The of outputs the function returns based on those inputs. In many cases will be an array of a single value, but not always.

Annotations
@Override
Exceptions
IOException:
if something went wrong processing the function.
getC0back to summary
public COSArray getC0()

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

Returns:COSArray

a COSArray with the C0 values

getC1back to summary
public COSArray getC1()

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

Returns:COSArray

a COSArray with the C1 values

getFunctionTypeback to summary
public int getFunctionType()

Implements abstract org.apache.pdfbox.pdmodel.common.function.PDFunction.getFunctionType.

Doc from org.apache.pdfbox.pdmodel.common.function.PDFunction.getFunctionType.

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

Returns:int

the function type.

Annotations
@Override
getNback to summary
public float getN()

Returns the exponent of the function.

Returns:float

the float value of the exponent

toStringback to summary
public String toString()

Overrides org.apache.pdfbox.pdmodel.common.function.PDFunction.toString.

Doc from org.apache.pdfbox.pdmodel.common.function.PDFunction.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override