Class ImageFormGenerator

java.lang.Object
org.apache.xmlgraphics.ps.FormGenerator
org.apache.xmlgraphics.ps.ImageFormGenerator

public class ImageFormGenerator extends FormGenerator
Abstract helper class for generating PostScript forms.
  • Constructor Details

    • ImageFormGenerator

      public ImageFormGenerator(String formName, String title, Dimension2D dimensions, RenderedImage image, boolean invertImage)
      Main constructor.
      Parameters:
      formName - the form's name
      title - the form's title or null
      dimensions - the form's dimensions in units (usually points)
      image - the image
      invertImage - true if the image shall be inverted
    • ImageFormGenerator

      public ImageFormGenerator(String formName, String title, Dimension2D dimensions, Dimension dimensionsPx, ImageEncoder encoder, ColorSpace colorSpace, int bitsPerComponent, boolean invertImage)
      Main constructor.
      Parameters:
      formName - the form's name
      title - the form's title or null
      dimensions - the form's dimensions in units (usually points)
      dimensionsPx - the form's dimensions in pixels
      encoder - the image encoder
      colorSpace - the target color space
      bitsPerComponent - the bits per component
      invertImage - true if the image shall be inverted
    • ImageFormGenerator

      public ImageFormGenerator(String formName, String title, Dimension2D dimensions, Dimension dimensionsPx, ImageEncoder encoder, ColorSpace colorSpace, boolean invertImage)
      Main constructor.
      Parameters:
      formName - the form's name
      title - the form's title or null
      dimensions - the form's dimensions in units (usually points)
      dimensionsPx - the form's dimensions in pixels
      encoder - the image encoder
      colorSpace - the target color space
      invertImage - true if the image shall be inverted
  • Method Details

    • getDataName

      protected String getDataName()
      Returns the name of the data segment associated with this image form.
      Returns:
      the data segment name
    • generatePaintProc

      protected void generatePaintProc(PSGenerator gen) throws IOException
      Generates the PostScript code for the PaintProc of the form.
      Specified by:
      generatePaintProc in class FormGenerator
      Parameters:
      gen - the PostScript generator
      Throws:
      IOException - if an I/O error occurs
    • generateAdditionalDataStream

      protected void generateAdditionalDataStream(PSGenerator gen) throws IOException
      Generates some PostScript code right after the form definition (used primarily for bitmap data).
      Overrides:
      generateAdditionalDataStream in class FormGenerator
      Parameters:
      gen - the PostScript generator
      Throws:
      IOException - if an I/O error occurs