public final class EditorImageUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
applySepiaFilter(BufferedImage src) |
static AffineTransform |
findTranslation(AffineTransform at,
int width,
int height,
int angle) |
static BufferedImage |
getLocalIcon(String resourcePath)
Loads icon from classpath as a resource.
|
static boolean |
hasAlpha(Image image) |
static BufferedImage |
makeJpg(BufferedImage source,
Paint color,
boolean clip)
Copies source image (regardless of format) to build output in JPEG
format.
|
static BufferedImage |
makePng(BufferedImage source,
boolean clip)
Copies source image (regardless of format) to build output in PNG
format.
|
static BufferedImage |
rotate(BufferedImage source,
Integer angle,
Color bgColor,
Double scaleX,
Double scaleY)
Rotates and/or scales the source image.
|
static BufferedImage |
toBufferedImage(Image image) |
public static BufferedImage toBufferedImage(Image image)
public static boolean hasAlpha(Image image)
public static BufferedImage makeJpg(BufferedImage source, Paint color, boolean clip)
source - - source image to copycolor - - background color for clipped corner areas; may be nullclip - - true if image to be round; false if rectangularpublic static BufferedImage makePng(BufferedImage source, boolean clip)
source - clip - - true if image to be round; false if rectangularpublic static AffineTransform findTranslation(AffineTransform at, int width, int height, int angle)
public static BufferedImage rotate(BufferedImage source, Integer angle, Color bgColor, Double scaleX, Double scaleY)
source - - image to be rotated and/or scaledangle - - angle in degrees by how much the image should be rotated.
Typically the angle is in increments of 90 degrees.bgColor - - color to fill the background withscaleX - - percent by which to scale x-axisscaleY - - percent by which to scale y-axispublic static BufferedImage applySepiaFilter(BufferedImage src)
img - - Image to modifyExceptionpublic static BufferedImage getLocalIcon(String resourcePath)
resourcePath - path to the icon relative to Configuration.RESOURCE_PATHCopyright © 2012-2013 Bambi Software Foundation. All Rights Reserved.