## org.apache.batik.svggen
Interface GenericImageHandler

All Known Subinterfaces:
  CachedImageHandler

All Known Implementing Classes:
  CachedImageHandlerBase64Encoder, CachedImageHandlerJPEGEncoder, CachedImageHandlerPNGEncoder, DefaultCachedImageHandler, SimpleImageHandler

    public interface GenericImageHandler

Extends the default ImageHandler interface with calls to allow caching of raster images in generated SVG content.

Method Summary
`org.w3c.dom.Element` `createElement(SVGGeneratorContext generatorContext)` Creates an Element suitable for referring to images.
`java.awt.geom.AffineTransform` `handleImage(java.awt.Image image, org.w3c.dom.Element imageElement, int x, int y, int width, int height, SVGGeneratorContext generatorContext)` The handler should set the xlink:href and return a transform
`java.awt.geom.AffineTransform` `handleImage(java.awt.image.renderable.RenderableImage image, org.w3c.dom.Element imageElement, double x, double y, double width, double height, SVGGeneratorContext generatorContext)` The handler should set the xlink:href tag and return a transform
`java.awt.geom.AffineTransform` `handleImage(java.awt.image.RenderedImage image, org.w3c.dom.Element imageElement, int x, int y, int width, int height, SVGGeneratorContext generatorContext)` The handler should set the xlink:href tag and return a transform
`void` `setDOMTreeManager(DOMTreeManager domTreeManager)` Sets the DomTreeManager this image handler may need to interact with.

Method Detail

### setDOMTreeManager

    void setDOMTreeManager(DOMTreeManager domTreeManager)

  Sets the DomTreeManager this image handler may need to interact with.

### createElement

    org.w3c.dom.Element createElement(SVGGeneratorContext generatorContext)

  Creates an Element suitable for referring to images. Note that no assumptions can be made about the name of this Element.

### handleImage

    java.awt.geom.AffineTransform handleImage(java.awt.Image image,
                                              org.w3c.dom.Element imageElement,
                                              int x,
                                              int y,
                                              int width,
                                              int height,
                                              SVGGeneratorContext generatorContext)

  The handler should set the xlink:href and return a transform

  Parameters:
    `image` - the image under consideration
    `imageElement` - the DOM Element for this image
    `x` - x coordinate
    `y` - y coordinate
    `width` - width for rendering
    `height` - height for rendering
    `generatorContext` - the SVGGeneratorContext
  Returns:
    transform converting the image dimension to rendered dimension

### handleImage

    java.awt.geom.AffineTransform handleImage(java.awt.image.RenderedImage image,
                                              org.w3c.dom.Element imageElement,
                                              int x,
                                              int y,
                                              int width,
                                              int height,
                                              SVGGeneratorContext generatorContext)

  The handler should set the xlink:href tag and return a transform

  Parameters:
    `image` - the image under consideration
    `imageElement` - the DOM Element for this image
    `x` - x coordinate
    `y` - y coordinate
    `width` - width for rendering
    `height` - height for rendering
    `generatorContext` - the SVGGeneratorContext
  Returns:
    transform converting the image dimension to rendered dimension

### handleImage

    java.awt.geom.AffineTransform handleImage(java.awt.image.renderable.RenderableImage image,
                                              org.w3c.dom.Element imageElement,
                                              double x,
                                              double y,
                                              double width,
                                              double height,
                                              SVGGeneratorContext generatorContext)

  The handler should set the xlink:href tag and return a transform

  Parameters:
    `image` - the image under consideration
    `imageElement` - the DOM Element for this image
    `x` - x coordinate
    `y` - y coordinate
    `width` - width for rendering
    `height` - height for rendering
    `generatorContext` - the SVGGeneratorContext
  Returns:
    transform converting the image dimension to rendered dimension

Copyright © 2008 Apache Software Foundation. All Rights Reserved.