|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.JPEGConverters
public class JPEGConverters
Converts between buffered images and JPEG images stored in byte arrays.
Nested Class Summary | |
---|---|
static class |
JPEGConverters.MyImageWriteParam
|
Constructor Summary | |
---|---|
JPEGConverters()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
fromJPEG(byte[] jpegBytes)
Convert JPEG stored in byte array to BufferedImage. |
static byte[] |
toJPEG(java.awt.image.BufferedImage image)
Convert BufferedImage to byte array. |
static byte[] |
toJPEG(java.awt.image.BufferedImage image,
float quality)
Convert BufferedImage to byte array with specified quality. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JPEGConverters()
Method Detail |
---|
public static byte[] toJPEG(java.awt.image.BufferedImage image)
image
- The buffered image to convert to a byte array. public static byte[] toJPEG(java.awt.image.BufferedImage image, float quality)
image
- The buffered image to convert to a byte array.quality
- The JPEG encoding quality.
Quality must lie in the interval [0.0,1.0].
The quality determines the degree of JPEG compression.
Some guidelines:
public static java.awt.image.BufferedImage fromJPEG(byte[] jpegBytes)
jpegBytes
- The image as a byte array.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |