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) class
FunctionType4.Expression
(package private) class
FunctionType4.Operation
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashSet<FunctionType4.Operation>
operationSet
the set of all Operations we support.private java.util.LinkedList<java.lang.Object>
stack
the stack of operations.private java.util.LinkedList
tokens
the 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 protected
FunctionType4()
Creates a new instance of FunctionType4
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doFunction(float[] inputs, int inputOffset, float[] outputs, int outputOffset)
Map from m input values to n output values.private void
initOperations()
Initialize the operations that we can perform.protected void
parse(PDFObject obj)
Read the function information from a PDF Objectprivate boolean
popBoolean()
private double
popDouble()
private FunctionType4.Expression
popExpression()
private long
popLong()
private java.lang.Object
popObject()
private void
pushBoolean(boolean arg)
private void
pushDouble(double arg)
private void
pushExpression(FunctionType4.Expression expresson)
private void
pushLong(long arg)
private void
pushObject(java.lang.Object obj)
private void
readPS(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:
parse
in 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:
doFunction
in 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
-
-