|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlhmc.gui.thumbnail.ImageUtils
public class ImageUtils
Nested Class Summary | |
---|---|
class |
ImageUtils.BugfixImageWriteParam
bugfix class as documented in the Java Almanac. |
Field Summary | |
---|---|
static double |
HUE_UNDEFINED
|
Constructor Summary | |
---|---|
ImageUtils()
|
Method Summary | |
---|---|
static double |
clip01(double value)
clip the given double to the range [0.0,1.0] |
static int |
clip255(int value)
clip the given integer to the range [0,255] |
static int |
clip255(long value)
clip the given long integer to the range [0,255] |
static double[] |
concat(double[] a1,
double[] a2)
concatenate two arrays |
static java.awt.image.BufferedImage |
createBufferedImageARGB(int w,
int h)
wrapper that creates a BufferedImage with TYPE_INT_ARGB |
static java.awt.image.BufferedImage |
createBufferedImageRGB(int w,
int h)
wrapper that creates a BufferedImage with TYPE_INT_RGB |
static java.awt.image.BufferedImage |
getBufferedImage(java.awt.Image image)
|
static java.awt.image.BufferedImage |
getBufferedImageRGB(java.awt.Image image)
|
static java.awt.Image |
getCairoBackedImage(java.awt.Image image,
java.awt.Component comp)
use Component.createImage() to convert the given image into an image that can be rendered quickly on both the JDK/JRE and classpath. |
static double[] |
HSV_to_RGB(double h,
double s,
double v,
double[] rgb)
convert from (hue,saturation,value) to rgb. |
static boolean |
isImageFile(java.lang.String filename)
check whether the given file is considered an image file. |
static java.awt.Image |
loadImage(java.net.URL url)
|
static java.awt.Image |
loadImageViaImageIO(java.lang.String pathname)
load an image (actually BufferedImage) via javax.imageio.ImageIO.read(). |
static java.awt.Image |
loadImageViaToolkit(byte[] big,
java.awt.image.ImageObserver observer,
java.lang.String pathname)
Convert the given raw image data (byte array) into an Image. |
static java.awt.Image |
loadImageViaToolkit(java.net.URL url,
java.awt.image.ImageObserver observer)
Try to load an Image from the resource called 'pathname'. |
static void |
msg(java.lang.String s)
|
static int |
packRGB(double r,
double g,
double b)
scale from normalized r,g,b components in range[0,1] to a packed integer pixel ARGB with ranges [0,255] and A=0. |
static double[] |
ramp(double x0,
double y0,
double x1,
double y1,
int n)
generate an array of n points that interpolate from (x0,y0) to (x1,y1). |
static java.io.ByteArrayOutputStream |
readStreamIntoBuffer(java.io.InputStream input)
|
static double[] |
RGB_to_HSV(double r,
double g,
double b,
double[] hsv)
convert from RGB to HSV colorspace. |
static java.awt.image.BufferedImage |
rotateImageClockwise(java.awt.Image image)
|
static java.awt.image.BufferedImage |
rotateImageCounterClockwise(java.awt.Image image)
|
static java.awt.image.BufferedImage |
rotateImageViaTransformOp(java.awt.Image image,
double angle)
rotate the current image via Graphics2D around the given angle (measured in radians). |
static void |
setDebug(boolean b)
|
static void |
showOutOfMemoryDialog(javax.swing.JFrame parent)
show a dialog window after an out-of-memory error. |
static java.lang.String |
stripDirectoryNames(java.lang.String pathname)
|
static boolean |
writeJPEGFile(java.awt.image.BufferedImage image,
java.io.File outfile,
double quality)
write the given image to the specifed File in JPEG format at the given quality level. |
static boolean |
writePNGFile(java.awt.image.BufferedImage image,
java.io.File outfile)
write the given image to the specifed file in PNG format. |
static boolean |
writePPMFile(java.awt.image.BufferedImage image,
java.io.File outfile)
write the given image to the specified file in PPM (raw) format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double HUE_UNDEFINED
Constructor Detail |
---|
public ImageUtils()
Method Detail |
---|
public static void setDebug(boolean b)
public static boolean isImageFile(java.lang.String filename)
public static java.lang.String stripDirectoryNames(java.lang.String pathname)
public static java.io.ByteArrayOutputStream readStreamIntoBuffer(java.io.InputStream input)
public static java.awt.Image loadImage(java.net.URL url)
public static java.awt.Image loadImageViaImageIO(java.lang.String pathname)
public static java.awt.Image loadImageViaToolkit(java.net.URL url, java.awt.image.ImageObserver observer)
The raw image data is loaded via DesignManager.getInputStream() into a ByteArrayOutputStream, and then converted into an Image via java.awt.Toolkit.createImage().
public static java.awt.Image loadImageViaToolkit(byte[] big, java.awt.image.ImageObserver observer, java.lang.String pathname)
If the cannot be decoded, we return null. We also use a timeout of at most 10000 msec before returning. The optional parameter 'pathname' is only used for (debugging) messages.
public static java.awt.image.BufferedImage createBufferedImageARGB(int w, int h)
public static java.awt.image.BufferedImage createBufferedImageRGB(int w, int h)
public static java.awt.image.BufferedImage getBufferedImage(java.awt.Image image)
public static java.awt.image.BufferedImage getBufferedImageRGB(java.awt.Image image)
public static java.awt.Image getCairoBackedImage(java.awt.Image image, java.awt.Component comp)
public static java.awt.image.BufferedImage rotateImageClockwise(java.awt.Image image)
public static java.awt.image.BufferedImage rotateImageCounterClockwise(java.awt.Image image)
public static java.awt.image.BufferedImage rotateImageViaTransformOp(java.awt.Image image, double angle)
public static int clip255(int value)
public static int clip255(long value)
public static double clip01(double value)
public static double[] ramp(double x0, double y0, double x1, double y1, int n)
public static double[] concat(double[] a1, double[] a2)
public static double[] RGB_to_HSV(double r, double g, double b, double[] hsv)
public static double[] HSV_to_RGB(double h, double s, double v, double[] rgb)
public static int packRGB(double r, double g, double b)
public static boolean writePNGFile(java.awt.image.BufferedImage image, java.io.File outfile)
public static boolean writePPMFile(java.awt.image.BufferedImage image, java.io.File outfile)
public static boolean writeJPEGFile(java.awt.image.BufferedImage image, java.io.File outfile, double quality)
public static void showOutOfMemoryDialog(javax.swing.JFrame parent)
public static void msg(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |