Class ImageCacher

    • Constructor Detail

      • ImageCacher

        public ImageCacher()
        Creates an ImageCacher.
      • ImageCacher

        public ImageCacher​(DOMTreeManager domTreeManager)
        Creates an ImageCacher.
        Parameters:
        domTreeManager - the DOMTreeManager for the tree this cacher works on
    • Method Detail

      • setDOMTreeManager

        public void setDOMTreeManager​(DOMTreeManager domTreeManager)
        Sets the DOMTreeManager this cacher should work on.
        Parameters:
        domTreeManager - the DOMTreeManager for the tree this cacher works on
      • lookup

        public java.lang.String lookup​(java.io.ByteArrayOutputStream os,
                                       int width,
                                       int height,
                                       SVGGeneratorContext ctx)
                                throws SVGGraphics2DIOException
        Checks if the image is already in the cache, and adds it if not. Returns a unique id for the entry.
        Parameters:
        os - the image as a byte stream
        width - the width of the image
        height - the height of the image
        ctx - the SVGGeneratorContext
        Returns:
        a URI for the image
        Throws:
        SVGGraphics2DIOException - if an error occurs during image file i/o