Class 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

    • 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.
    • Constructor Detail

      • FunctionType4

        protected FunctionType4()
        Creates a new instance of FunctionType4
    • 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 class PDFFunction
        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 class PDFFunction
        Parameters:
        inputs - an array of m input values
        outputs - an array of size n which will be filled with the output values, or null to return a new array
        inputOffset - the offset into the inputs array to read from
        outputOffset - 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)
      • 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