Class AbstractImageHandlerEncoder

    • Field Detail

      • IDENTITY

        private static final java.awt.geom.AffineTransform IDENTITY
      • imageDir

        private java.lang.String imageDir
        Directory where all images are placed
      • urlRoot

        private java.lang.String urlRoot
        Value for the url root corresponding to the directory
      • createGraphics

        private static java.lang.reflect.Method createGraphics
      • initDone

        private static boolean initDone
      • paramc

        private static final java.lang.Class[] paramc
      • paramo

        private static java.lang.Object[] paramo
    • Constructor Detail

      • AbstractImageHandlerEncoder

        public AbstractImageHandlerEncoder​(java.lang.String imageDir,
                                           java.lang.String urlRoot)
                                    throws SVGGraphics2DIOException
        Parameters:
        imageDir - directory where this handler should generate images. If null, an SVGGraphics2DRuntimeException is thrown.
        urlRoot - root for the urls that point to images created by this image handler. If null, then the url corresponding to imageDir is used.
        Throws:
        SVGGraphics2DIOException
    • Method Detail

      • createGraphics

        private static java.awt.Graphics2D createGraphics​(java.awt.image.BufferedImage buf)
        This method creates a Graphics2D from a BufferedImage. If Batik extensions to AWT are in the CLASSPATH it uses them, otherwise, it uses the regular AWT method.
      • getSuffix

        public abstract java.lang.String getSuffix()
        Returns:
        the suffix used by this encoder. E.g., ".jpg" for ImageHandlerJPEGEncoder
      • getPrefix

        public abstract java.lang.String getPrefix()
        Returns:
        the prefix used by this encoder. E.g., "jpegImage" for ImageHandlerJPEGEncoder
      • encodeImage

        public abstract void encodeImage​(java.awt.image.BufferedImage buf,
                                         java.io.File imageFile)
                                  throws SVGGraphics2DIOException
        Derived classes should implement this method and encode the input BufferedImage as needed
        Throws:
        SVGGraphics2DIOException
      • buildBufferedImage

        public abstract java.awt.image.BufferedImage buildBufferedImage​(java.awt.Dimension size)
        This method creates a BufferedImage of the right size and type for the derived class.