|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.image.ImageUtil
public class ImageUtil
Image related utility functions.
| Nested Class Summary | |
|---|---|
static interface |
ImageUtil.ImageCreator
|
| Field Summary | |
|---|---|
protected static GraphicsConfiguration |
_gc
The graphics configuration for the default screen device. |
protected static int |
RGB_MASK
Used when outlining. |
protected static int |
TRANS_MASK
Used when seeking fully transparent pixels for outlining. |
| Constructor Summary | |
|---|---|
ImageUtil()
|
|
| Method Summary | |
|---|---|
protected static boolean |
bordersNonTransparentPixel(BufferedImage data,
int wid,
int hei,
boolean[] traced,
int x,
int y)
Returns whether the given pixel is bordered by any non-transparent pixel. |
static BufferedImage |
composeMaskedImage(ImageUtil.ImageCreator isrc,
BufferedImage mask,
BufferedImage base)
Create an image using the alpha channel from the first and the RGB values from the second. |
static BufferedImage |
composeMaskedImage(ImageUtil.ImageCreator isrc,
Shape mask,
BufferedImage base)
Create a new image using the supplied shape as a mask from which to cut out pixels from the supplied image. |
static void |
computeTrimmedBounds(BufferedImage image,
Rectangle tbounds)
Computes the bounds of the smallest rectangle that contains all non-transparent pixels of this image. |
static BufferedImage |
createCompatibleImage(BufferedImage source,
int width,
int height)
Creates a new buffered image with the same sample model and color model as the source image but with the new width and height. |
static BufferedImage |
createErrorImage(int width,
int height)
Creates an image with the word "Error" written in it. |
static BufferedImage |
createTracedImage(BufferedImage src,
BufferedImage dest,
Color tcolor,
int thickness,
float startAlpha,
float endAlpha)
Creates and returns a new image consisting of the supplied image traced with the given color, thickness and alpha transparency. |
static BufferedImage |
createTracedImage(ImageUtil.ImageCreator isrc,
BufferedImage src,
Color tcolor,
int thickness)
Creates and returns a new image consisting of the supplied image traced with the given color and thickness. |
static BufferedImage |
createTracedImage(ImageUtil.ImageCreator isrc,
BufferedImage src,
Color tcolor,
int thickness,
float startAlpha,
float endAlpha)
Creates and returns a new image consisting of the supplied image traced with the given color, thickness and alpha transparency. |
protected static GraphicsConfiguration |
getDefGC()
Obtains the default graphics configuration for this VM. |
static long |
getEstimatedMemoryUsage(BufferedImage image)
Returns the estimated memory usage in bytes for the specified image. |
static long |
getEstimatedMemoryUsage(Iterator<BufferedImage> iter)
Returns the estimated memory usage in bytes for all buffered images in the supplied iterator. |
static long |
getEstimatedMemoryUsage(Raster raster)
Returns the estimated memory usage in bytes for the specified raster. |
static boolean |
hitTest(BufferedImage image,
int x,
int y)
Returns true if the supplied image contains a non-transparent pixel at the specified coordinates, false otherwise. |
static BufferedImage |
recolorImage(BufferedImage image,
Color rootColor,
float[] dists,
float[] offsets)
Used to recolor images by shifting bands of color (in HSV color space) to a new hue. |
static BufferedImage |
recolorImage(BufferedImage image,
Colorization cz)
Recolors the supplied image as in recolorImage(BufferedImage,Color,float[],float[]) obtaining the recoloring
parameters from the supplied Colorization instance. |
static BufferedImage |
recolorImage(BufferedImage image,
Colorization[] zations)
Recolors the supplied image using the supplied colorizations. |
static void |
tileImage(Graphics2D gfx,
Mirage image,
int x,
int y,
int width,
int height)
Paints multiple copies of the supplied image using the supplied graphics context such that the requested area is filled with the image. |
static void |
tileImageAcross(Graphics2D gfx,
Mirage image,
int x,
int y,
int width)
Paints multiple copies of the supplied image using the supplied graphics context such that the requested width is filled with the image. |
static void |
tileImageDown(Graphics2D gfx,
Mirage image,
int x,
int y,
int height)
Paints multiple copies of the supplied image using the supplied graphics context such that the requested height is filled with the image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static GraphicsConfiguration _gc
protected static final int TRANS_MASK
protected static final int RGB_MASK
| Constructor Detail |
|---|
public ImageUtil()
| Method Detail |
|---|
public static BufferedImage createCompatibleImage(BufferedImage source,
int width,
int height)
public static BufferedImage createErrorImage(int width,
int height)
public static BufferedImage recolorImage(BufferedImage image,
Color rootColor,
float[] dists,
float[] offsets)
public static BufferedImage recolorImage(BufferedImage image,
Colorization cz)
recolorImage(BufferedImage,Color,float[],float[]) obtaining the recoloring
parameters from the supplied Colorization instance.
public static BufferedImage recolorImage(BufferedImage image,
Colorization[] zations)
public static void tileImage(Graphics2D gfx,
Mirage image,
int x,
int y,
int width,
int height)
public static void tileImageAcross(Graphics2D gfx,
Mirage image,
int x,
int y,
int width)
public static void tileImageDown(Graphics2D gfx,
Mirage image,
int x,
int y,
int height)
public static BufferedImage createTracedImage(ImageUtil.ImageCreator isrc,
BufferedImage src,
Color tcolor,
int thickness)
public static BufferedImage createTracedImage(ImageUtil.ImageCreator isrc,
BufferedImage src,
Color tcolor,
int thickness,
float startAlpha,
float endAlpha)
public static BufferedImage createTracedImage(BufferedImage src,
BufferedImage dest,
Color tcolor,
int thickness,
float startAlpha,
float endAlpha)
protected static boolean bordersNonTransparentPixel(BufferedImage data,
int wid,
int hei,
boolean[] traced,
int x,
int y)
public static BufferedImage composeMaskedImage(ImageUtil.ImageCreator isrc,
BufferedImage mask,
BufferedImage base)
public static BufferedImage composeMaskedImage(ImageUtil.ImageCreator isrc,
Shape mask,
BufferedImage base)
public static boolean hitTest(BufferedImage image,
int x,
int y)
public static void computeTrimmedBounds(BufferedImage image,
Rectangle tbounds)
public static long getEstimatedMemoryUsage(BufferedImage image)
public static long getEstimatedMemoryUsage(Raster raster)
public static long getEstimatedMemoryUsage(Iterator<BufferedImage> iter)
protected static GraphicsConfiguration getDefGC()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||