de.beamertool.viewer.gui
Class ImageOperations
java.lang.Object
de.beamertool.viewer.gui.ImageOperations
public class ImageOperations
- extends Object
- Author:
- ocm-zeeman
ImageOperations
public ImageOperations()
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 sourceimagemaxSize - - 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 imagefactorx - -
the factor for resizing along the x-axisfactory - -
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 squarefillColor - - color to fill new borders
- Returns:
- squared image