org.mmbase.util.images
Class ImageMagickImageConverter

java.lang.Object
  extended byorg.mmbase.util.images.ImageMagickImageConverter
All Implemented Interfaces:
ImageConverter

public class ImageMagickImageConverter
extends Object
implements ImageConverter

Converts images using ImageMagick.

Version:
$Id: ImageMagickImageConverter.java,v 1.4 2006/06/19 14:15:13 nklasens Exp $
Author:
Rico Jansen, Michiel Meeuwissen, Nico Klasens, Jaco de Groot

Constructor Summary
ImageMagickImageConverter()
           
 
Method Summary
protected  String color(String c)
          Translates MMBase color format (without #) to an convert color format (with or without);
 byte[] convertImage(byte[] input, String sourceFormat, List commands)
          This functions converts an image by the given parameters
 void init(Map params)
          This function initalises this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMagickImageConverter

public ImageMagickImageConverter()
Method Detail

init

public void init(Map params)
This function initalises this class

Specified by:
init in interface ImageConverter
Parameters:
params - a Map of Strings containing informationn, this should contain the key's ImageConvert.ConverterRoot and ImageConvert.ConverterCommand specifing the converter root, and it can also contain ImageConvert.DefaultImageFormat which can also be 'asis'.

convertImage

public byte[] convertImage(byte[] input,
                           String sourceFormat,
                           List commands)
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
commands - a List of Strings containing commands which are operations on the image which will be returned. ImageConvert.converterRoot and ImageConvert.converterCommand specifing the converter root....
Returns:
an array of bytes containing the new converted image.

color

protected String color(String c)
Translates MMBase color format (without #) to an convert color format (with or without);



MMBase build 1.8.1.20060716