Package com.jhlabs.image
Class ImageUtils
- java.lang.Object
-
- com.jhlabs.image.ImageUtils
-
public abstract class ImageUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.image.BufferedImagebackgroundImagestatic intSELECTEDstatic intUNSELECTED
-
Constructor Summary
Constructors Constructor Description ImageUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.image.BufferedImagecloneImage(java.awt.image.BufferedImage image)static voidcomposeThroughMask(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.BufferedImageconvertImageToARGB(java.awt.Image image)Convert an Image into a TYPE_INT_ARGB BufferedImage.static java.awt.image.BufferedImagecreateImage(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.RectanglegetSelectedBounds(java.awt.image.BufferedImage p)static java.awt.image.BufferedImagegetSubimage(java.awt.image.BufferedImage image, int x, int y, int w, int h)static voidpaintCheckedBackground(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)static voidsetRGB(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.
-
-
-
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
-
-
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.
-
-