org.mmbase.util.images
Class JAIImageConverter

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

public class JAIImageConverter
extends Object
implements ImageConverter

Converts Images using image Java Advanced Imaging

Version:
$Id: JAIImageConverter.java,v 1.3 2005/10/02 16:42:15 michiel Exp $
Author:
Daniel Ockeloen, Martijn Houtman (JAI fix)

Constructor Summary
JAIImageConverter()
           
 
Method Summary
protected static javax.media.jai.PlanarImage border(javax.media.jai.PlanarImage inImg, int xpadding, int ypadding)
          Performs the 'border' operation: Adds a border to an image using the specified horizontal and vertical padding.
 byte[] convertImage(byte[] input, String sourceFormat, List commands)
           
protected static javax.media.jai.PlanarImage crop(javax.media.jai.PlanarImage inImg, int x1, int y1, int x2, int y2)
           
protected static javax.media.jai.PlanarImage flip(javax.media.jai.PlanarImage inImg)
          Performs the 'flip' or 'flipy' operation: Flip an image across an imaginary vertical line that runs through the center of the image.
protected static javax.media.jai.PlanarImage flop(javax.media.jai.PlanarImage inImg)
          Performs the 'flop' or 'flipx' operation: Flip an image across an imaginary horizontal line that runs through the center of the image.
 void init(Map params)
           
protected static javax.media.jai.PlanarImage loadImage(String filename)
           
protected static javax.media.jai.PlanarImage negate(javax.media.jai.PlanarImage inImg)
          Performs the 'dia' or 'negate' operation.
protected static javax.media.jai.PlanarImage rotate(javax.media.jai.PlanarImage inImg, int x, int y, int a)
          Performs the 'rotate' operation: rotates an image.
protected static javax.media.jai.PlanarImage size(javax.media.jai.PlanarImage inImg, int width, int height, boolean maintainAspectRation)
          Performs the 's' or 'geometry' operation: Resize an image using specified width and height.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAIImageConverter

public JAIImageConverter()
Method Detail

init

public void init(Map params)
Specified by:
init in interface ImageConverter
Warning: No Java Documentation Available.

convertImage

public byte[] convertImage(byte[] input,
                           String sourceFormat,
                           List commands)
Specified by:
convertImage in interface ImageConverter
Warning: No Java Documentation Available.

crop

protected static javax.media.jai.PlanarImage crop(javax.media.jai.PlanarImage inImg,
                                                  int x1,
                                                  int y1,
                                                  int x2,
                                                  int y2)
Warning: No Java Documentation Available.

size

protected static javax.media.jai.PlanarImage size(javax.media.jai.PlanarImage inImg,
                                                  int width,
                                                  int height,
                                                  boolean maintainAspectRation)
Performs the 's' or 'geometry' operation: Resize an image using specified width and height.

Parameters:
inImg - the image to transform
width - new width of the image
height - new height of the image
maintainAspectRation - if true, width and height are maximums: aspect ratio is maintained
Returns:
the transformed image

negate

protected static javax.media.jai.PlanarImage negate(javax.media.jai.PlanarImage inImg)
Performs the 'dia' or 'negate' operation. Replace every pixel with its complementary color (white becomes black, yellow becomes blue, etc.)

Parameters:
inImg - the image to transform
Returns:
the transformed image

rotate

protected static javax.media.jai.PlanarImage rotate(javax.media.jai.PlanarImage inImg,
                                                    int x,
                                                    int y,
                                                    int a)
Performs the 'rotate' operation: rotates an image.

Parameters:
inImg - the image to transform
x - xposition of the rotation
y - yposition of the rotation
a - angle of the rotation
Returns:
the transformed image

border

protected static javax.media.jai.PlanarImage border(javax.media.jai.PlanarImage inImg,
                                                    int xpadding,
                                                    int ypadding)
Performs the 'border' operation: Adds a border to an image using the specified horizontal and vertical padding.

Parameters:
inImg - the image to transform
xpadding - the horizontal padding
ypadding - the vertical padding
Returns:
the transformed image

flop

protected static javax.media.jai.PlanarImage flop(javax.media.jai.PlanarImage inImg)
Performs the 'flop' or 'flipx' operation: Flip an image across an imaginary horizontal line that runs through the center of the image.

Parameters:
inImg - the image to transform
Returns:
the transformed image

flip

protected static javax.media.jai.PlanarImage flip(javax.media.jai.PlanarImage inImg)
Performs the 'flip' or 'flipy' operation: Flip an image across an imaginary vertical line that runs through the center of the image.

Parameters:
inImg - the image to transform
Returns:
the transformed image

loadImage

protected static javax.media.jai.PlanarImage loadImage(String filename)
Warning: No Java Documentation Available.


MMBase build 1.8.1.20060716