|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--se.lth.cs.jpeg.JPEGDecoder
Provides functionality to decode JPEG images and convert them directly to java.awt.Image objects or to raw pixel bytes.
Constructor Summary | |
JPEGDecoder()
|
Method Summary | |
static void |
decodeARGB(byte[] jpegBytes,
byte[] pixelBytes)
Decodes a JPEG encoded image and returns the decoded pixels in alphaBGR format, suitable for efficient graphics display. |
static void |
decodeARGB(byte[] jpegBytes,
long pixelMemory)
Decodes a JPEG encoded image, stores the decoded pixels (in alphaBGR format) in native memory pointed to by the pixelMemory pointer. |
static java.awt.Image |
decodeImage(byte[] jpegBytes)
Decodes a JPEG encoded image and returns a java.awt.Image object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JPEGDecoder()
Method Detail |
public static java.awt.Image decodeImage(byte[] jpegBytes)
Decodes a JPEG encoded image and returns a java.awt.Image object. This object can be used directly by AWT in e.g. a window.
Some AWT methods return before the JPEG decompression is complete (e.g. Toolkit.createImage()). This method, on the other hand, will NOT return until the image is completely constructed and decompressed.
java.lang.IllegalArgumentException
- If the image is incorrectly JPEG
encodedpublic static void decodeARGB(byte[] jpegBytes, byte[] pixelBytes)
public static void decodeARGB(byte[] jpegBytes, long pixelMemory)
pixelMemory
pointer. Note, be sure that the pointer is
correct and that the memory is properly sized; passing a faulty
argument here breaks the safety of Java. This method improves
performance by avoiding the need to copy the pixels for display.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |