Class PDFunctionType4
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.common.function.PDFunction
-
- org.apache.pdfbox.pdmodel.common.function.PDFunctionType4
-
- All Implemented Interfaces:
COSObjectable
public class PDFunctionType4 extends PDFunction
This class represents a Type 4 (PostScript calculator) function in a PDF document.See section 3.9.4 of the PDF 1.4 Reference.
-
-
Field Summary
Fields Modifier and Type Field Description private InstructionSequence
instructions
private static Operators
OPERATORS
-
Constructor Summary
Constructors Constructor Description PDFunctionType4(COSBase functionStream)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]
eval(float[] input)
Evaluates the function at the given input.int
getFunctionType()
Returns the function type.-
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, toString
-
-
-
-
Field Detail
-
OPERATORS
private static final Operators OPERATORS
-
instructions
private final InstructionSequence instructions
-
-
Constructor Detail
-
PDFunctionType4
public PDFunctionType4(COSBase functionStream) throws java.io.IOException
Constructor.- Parameters:
functionStream
- The function stream.- Throws:
java.io.IOException
- if an I/O error occurs while reading 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 classPDFunction
- Returns:
- the function type.
-
eval
public float[] eval(float[] input) throws java.io.IOException
Evaluates the function at the given input. ReturnValue = f(input)- Specified by:
eval
in 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.
- Throws:
java.io.IOException
- if something went wrong processing the function.
-
-