|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.rewrite.image.ImageUtils
public final class ImageUtils
Utility functions for image processing and introspection.
| Method Summary | |
|---|---|
static BufferedImage |
depalettize(BufferedImage img,
int maxBytes)
Convert an image to a direct color map |
static BufferedImage |
getScaledInstance(BufferedImage img,
int targetWidth,
int targetHeight,
Object hint,
boolean higherQuality,
int imageType)
Convenience method that returns a scaled instance of the provided BufferedImage. |
static boolean |
isOpaque(BufferedImage img)
Check if an image is completely opaque |
static BufferedImage |
palettize(BufferedImage img,
int maxEntries)
Convert an image to a palletized one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static BufferedImage palettize(BufferedImage img,
int maxEntries)
public static BufferedImage depalettize(BufferedImage img,
int maxBytes)
public static boolean isOpaque(BufferedImage img)
public static BufferedImage getScaledInstance(BufferedImage img,
int targetWidth,
int targetHeight,
Object hint,
boolean higherQuality,
int imageType)
BufferedImage.
NOTE: Adapted from code at
http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html
img - the original image to be scaledtargetWidth - the desired width of the scaled instance,
in pixelstargetHeight - the desired height of the scaled instance,
in pixelshint - one of the rendering hints that corresponds to
RenderingHints.KEY_INTERPOLATION (e.g.
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR,
RenderingHints.VALUE_INTERPOLATION_BILINEAR,
RenderingHints.VALUE_INTERPOLATION_BICUBIC)higherQuality - if true, this method will use a multi-step
scaling technique that provides higher quality than the usual
one-step technique (only useful in downscaling cases, where
targetWidth or targetHeight is
smaller than the original dimensions, and generally only when
the BILINEAR hint is specified)
BufferedImage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||