org.vigia.server.driver.util
Class ImageUtil

java.lang.Object
  extended by org.vigia.server.driver.util.ImageUtil

public class ImageUtil
extends java.lang.Object

This class has a set of utilities to process the images.

Author:
jrios

Constructor Summary
ImageUtil()
           
 
Method Summary
static java.awt.image.BufferedImage crop(java.awt.image.BufferedImage i, int x, int y, int w, int h)
          Crop a rectangular subimage of the image.
static java.awt.image.BufferedImage perspective(java.awt.image.BufferedImage i, int x, int y, int z)
          Changes the perspective of an image.
static java.awt.image.BufferedImage scale(java.awt.image.BufferedImage i, int w, int h)
          Scales an image to a specific resolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtil

public ImageUtil()
Method Detail

crop

public static java.awt.image.BufferedImage crop(java.awt.image.BufferedImage i,
                                                int x,
                                                int y,
                                                int w,
                                                int h)
Crop a rectangular subimage of the image.

Parameters:
i - the source image.
x - the x coordinate of the point where the crop starts.
y - the x coordinate of the point where the crop starts.
w - the width of the crop rectangle.
h - the height of the crop rectangle.
Returns:
the subimage.

scale

public static java.awt.image.BufferedImage scale(java.awt.image.BufferedImage i,
                                                 int w,
                                                 int h)
Scales an image to a specific resolution.

Parameters:
i - the source image.
w - the width of the result image.
h - the height of the result image.
Returns:
the scaled image.

perspective

public static java.awt.image.BufferedImage perspective(java.awt.image.BufferedImage i,
                                                       int x,
                                                       int y,
                                                       int z)
Changes the perspective of an image.

Parameters:
i - the source image.
x - the x coordinate of the viewer.
y - the y coordinate of the viewer.
z - the z coordinate of the viewer.
Returns:
the projection of the image.