de.beamertool.viewer.gui
Class ImageOperations

java.lang.Object
  extended by de.beamertool.viewer.gui.ImageOperations

public class ImageOperations
extends Object

Author:
ocm-zeeman

Constructor Summary
ImageOperations()
           
 
Method Summary
static BufferedImage rescaleImage(BufferedImage source, Dimension targetSize)
           
static BufferedImage resizeImage(BufferedImage source, Dimension maxSize)
          Calculates and resizes the given source-image to the given dimension.
static BufferedImage scaleImage(BufferedImage source, double factorxy)
           
static BufferedImage scaleImage(BufferedImage source, double factorx, double factory)
          Resizes the given image by the given factor
static BufferedImage squareImage(BufferedImage source, Color fillColor)
          Makes a image square.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageOperations

public ImageOperations()
Method Detail

rescaleImage

public static BufferedImage rescaleImage(BufferedImage source,
                                         Dimension targetSize)

resizeImage

public static BufferedImage resizeImage(BufferedImage source,
                                        Dimension maxSize)
Calculates and resizes the given source-image to the given dimension. This resultimg image won't be bigger as the given dimension

Parameters:
source - - the sourceimage
maxSize - - the desired size of the image
Returns:
the resized image
See Also:
scaleImage(BufferedImage, double)

scaleImage

public static BufferedImage scaleImage(BufferedImage source,
                                       double factorxy)

scaleImage

public static BufferedImage scaleImage(BufferedImage source,
                                       double factorx,
                                       double factory)
Resizes the given image by the given factor

Parameters:
source - - the source image
factorx - - the factor for resizing along the x-axis
factory - - the factor for resizing along the y-axis
Returns:
- the resized image or source if factor is zero

squareImage

public static BufferedImage squareImage(BufferedImage source,
                                        Color fillColor)
Makes a image square.
The maximum dimension (width or height) is taken as maximum. The borders are filled with fillColor.

Parameters:
source - - image to make square
fillColor - - color to fill new borders
Returns:
squared image