Class AbstractImageHandlerEncoder

    • 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

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