Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.image
Class ImageUtilities

java.lang.Object
  extended by org.bounce.image.ImageUtilities

public class ImageUtilities
extends java.lang.Object

A class with utility methods for the images.

Version:
$Revision: 1.5 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
ImageUtilities()
           
 
Method Summary
static javax.swing.ImageIcon createBlueImage(javax.swing.ImageIcon image)
          Creates a blue version of the image supplied.
static javax.swing.ImageIcon createBrighterImage(javax.swing.ImageIcon image)
          Creates a 30% brighter version of the image supplied.
static javax.swing.ImageIcon createCyanImage(javax.swing.ImageIcon image)
          Creates a cyan version of the image supplied.
static javax.swing.ImageIcon createDarkerImage(javax.swing.ImageIcon image)
          Creates a 30% darker version of the image supplied.
static javax.swing.ImageIcon createGrayImage(javax.swing.ImageIcon image)
          Creates a gray version of the image supplied.
static javax.swing.ImageIcon createGreenImage(javax.swing.ImageIcon image)
          Creates a green version of the image supplied.
static javax.swing.ImageIcon createMagentaImage(javax.swing.ImageIcon image)
          Creates a magenta version of the image supplied.
static javax.swing.ImageIcon createRedImage(javax.swing.ImageIcon image)
          Creates a red version of the image supplied.
static javax.swing.ImageIcon createSilhouetteImage(javax.swing.ImageIcon image, java.awt.Color color)
          Creates a silhouette version of the image supplied, in the supplied color.
static javax.swing.ImageIcon createYellowImage(javax.swing.ImageIcon image)
          Creates a yellow version of the image supplied.
static javax.swing.ImageIcon filter(javax.swing.ImageIcon image, java.awt.image.RGBImageFilter filter)
          Utility method that filters the image.
static java.awt.Image iconToImage(javax.swing.Icon icon)
          Converts an Icon to an Image.
static javax.swing.Icon resize(javax.swing.Icon icon, int width, int height)
          Resizes an icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtilities

public ImageUtilities()
Method Detail

createDarkerImage

public static javax.swing.ImageIcon createDarkerImage(javax.swing.ImageIcon image)
Creates a 30% darker version of the image supplied.

Parameters:
image - the image to be darkened.
Returns:
the darker image.

createBrighterImage

public static javax.swing.ImageIcon createBrighterImage(javax.swing.ImageIcon image)
Creates a 30% brighter version of the image supplied.

Parameters:
image - the image to be brightened.
Returns:
the brighter image.

createGrayImage

public static javax.swing.ImageIcon createGrayImage(javax.swing.ImageIcon image)
Creates a gray version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createRedImage

public static javax.swing.ImageIcon createRedImage(javax.swing.ImageIcon image)
Creates a red version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createGreenImage

public static javax.swing.ImageIcon createGreenImage(javax.swing.ImageIcon image)
Creates a green version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createBlueImage

public static javax.swing.ImageIcon createBlueImage(javax.swing.ImageIcon image)
Creates a blue version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createCyanImage

public static javax.swing.ImageIcon createCyanImage(javax.swing.ImageIcon image)
Creates a cyan version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createMagentaImage

public static javax.swing.ImageIcon createMagentaImage(javax.swing.ImageIcon image)
Creates a magenta version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createYellowImage

public static javax.swing.ImageIcon createYellowImage(javax.swing.ImageIcon image)
Creates a yellow version of the image supplied.

Parameters:
image - the image to be filtered.
Returns:
the filtered image.

createSilhouetteImage

public static javax.swing.ImageIcon createSilhouetteImage(javax.swing.ImageIcon image,
                                                          java.awt.Color color)
Creates a silhouette version of the image supplied, in the supplied color.

Parameters:
image - the image to be filtered.
color - the color of the filtered image.
Returns:
the filtered image.

filter

public static javax.swing.ImageIcon filter(javax.swing.ImageIcon image,
                                           java.awt.image.RGBImageFilter filter)
Utility method that filters the image.

Parameters:
image - the image to be filtered.
filter - the filter to be used.
Returns:
the filtered image.

iconToImage

public static java.awt.Image iconToImage(javax.swing.Icon icon)
Converts an Icon to an Image.

Parameters:
icon - the icon to convert.
Returns:
image the converted icon.

resize

public static javax.swing.Icon resize(javax.swing.Icon icon,
                                      int width,
                                      int height)
Resizes an icon.

Parameters:
icon - the icon to resize.
width - the width of the icon or 0 or smaller when the width should be relative to the size of the icon and the provided height. Not both height and width can be smaller than 0.
height - the height of the icon or 0 or smaller when the height should be relative to the size of the icon and the provided width. Not both height and width can be smaller than 0.
Returns:
the resized icon.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.