Package org.openpdf.renderer.function
Class FunctionType4
java.lang.Object
org.openpdf.renderer.function.PDFFunction
org.openpdf.renderer.function.FunctionType4
A PostScript function is represented as a stream containing code written in a small subset of the PostScript language. This reference is taken from the (3200-1:2008:7.10.5)
http://www.adobe.com/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf
-
Field Summary
FieldsModifier and TypeFieldDescriptionthe stack of operations.the list of tokens and sub-expressions.Fields inherited from class org.openpdf.renderer.function.PDFFunction
TYPE_0, TYPE_2, TYPE_3, TYPE_4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertResultIsCorrect(float[] outputs, int outputOffset) protected voiddoFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Map from m input values to n output values.protected voidRead the function information from a PDF Objectprivate voidprepareInitialStack(float[] inputs, int inputOffset) Put all input values on the initial stack.private voidprepareResult(float[] outputs, int outputOffset) Methods inherited from class org.openpdf.renderer.function.PDFFunction
calculate, calculate, getDomain, getFunction, getNumInputs, getNumOutputs, getRange, getType, interpolate, setDomain, setRange
-
Field Details
-
tokens
the list of tokens and sub-expressions. -
stack
the stack of operations. The stack contents should all be Comparable.
-
-
Constructor Details
-
FunctionType4
protected FunctionType4()Creates a new instance of FunctionType4
-
-
Method Details
-
parse
Read the function information from a PDF Object- Specified by:
parsein classPDFFunction- Throws:
IOException
-
doFunction
protected void doFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Map from m input values to n output values. The number of inputs m must be exactly one half the size of the domain. The number of outputs should match one half the size of the range.- Specified by:
doFunctionin classPDFFunction- Parameters:
inputs- an array of m input valuesinputOffset- the offset into the input array to read fromoutputs- an array of size >= n which will be filled with the output valuesoutputOffset- the offset into the output array to write to
-
prepareResult
private void prepareResult(float[] outputs, int outputOffset) - Parameters:
outputs-outputOffset-
-
prepareInitialStack
private void prepareInitialStack(float[] inputs, int inputOffset) Put all input values on the initial stack. All values are pushed as Double because we calculate internally with double.- Parameters:
inputs-inputOffset-
-
assertResultIsCorrect
private void assertResultIsCorrect(float[] outputs, int outputOffset) - Parameters:
outputs-outputOffset-
-