org.mmbase.module.builders
Class ConvertJAI
java.lang.Object
|
+--org.mmbase.module.builders.ConvertJAI
- All Implemented Interfaces:
- ImageConvertInterface
- public class ConvertJAI
- extends java.lang.Object
- implements ImageConvertInterface
Converts Images using image Java Advanced Imaging
- Version:
- $Id: ConvertJAI.java,v 1.8 2002/04/12 08:39:55 pierre Exp $
- Author:
- Daniel Ockeloen
|
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,
java.util.List commands)
|
byte[] |
ConvertImage(byte[] input,
java.util.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. |
protected java.lang.String |
getAlias(java.lang.String a)
MMBase has some abreviations to convert commands, like 's' for 'geometry'. |
protected static float |
getDeg2Rad(float deg)
|
protected int |
getOneInt(java.lang.String cmd)
|
void |
init(java.util.Map params)
|
protected static javax.media.jai.PlanarImage |
loadImage(java.lang.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 |
defaultImageFormat
protected java.lang.String defaultImageFormat
- The default image format.
ConvertJAI
public ConvertJAI()
init
public void init(java.util.Map params)
- Specified by:
init in interface ImageConvertInterface
ConvertImage
public byte[] ConvertImage(byte[] input,
java.util.List commands)
- Specified by:
ConvertImage in interface ImageConvertInterface
convertImage
public byte[] convertImage(byte[] input,
java.util.List commands)
- Specified by:
convertImage in interface ImageConvertInterface
getAlias
protected java.lang.String getAlias(java.lang.String a)
- MMBase has some abreviations to convert commands, like 's' for 'geometry'. These are treated here.
- Parameters:
a - alias- Returns:
- actual convert parameter name for alias.
crop
protected static javax.media.jai.PlanarImage crop(javax.media.jai.PlanarImage inImg,
int x1,
int y1,
int x2,
int y2)
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:
the - image to transformwidth - new width of the imageheight - new height of the imagemaintainAspectRation - 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:
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:
the - image to transformx - xposition of the rotationy - yposition of the rotationa - 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:
the - image to transformxpadding - the horizontal paddingypadding - 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:
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:
the - image to transform- Returns:
- the transformed image
loadImage
protected static javax.media.jai.PlanarImage loadImage(java.lang.String filename)
getDeg2Rad
protected static float getDeg2Rad(float deg)
getOneInt
protected int getOneInt(java.lang.String cmd)
MMBase build 1.6.5.20030923