org.rhq.enterprise.gui.image
Class ImageUtil

java.lang.Object
  extended by org.rhq.enterprise.gui.image.ImageUtil

public class ImageUtil
extends Object


Constructor Summary
ImageUtil()
           
 
Method Summary
static BufferedImage convertToIndexColorImage(BufferedImage image)
          Creates a copy of an image and during the process converts the image to an indexed color image.
static BufferedImage loadImage(String path)
          Loads an image from a file on disk or in an archive (e.g., .jar).
static byte[][] scrapeColors(BufferedImage image)
          Get's all of the unique colors in an image.
 
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

convertToIndexColorImage

public static BufferedImage convertToIndexColorImage(BufferedImage image)
Creates a copy of an image and during the process converts the image to an indexed color image.

Parameters:
image - Image to convert.
Returns:
BufferedImage with an indexed color pallette

loadImage

public static BufferedImage loadImage(String path)
                               throws IOException
Loads an image from a file on disk or in an archive (e.g., .jar).

Parameters:
path - The name of the image file to load. This should be a relative path starting from anywhere in the classpath. For example, 'images/foo.gif'.
Returns:
A BufferedImage object that contains the loaded image.
Throws:
IOException

scrapeColors

public static byte[][] scrapeColors(BufferedImage image)
Get's all of the unique colors in an image.

Parameters:
image - The image.


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.