|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jhlabs.image.ImageUtils
public abstract class ImageUtils
A class containing some static utility methods for dealing with BufferedImages.
Constructor Summary | |
---|---|
ImageUtils()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
cloneImage(java.awt.image.BufferedImage image)
Clones a BufferedImage. |
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)
Cretae a BufferedImage from an ImageProducer. |
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)
Calculates the bounds of the non-transparent parts of the given image. |
static java.awt.image.BufferedImage |
getSubimage(java.awt.image.BufferedImage image,
int x,
int y,
int w,
int h)
Returns a *copy* of a subimage of image. |
static void |
paintCheckedBackground(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paint a check pattern, used for a background to indicate image transparency. |
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 |
Constructor Detail |
---|
public ImageUtils()
Method Detail |
---|
public static java.awt.image.BufferedImage createImage(java.awt.image.ImageProducer producer)
producer
- the ImageProducer
public static java.awt.image.BufferedImage convertImageToARGB(java.awt.Image image)
image
- the image to convert
public static java.awt.image.BufferedImage getSubimage(java.awt.image.BufferedImage image, int x, int y, int w, int h)
image
- the imagex
- the x positiony
- the y positionw
- the widthh
- the height
public static java.awt.image.BufferedImage cloneImage(java.awt.image.BufferedImage image)
image
- the image to clone
public static void paintCheckedBackground(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
c
- the component to draw intog
- the Graphics objectsx
- the x positiony
- the y positionwidth
- the widthheight
- the heightpublic static java.awt.Rectangle getSelectedBounds(java.awt.image.BufferedImage p)
p
- the image
public static void composeThroughMask(java.awt.image.Raster src, java.awt.image.WritableRaster dst, java.awt.image.Raster sel)
src
- the source rasterdst
- the destination rastersel
- the mask rasterpublic static int[] getRGB(java.awt.image.BufferedImage image, int x, int y, int width, int height, int[] pixels)
image
- a BufferedImage objectx
- the left edge of the pixel blocky
- the right edge of the pixel blockwidth
- the width of the pixel arryheight
- the height of the pixel arrypixels
- the array to hold the returned pixels. May be null.
setRGB(java.awt.image.BufferedImage, int, int, int, int, int[])
public static void setRGB(java.awt.image.BufferedImage image, int x, int y, int width, int height, int[] pixels)
image
- a BufferedImage objectx
- the left edge of the pixel blocky
- the right edge of the pixel blockwidth
- the width of the pixel arryheight
- the height of the pixel arrypixels
- the array of pixels to setgetRGB(java.awt.image.BufferedImage, int, int, int, int, int[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |