Package com.sun.pdfview.function
Class FunctionType4
- java.lang.Object
-
- com.sun.pdfview.function.PDFFunction
-
- com.sun.pdfview.function.FunctionType4
-
public class FunctionType4 extends PDFFunction
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 Classes Modifier and Type Class Description (package private) classFunctionType4.Expression(package private) classFunctionType4.Operation
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashSet<FunctionType4.Operation>operationSetthe set of all Operations we support.private java.util.LinkedList<java.lang.Object>stackthe stack of operations.private java.util.LinkedListtokensthe 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 Modifier Constructor Description protectedFunctionType4()Creates a new instance of FunctionType4
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset)Map from m input values to n output values.private voidinitOperations()Initialize the operations that we can perform.protected voidparse(PDFObject obj)Read the function information from a PDF Objectprivate booleanpopBoolean()private doublepopDouble()private FunctionType4.ExpressionpopExpression()private longpopLong()private java.lang.ObjectpopObject()private voidpushBoolean(boolean arg)private voidpushDouble(double arg)private voidpushExpression(FunctionType4.Expression expresson)private voidpushLong(long arg)private voidpushObject(java.lang.Object obj)private voidreadPS(java.nio.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 Detail
-
operationSet
private static java.util.HashSet<FunctionType4.Operation> operationSet
the set of all Operations we support. These operations are defined in Appendix B - Operators.
-
tokens
private java.util.LinkedList tokens
the list of tokens and sub-expressions.
-
stack
private java.util.LinkedList<java.lang.Object> stack
the stack of operations. The stack contents should all be Comparable.
-
-
Method Detail
-
initOperations
private void initOperations()
Initialize the operations that we can perform.
-
parse
protected void parse(PDFObject obj) throws java.io.IOException
Read the function information from a PDF Object- Specified by:
parsein classPDFFunction- Throws:
java.io.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 valuesoutputs- an array of size n which will be filled with the output values, or null to return a new arrayinputOffset- the offset into the inputs array to read fromoutputOffset- 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
private FunctionType4.Expression popExpression()
-
pushExpression
private void pushExpression(FunctionType4.Expression expresson)
-
popLong
private long popLong()
-
pushLong
private void pushLong(long arg)
-
popObject
private java.lang.Object popObject()
-
pushObject
private void pushObject(java.lang.Object obj)
-
readPS
private void readPS(java.nio.ByteBuffer buf)
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
-
-