|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.util.image.ImageUtility
public class ImageUtility
Mostly static methods to do some image manipulations.
| Constructor Summary | |
|---|---|
ImageUtility()
|
|
| Method Summary | ||
|---|---|---|
static java.awt.Rectangle |
alphaBounds(java.awt.image.BufferedImage image)
finds the maximum image bounds for the non-alpha masked object. |
|
static java.awt.image.BufferedImage |
centerAndScale(java.awt.image.BufferedImage image,
int width,
int height,
int margin)
Takes the buffered image and builds a new one which is centered and scaled. |
|
static java.awt.image.BufferedImage |
downSampleRGB(java.awt.image.BufferedImage source)
Uses integer box filter to downsample an image two one half its size. |
|
static java.awt.image.BufferedImage |
downSampleRGBA(java.awt.image.BufferedImage source)
|
|
static DirectBufferedImage |
flipImageVertical(java.awt.image.BufferedImage bi)
Flips the given image vertically and returns the modified version |
|
static java.awt.image.BufferedImage |
readImage(java.lang.String filename)
|
|
static java.awt.image.BufferedImage |
readImage(java.lang.String name,
java.lang.Object c)
|
|
static int |
roundUpPower2(int v)
|
|
static
|
scaleImage(java.awt.Image srcImage,
BufferedImage_ trgImage)
Scales an Image to the size of trgImage and draws it onto trgImage. |
|
static SharedBufferedImage |
scaleImage(java.awt.Image image,
int width,
int height,
boolean alpha)
Scales an Image and creates a BufferedImage in the desired format. |
|
static byte[] |
toByteArray(java.awt.image.BufferedImage img)
Converts a BufferedImage to a ByteBuffer. |
|
static java.nio.ByteBuffer[] |
toByteBuffer(java.awt.image.BufferedImage img)
Converts a BufferedImage to a ByteBuffer. |
|
static void |
writeAlphaImage(java.awt.image.BufferedImage image,
java.lang.String filename)
|
|
static void |
writeImage(java.awt.image.BufferedImage image,
java.lang.String filename)
|
|
static void |
writeImage(java.awt.image.BufferedImage image,
java.lang.String filename,
float compression)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageUtility()
| Method Detail |
|---|
public static java.awt.image.BufferedImage downSampleRGB(java.awt.image.BufferedImage source)
source -
public static java.awt.image.BufferedImage downSampleRGBA(java.awt.image.BufferedImage source)
public static java.awt.Rectangle alphaBounds(java.awt.image.BufferedImage image)
public static java.awt.image.BufferedImage centerAndScale(java.awt.image.BufferedImage image,
int width,
int height,
int margin)
public static void writeImage(java.awt.image.BufferedImage image,
java.lang.String filename)
public static void writeImage(java.awt.image.BufferedImage image,
java.lang.String filename,
float compression)
public static void writeAlphaImage(java.awt.image.BufferedImage image,
java.lang.String filename)
public static java.awt.image.BufferedImage readImage(java.lang.String filename)
throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage readImage(java.lang.String name,
java.lang.Object c)
throws java.io.IOException
java.io.IOExceptionpublic static DirectBufferedImage flipImageVertical(java.awt.image.BufferedImage bi)
bi - the image to flip
public static byte[] toByteArray(java.awt.image.BufferedImage img)
throws java.io.IOException
java.io.IOException
public static java.nio.ByteBuffer[] toByteBuffer(java.awt.image.BufferedImage img)
throws java.io.IOException
java.io.IOException
public static <BufferedImage_ extends java.awt.image.BufferedImage> BufferedImage_ scaleImage(java.awt.Image srcImage,
BufferedImage_ trgImage)
srcImage - The Image that should be scaled.trgImage - the target image.
public static SharedBufferedImage scaleImage(java.awt.Image image,
int width,
int height,
boolean alpha)
image - The Image that should be scaled.width - The desired image width.height - The desired image height.alpha - create an alpha-channel for the new image?
public static final int roundUpPower2(int v)
v - the value to be rounded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||