org.mmbase.util.images
Class AbstractImageConverter
java.lang.Object
org.mmbase.util.images.AbstractImageConverter
- All Implemented Interfaces:
- ImageConverter
- Direct Known Subclasses:
- ImageMagickImageConverter, JAIImageConverter
public abstract class AbstractImageConverter
- extends Object
- implements ImageConverter
Abstract implementation of a ImageConverter. Override either convertImage(byte[], String,
List) or convertImage(InputStream, String, OutputStream, List).
- Since:
- MMBase-1.9
- Author:
- Michiel Meeuwissen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractImageConverter
public AbstractImageConverter()
init
public void init(Map<String,String> params)
- Specified by:
init in interface ImageConverter
- See Also:
ImageConverter.init(java.util.Map)
convertImage
public byte[] convertImage(byte[] input,
String sourceFormat,
List<String> commands)
- Description copied from interface:
ImageConverter
- This functions converts an image by the given parameters
- Specified by:
convertImage in interface ImageConverter
- Parameters:
input - an array of byte which represents the original imagesourceFormat - original image formatcommands - a List of Strings containing commands which are operations on the image which will be returned.
- Returns:
- an array of
bytes containing the new converted image. - See Also:
ImageConverter.convertImage(byte[], java.lang.String, java.util.List)
convertImage
public long convertImage(InputStream input,
String sourceFormat,
OutputStream out,
List<String> commands)
throws IOException
- Description copied from interface:
ImageConverter
- This functions converts an image by the given parameters
- Specified by:
convertImage in interface ImageConverter
- Parameters:
input - stream of byte which represents the original imagesourceFormat - original image formatout - stream of bytes containing the new converted image.commands - a List of Strings containing commands which are operations on the image which will be returned.
- Returns:
- number of bytes of converted image.
- Throws:
IOException - When an error occurs when converting the image- See Also:
ImageConverter.convertImage(java.io.InputStream, java.lang.String, java.io.OutputStream, java.util.List)
MMBase 2.0-SNAPSHOT - null