Package helma.image

Class ImageGenerator

java.lang.Object
helma.image.ImageGenerator
Direct Known Subclasses:
ImageIOGenerator

public abstract class ImageGenerator extends Object
Factory class for generating Image objects from various sources.
  • Field Details

  • Constructor Details

    • ImageGenerator

      public ImageGenerator()
  • Method Details

    • getInstance

      public static ImageGenerator getInstance()
      Returns an ImageGenerator singleton, creating it if necessary. If the JIMI package is installed, an instance of
      invalid reference
      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 IOException
      Parameters:
      src - ...
      Returns:
      ...
      Throws:
      IOException
    • createImage

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

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

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

      public ImageWrapper createImage(ImageWrapper iw, ImageFilter filter)
      Parameters:
      iw - ...
      filter - ...
      Returns:
      ...
    • createImage

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

      public Image read(String filename) throws IOException
      Parameters:
      filename - the filename of the image to create
      Returns:
      the newly created image
      Throws:
      IOException
    • read

      public Image read(URL url) throws IOException
      Parameters:
      url - the URL of the image to create
      Returns:
      the newly created image
      Throws:
      IOException
    • read

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

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

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

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