public class ImageUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ImageUtil.ImageCreator |
| Constructor and Description |
|---|
ImageUtil() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
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)
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)
Copyright © 2015. All rights reserved.