Package helma.image
Class ImageGenerator
java.lang.Object
helma.image.ImageGenerator
- Direct Known Subclasses:
ImageIOGenerator
Factory class for generating Image objects from various sources.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateImage
(byte[] src) createImage
(int w, int h) createImage
(ImageWrapper iw, BufferedImageOp imageOp) createImage
(ImageWrapper iw, ImageFilter filter) createImage
(InputStream input) createImage
(String filenamne) createImage
(URL url) static ImageGenerator
Returns an ImageGenerator singleton, creating it if necessary.read
(byte[] src) read
(InputStream input) abstract void
write
(ImageWrapper wrapper, OutputStream out, String type, float quality, boolean alpha) Saves the image.abstract void
write
(ImageWrapper wrapper, String filename, float quality, boolean alpha) Saves the image.
-
Field Details
-
generator
-
-
Constructor Details
-
ImageGenerator
public ImageGenerator()
-
-
Method Details
-
getInstance
Returns an ImageGenerator singleton, creating it if necessary. If the JIMI package is installed, an instance ofJimiGenerator
will be returned. Otherwise, if the javax.imageio package is available, an instance ofImageIOGenerator
is returned. Additionally, the class of the ImageGenerator implementation to be used can be set using theimageGenerator
property in either the app.properties or server.properties file.- Returns:
- a new ImageGenerator instance
-
createImage
- Parameters:
w
- ...h
- ...- Returns:
- ...
-
createImage
- Parameters:
src
- ...- Returns:
- ...
- Throws:
IOException
-
createImage
- Parameters:
filenamne
- ...- Returns:
- ...
- Throws:
IOException
-
createImage
- Parameters:
url
- ...- Returns:
- ...
- Throws:
MalformedURLException
IOException
-
createImage
- Parameters:
input
- ...- Returns:
- ...
- Throws:
IOException
-
createImage
- Parameters:
iw
- ...filter
- ...- Returns:
- ...
-
createImage
- Parameters:
iw
- ...imageOp
- ...- Returns:
- ...
-
read
- Parameters:
filename
- the filename of the image to create- Returns:
- the newly created image
- Throws:
IOException
-
read
- Parameters:
url
- the URL of the image to create- Returns:
- the newly created image
- Throws:
IOException
-
read
- Parameters:
src
- the data of the image to create- Returns:
- the newly created image
- Throws:
IOException
-
read
- 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
-