Class TIFFRenderer

  • All Implemented Interfaces:
    java.awt.print.Printable, Constants, Renderer

    public class TIFFRenderer
    extends Java2DRenderer

    This class represents renderer to TIFF (Tagged Image File Format) format. It is one of the most popular and flexible of the current public domain raster file formats, which was is primarily designed for raster data interchange. Supported compression types are:

    • Raw noncompressed data
    • Byte-oriented run-length encoding "PackBits" compression.
    • Modified Huffman Compression (CCITT Group 3 1D facsimile compression)
    • CCITT T.4 bilevel compression (CCITT Group 3 2D facsimile compression)
    • CCITT T.6 bilevel compression (CCITT Group 4 facsimile compression)
    • JPEG-in-TIFF compression
    • DEFLATE lossless compression (also known as "Zip-in-TIFF")
    • LZW compression
    This class actually does not render itself, instead it extends org.apache.fop.render.java2D.Java2DRenderer and just encode rendering results into TIFF format using Batik's image codec
    • Field Detail

      • outputStream

        private java.io.OutputStream outputStream
    • Constructor Detail

      • TIFFRenderer

        public TIFFRenderer​(FOUserAgent userAgent)
        Creates TIFF renderer.
        Parameters:
        userAgent - the user agent that contains configuration details. This cannot be null.
    • Method Detail

      • getMimeType

        public java.lang.String getMimeType()
        Get the MIME type of the renderer.
        Returns:
        The MIME type of the renderer, may return null if not applicable.
      • startRenderer

        public void startRenderer​(java.io.OutputStream outputStream)
                           throws java.io.IOException
        Initiates the rendering phase. This must only be called once for a rendering. If stopRenderer is called then this may be called again for a new document rendering.
        Specified by:
        startRenderer in interface Renderer
        Overrides:
        startRenderer in class Java2DRenderer
        Parameters:
        outputStream - The OutputStream to use for output
        Throws:
        java.io.IOException - If an I/O error occurs
      • stopRenderer

        public void stopRenderer()
                          throws java.io.IOException
        Signals the end of the rendering phase. The renderer should reset to an initial state and dispose of any resources for the completed rendering.
        Specified by:
        stopRenderer in interface Renderer
        Overrides:
        stopRenderer in class Java2DRenderer
        Throws:
        java.io.IOException - If an I/O error occurs
      • getBufferedImage

        protected java.awt.image.BufferedImage getBufferedImage​(int bitmapWidth,
                                                                int bitmapHeight)
        Returns a specific BufferedImage to paint a page image on. This method can be overridden in subclasses to produce different image formats (ex. grayscale or b/w).
        Overrides:
        getBufferedImage in class Java2DRenderer
        Parameters:
        bitmapWidth - width of the image in pixels
        bitmapHeight - heigth of the image in pixels
        Returns:
        the newly created BufferedImage
      • setBufferedImageType

        public void setBufferedImageType​(int bufferedImageType)
        Parameters:
        bufferedImageType - an image type
      • getRenderingSettings

        public BitmapRenderingSettings getRenderingSettings()
        Returns the settings for the image rendering.
        Returns:
        the image rendering settings