Class PDFFunction

java.lang.Object
org.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFFunction
All Implemented Interfaces:
PDFWritable

public class PDFFunction extends PDFObject
class representing a PDF Function. PDF Functions represent parameterized mathematical formulas and sampled representations with arbitrary resolution. Functions are used in two areas: device-dependent rasterization information for halftoning and transfer functions, and color specification for smooth shading (a PDF 1.3 feature). All PDF Functions have a FunctionType (0,2,3, or 4), a Domain, and a Range.
  • Constructor Details

    • PDFFunction

      public PDFFunction(List<Double> domain, List<Double> range, float[] cZero, float[] cOne, double interpolationExponentN)
      create an complete Function object of Type 2, an Exponential Interpolation function. Use null for an optional object parameter if you choose not to use it. For optional int parameters, pass the default.
      Parameters:
      domain - List objects of Double objects. This is the domain of the function. See page 264 of the PDF 1.3 Spec.
      range - List of Doubles that is the Range of the function. See page 264 of the PDF 1.3 Spec.
      cZero - This is a vector of Double objects which defines the function result when x=0. This attribute is optional. It's described on page 268 of the PDF 1.3 spec.
      cOne - This is a vector of Double objects which defines the function result when x=1. This attribute is optional. It's described on page 268 of the PDF 1.3 spec.
      interpolationExponentN - This is the inerpolation exponent. This attribute is required. PDF Spec page 268
    • PDFFunction

      public PDFFunction(Function function)
    • PDFFunction

      public PDFFunction(Function function, List<PDFFunction> pdfFunctions)
  • Method Details

    • getFunction

      public Function getFunction()
    • toPDF

      public byte[] toPDF()
      represent as PDF. Whatever the FunctionType is, the correct representation spits out. The sets of required and optional attributes are different for each type, but if a required attribute's object was constructed as null, then no error is raised. Instead, the malformed PDF that was requested by the construction is dutifully output. This policy should be reviewed.
      Overrides:
      toPDF in class PDFObject
      Returns:
      the PDF string.
    • toByteString

      public byte[] toByteString()
    • contentEquals

      protected boolean contentEquals(PDFObject obj)
      Check if the other PDFObject has the same content as the current object.

      Note: This function has a contract which is less binding than Object.equals(Object). Whereas equals would require all values to be identical, this method is not required to check everything. In the case of PDFObjects, this means that the overriding function does not have to check for PDFObject.getObjectID().

      Overrides:
      contentEquals in class PDFObject
      Parameters:
      obj - object to compare to.
      Returns:
      true if the other object has the same content.