Package com.sun.pdfview.function
Class FunctionType4
java.lang.Object
com.sun.pdfview.function.PDFFunction
com.sun.pdfview.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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static HashSet<FunctionType4.Operation> the set of all Operations we support.private LinkedList<Object> the stack of operations.private LinkedListthe list of tokens and sub-expressions.Fields inherited from class com.sun.pdfview.function.PDFFunction
TYPE_0, TYPE_2, TYPE_3, TYPE_4 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset) Map from m input values to n output values.private voidInitialize the operations that we can perform.protected voidRead the function information from a PDF Objectprivate booleanprivate doubleprivate FunctionType4.Expressionprivate longpopLong()private Objectprivate voidpushBoolean(boolean arg) private voidpushDouble(double arg) private voidpushExpression(FunctionType4.Expression expresson) private voidpushLong(long arg) private voidpushObject(Object obj) private voidreadPS(ByteBuffer buf) parse the postscript operators and aguments from the stream.Methods inherited from class com.sun.pdfview.function.PDFFunction
calculate, calculate, getDomain, getFunction, getNumInputs, getNumOutputs, getRange, getType, setDomain, setRange
-
Field Details
-
operationSet
the set of all Operations we support. These operations are defined in Appendix B - Operators. -
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
-
initOperations
private void initOperations()Initialize the operations that we can perform. -
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 inputs array to read fromoutputs- an array of size n which will be filled with the output values, or null to return a new arrayoutputOffset- the offset into the output array to write to
-
popBoolean
private boolean popBoolean() -
pushBoolean
private void pushBoolean(boolean arg) -
popDouble
private double popDouble() -
pushDouble
private void pushDouble(double arg) -
popExpression
-
pushExpression
-
popLong
private long popLong() -
pushLong
private void pushLong(long arg) -
popObject
-
pushObject
-
readPS
parse the postscript operators and aguments from the stream.
Syntax is to read a set of tokens, including expressions and to queue them as they come including other expressions. Expressions are enclosed in curly brackets and constitute a reference to the expression body.
- Parameters:
buf- the stream of postscript tokens
-