java.lang.Object
org.sejda.sambox.pdmodel.common.function.PDFunction
org.sejda.sambox.pdmodel.common.function.PDFunctionType2
- All Implemented Interfaces:
COSObjectable
This class represents a Type 2 (exponential interpolation) function in a PDF document.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]eval(float[] input) Performs exponential interpolationgetC0()Returns the C0 values of the function, 0 if empty.getC1()Returns the C1 values of the function, 1 if empty.intReturns the function type.floatgetN()Returns the exponent of the function.toString()Methods inherited from class org.sejda.sambox.pdmodel.common.function.PDFunction
clipToRange, clipToRange, create, eval, getCOSObject, getDomainForInput, getNumberOfInputParameters, getNumberOfOutputParameters, getPDStream, getRangeForOutput, getRangeValues, interpolate, setDomainValues, setRangeValues
-
Field Details
-
c0
The C0 values of the exponential function. -
c1
The C1 values of the exponential function. -
exponent
private final float exponentThe exponent value of the exponential function.
-
-
Constructor Details
-
PDFunctionType2
Constructor.- Parameters:
function- The function.
-
-
Method Details
-
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:
getFunctionTypein classPDFunction- Returns:
- the function type.
-
eval
public float[] eval(float[] input) Performs exponential interpolationEvaluates the function at the given input. ReturnValue = f(input)
- Specified by:
evalin classPDFunction- 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.
-
getC0
Returns the C0 values of the function, 0 if empty.- Returns:
- a COSArray with the C0 values
-
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
- Overrides:
toStringin classPDFunction
-