org.jopendocument.util
Class ImageUtils

java.lang.Object
  extended by org.jopendocument.util.ImageUtils

public class ImageUtils
extends Object

Tools for Image manipulation


Constructor Summary
ImageUtils()
           
 
Method Summary
static BufferedImage createQualityResizedImage(Image orginalImage, float finalRatio, boolean applySoftFilter, Color bgColor, boolean fast)
          Create a resized Image with high quality rendering, specifying a ratio rather than pixels.
static BufferedImage createQualityResizedImage(Image orginalImage, int width, int height)
           
static BufferedImage createQualityResizedImage(Image orginalImage, int width, int height, boolean keepRatio)
           
static BufferedImage createQualityResizedImage(Image orginalImage, int width, int height, boolean applySoftFilter, boolean keepRatio, Color bgColor, boolean fast)
          Create a resized Image with high quality rendering
static BufferedImage createQualityResizedImage(Image orginalImage, int width, int height, boolean applySoftFilter, FillMode fillMode, boolean fast)
           
static BufferedImage createSmallerImage(File f, int maxWidth, int maxHeight)
           
static BufferedImage createSmallerImage(Image orginalImage, int maxWidth, int maxHeight)
          Transform the passed image so that it fits into a rectangle of maxWidth by maxHeight.
static BufferedImage getSoftFilteredImage(BufferedImage bufferedImage)
          Create an soft filtered Image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtils

public ImageUtils()
Method Detail

createSmallerImage

public static BufferedImage createSmallerImage(File f,
                                               int maxWidth,
                                               int maxHeight)
                                        throws IOException
Throws:
IOException

createSmallerImage

public static BufferedImage createSmallerImage(Image orginalImage,
                                               int maxWidth,
                                               int maxHeight)
Transform the passed image so that it fits into a rectangle of maxWidth by maxHeight.

Parameters:
orginalImage - the image to transform.
maxWidth - the maximum width of the returned image.
maxHeight - the maximum height of the returned image.
Returns:
an image that fits or null if original already fits.

createQualityResizedImage

public static BufferedImage createQualityResizedImage(Image orginalImage,
                                                      float finalRatio,
                                                      boolean applySoftFilter,
                                                      Color bgColor,
                                                      boolean fast)
Create a resized Image with high quality rendering, specifying a ratio rather than pixels.

Parameters:
orginalImage - the original Image
finalRatio - the ratio that the returned image will have.
applySoftFilter - soft filter
bgColor - the background color
fast - algorithm to use for resampling.
Returns:
the resized image of the given ratio.

createQualityResizedImage

public static BufferedImage createQualityResizedImage(Image orginalImage,
                                                      int width,
                                                      int height,
                                                      boolean applySoftFilter,
                                                      boolean keepRatio,
                                                      Color bgColor,
                                                      boolean fast)
Create a resized Image with high quality rendering

Parameters:
orginalImage - the original Image
width - the desired width
height - the desired heights
applySoftFilter - soft filter
keepRatio - true to keep the ratio
bgColor - the background color
fast - algorithm to use for resampling.
Returns:
the resized image of the given size

createQualityResizedImage

public static BufferedImage createQualityResizedImage(Image orginalImage,
                                                      int width,
                                                      int height,
                                                      boolean applySoftFilter,
                                                      FillMode fillMode,
                                                      boolean fast)

createQualityResizedImage

public static BufferedImage createQualityResizedImage(Image orginalImage,
                                                      int width,
                                                      int height)

createQualityResizedImage

public static BufferedImage createQualityResizedImage(Image orginalImage,
                                                      int width,
                                                      int height,
                                                      boolean keepRatio)

getSoftFilteredImage

public static BufferedImage getSoftFilteredImage(BufferedImage bufferedImage)
Create an soft filtered Image

Parameters:
bufferedImage - the orignial BufferedImage
Returns:
the soft filtered Image


Copyright © 2010 jOpenDocument All Rights Reserved.