com.jhlabs.image
Class ImageUtils

java.lang.Object
  extended by com.jhlabs.image.ImageUtils

public abstract class ImageUtils
extends java.lang.Object


Field Summary
static java.awt.image.BufferedImage backgroundImage
           
static int SELECTED
           
static int UNSELECTED
           
 
Constructor Summary
ImageUtils()
           
 
Method Summary
static java.awt.image.BufferedImage cloneImage(java.awt.image.BufferedImage image)
           
static void composeThroughMask(java.awt.image.Raster src, java.awt.image.WritableRaster dst, java.awt.image.Raster sel)
          Compose src onto dst using the alpha of sel to interpolate between the two.
static java.awt.image.BufferedImage convertImageToARGB(java.awt.Image image)
          Convert an Image into a TYPE_INT_ARGB BufferedImage.
static java.awt.image.BufferedImage createImage(java.awt.image.ImageProducer producer)
           
static int[] getRGB(java.awt.image.BufferedImage image, int x, int y, int width, int height, int[] pixels)
          A convenience method for getting ARGB pixels from an image.
static java.awt.Rectangle getSelectedBounds(java.awt.image.BufferedImage p)
           
static java.awt.image.BufferedImage getSubimage(java.awt.image.BufferedImage image, int x, int y, int w, int h)
           
static void paintCheckedBackground(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
static void setRGB(java.awt.image.BufferedImage image, int x, int y, int width, int height, int[] pixels)
          A convenience method for setting ARGB pixels in an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTED

public static final int SELECTED
See Also:
Constant Field Values

UNSELECTED

public static final int UNSELECTED
See Also:
Constant Field Values

backgroundImage

public static java.awt.image.BufferedImage backgroundImage
Constructor Detail

ImageUtils

public ImageUtils()
Method Detail

createImage

public static java.awt.image.BufferedImage createImage(java.awt.image.ImageProducer producer)

convertImageToARGB

public static java.awt.image.BufferedImage convertImageToARGB(java.awt.Image image)
Convert an Image into a TYPE_INT_ARGB BufferedImage. If the image is already of this type, the original image is returned unchanged.


getSubimage

public static java.awt.image.BufferedImage getSubimage(java.awt.image.BufferedImage image,
                                                       int x,
                                                       int y,
                                                       int w,
                                                       int h)

cloneImage

public static java.awt.image.BufferedImage cloneImage(java.awt.image.BufferedImage image)

paintCheckedBackground

public static void paintCheckedBackground(java.awt.Component c,
                                          java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int width,
                                          int height)

getSelectedBounds

public static java.awt.Rectangle getSelectedBounds(java.awt.image.BufferedImage p)

composeThroughMask

public static void composeThroughMask(java.awt.image.Raster src,
                                      java.awt.image.WritableRaster dst,
                                      java.awt.image.Raster sel)
Compose src onto dst using the alpha of sel to interpolate between the two. I can't think of a way to do this using AlphaComposite.


getRGB

public static int[] getRGB(java.awt.image.BufferedImage image,
                           int x,
                           int y,
                           int width,
                           int height,
                           int[] pixels)
A convenience method for getting ARGB pixels from an image. This tries to avoid the performance penalty of BufferedImage.getRGB unmanaging the image.


setRGB

public static void setRGB(java.awt.image.BufferedImage image,
                          int x,
                          int y,
                          int width,
                          int height,
                          int[] pixels)
A convenience method for setting ARGB pixels in an image. This tries to avoid the performance penalty of BufferedImage.setRGB unmanaging the image.