org.apache.batik.svggen
Class ImageHandlerBase64Encoder
public
class
ImageHandlerBase64Encoder
extends DefaultImageHandler
This implementation of ImageHandler encodes the input image as
a PNG image first, then encodes the PNG image using Base64
encoding and uses the result to encoder the image url using
the data protocol.
See Also: SVGGraphics2D ImageHandler
Method Summary |
BufferedImage | buildBufferedImage(Dimension size)
This method creates a BufferedImage with an alpha channel, as this is
supported by Base64. |
void | encodeImage(RenderedImage buf, OutputStream os) |
protected void | handleEmptyImage(Element imageElement) |
void | handleHREF(Image image, Element imageElement, SVGGeneratorContext generatorContext)
The handler should set the xlink:href tag and the width and
height attributes. |
void | handleHREF(RenderableImage image, Element imageElement, SVGGeneratorContext generatorContext)
The handler should set the xlink:href tag and the width and
height attributes. |
void | handleHREF(RenderedImage image, Element imageElement, SVGGeneratorContext generatorContext)
This version of handleHREF encodes the input image into a
PNG image whose bytes are then encoded with Base64. |
public ImageHandlerBase64Encoder()
Build an ImageHandlerBase64Encoder
instance.
public BufferedImage buildBufferedImage(Dimension size)
This method creates a BufferedImage with an alpha channel, as this is
supported by Base64.
public void encodeImage(RenderedImage buf, OutputStream os)
protected void handleEmptyImage(Element imageElement)
public void handleHREF(Image image, Element imageElement,
SVGGeneratorContext generatorContext)
The handler should set the xlink:href tag and the width and
height attributes.
public void handleHREF(RenderableImage image, Element imageElement,
SVGGeneratorContext generatorContext)
The handler should set the xlink:href tag and the width and
height attributes.
public void handleHREF(RenderedImage image, Element imageElement,
SVGGeneratorContext generatorContext)
This version of handleHREF encodes the input image into a
PNG image whose bytes are then encoded with Base64. The
resulting encoded data is used to set the url on the
input imageElement, using the data: protocol.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.