|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.util.ImageUtils
public class ImageUtils
This class provides methods to manipulate images.
Nested Class Summary | |
---|---|
(package private) static class |
ImageUtils.Origin
|
Constructor Summary | |
---|---|
ImageUtils()
|
Method Summary | |
---|---|
static BufferedImage |
autoCrop(BufferedImage bi)
Automatically crops an image, by continously removing full rows or columns from all sides, as long as all the pixels in them are all white |
static BufferedImage |
createEmptyImage(int width,
int height)
Creates a BufferedImage with a white, empty background. |
static BufferedImage |
createImage(int width,
int height,
int bkcolor)
Creates a BufferedImage with the given colour as background |
static boolean |
equalPixelContent(BufferedImage i1,
BufferedImage i2)
Compares if two images contain the same pixel content |
private static int |
findNumberOfColumnsToCrop(BufferedImage bi,
ImageUtils.Origin origin)
Computes how many cols of pixels can be cropped from the specified ImageUtils.Origin ; only ImageUtils.Origin.LEFT and
ImageUtils.Origin.RIGHT are valid |
private static int |
findNumberOfRowsToCrop(BufferedImage bi,
ImageUtils.Origin origin)
Computes how many rows of pixels can be cropped from the specified ImageUtils.Origin ; only ImageUtils.Origin.TOP and
ImageUtils.Origin.BOTTOM are valid |
static BufferedImage |
scaleImage(BufferedImage buim,
int width)
|
static BufferedImage |
scaleImageByHeight(BufferedImage buim,
int height)
|
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 BufferedImage autoCrop(BufferedImage bi)
private static int findNumberOfRowsToCrop(BufferedImage bi, ImageUtils.Origin origin)
ImageUtils.Origin
; only ImageUtils.Origin.TOP
and
ImageUtils.Origin.BOTTOM
are valid
private static int findNumberOfColumnsToCrop(BufferedImage bi, ImageUtils.Origin origin)
ImageUtils.Origin
; only ImageUtils.Origin.LEFT
and
ImageUtils.Origin.RIGHT
are valid
public static boolean equalPixelContent(BufferedImage i1, BufferedImage i2)
public static BufferedImage scaleImage(BufferedImage buim, int width)
public static BufferedImage scaleImageByHeight(BufferedImage buim, int height)
public static BufferedImage createEmptyImage(int width, int height)
BufferedImage
with a white, empty background.
public static BufferedImage createImage(int width, int height, int bkcolor)
BufferedImage
with the given colour as background
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |