org.mmbase.util.images
Class AbstractImageConverter

java.lang.Object
  extended by 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

Constructor Summary
AbstractImageConverter()
           
 
Method Summary
 byte[] convertImage(byte[] input, String sourceFormat, List<String> commands)
          This functions converts an image by the given parameters
 long convertImage(InputStream input, String sourceFormat, OutputStream out, List<String> commands)
          This functions converts an image by the given parameters
 void init(Map<String,String> params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractImageConverter

public AbstractImageConverter()
Method Detail

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 image
sourceFormat - original image format
commands - 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 image
sourceFormat - original image format
out - 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