Package helma.image

Class ImageGenerator

  • Direct Known Subclasses:
    ImageIOGenerator

    public abstract class ImageGenerator
    extends java.lang.Object
    Factory class for generating Image objects from various sources.
    • Constructor Detail

      • ImageGenerator

        public ImageGenerator()
    • Method Detail

      • getInstance

        public static ImageGenerator getInstance()
        Returns an ImageGenerator singleton, creating it if necessary. If the JIMI package is installed, an instance of JimiGenerator will be returned. Otherwise, if the javax.imageio package is available, an instance of ImageIOGenerator is returned. Additionally, the class of the ImageGenerator implementation to be used can be set using the imageGenerator property in either the app.properties or server.properties file.
        Returns:
        a new ImageGenerator instance
      • createImage

        public ImageWrapper createImage​(int w,
                                        int h)
        Parameters:
        w - ...
        h - ...
        Returns:
        ...
      • createImage

        public ImageWrapper createImage​(byte[] src)
                                 throws java.io.IOException
        Parameters:
        src - ...
        Returns:
        ...
        Throws:
        java.io.IOException
      • createImage

        public ImageWrapper createImage​(java.lang.String filenamne)
                                 throws java.io.IOException
        Parameters:
        filenamne - ...
        Returns:
        ...
        Throws:
        java.io.IOException
      • createImage

        public ImageWrapper createImage​(java.net.URL url)
                                 throws java.net.MalformedURLException,
                                        java.io.IOException
        Parameters:
        url - ...
        Returns:
        ...
        Throws:
        java.net.MalformedURLException
        java.io.IOException
      • createImage

        public ImageWrapper createImage​(java.io.InputStream input)
                                 throws java.io.IOException
        Parameters:
        input - ...
        Returns:
        ...
        Throws:
        java.io.IOException
      • createImage

        public ImageWrapper createImage​(ImageWrapper iw,
                                        java.awt.image.ImageFilter filter)
        Parameters:
        iw - ...
        filter - ...
        Returns:
        ...
      • createImage

        public ImageWrapper createImage​(ImageWrapper iw,
                                        java.awt.image.BufferedImageOp imageOp)
        Parameters:
        iw - ...
        imageOp - ...
        Returns:
        ...
      • read

        public java.awt.Image read​(java.lang.String filename)
                            throws java.io.IOException
        Parameters:
        filename - the filename of the image to create
        Returns:
        the newly created image
        Throws:
        java.io.IOException
      • read

        public java.awt.Image read​(java.net.URL url)
                            throws java.io.IOException
        Parameters:
        url - the URL of the image to create
        Returns:
        the newly created image
        Throws:
        java.io.IOException
      • read

        public java.awt.Image read​(byte[] src)
                            throws java.io.IOException
        Parameters:
        src - the data of the image to create
        Returns:
        the newly created image
        Throws:
        java.io.IOException
      • read

        public java.awt.Image read​(java.io.InputStream input)
                            throws java.io.IOException
        Parameters:
        input - the data of the image to create
        Returns:
        the newly created image
        Throws:
        java.io.IOException
      • write

        public abstract void write​(ImageWrapper wrapper,
                                   java.lang.String filename,
                                   float quality,
                                   boolean alpha)
                            throws java.io.IOException
        Saves the image. Image format is deduced from filename.
        Parameters:
        wrapper -
        filename -
        quality -
        alpha -
        Throws:
        java.io.IOException
      • write

        public abstract void write​(ImageWrapper wrapper,
                                   java.io.OutputStream out,
                                   java.lang.String type,
                                   float quality,
                                   boolean alpha)
                            throws java.io.IOException
        Saves the image. Image format is deduced from the dataSource.
        Parameters:
        wrapper -
        out -
        quality -
        alpha -
        Throws:
        java.io.IOException