|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.util.image.BufferedImageDecoder
public final class BufferedImageDecoder
BufferedImageDecoder decodes BufferedImages so they can be used in a Flash file. The class also provides a set of convenience methods for converting Flash images definitions into BufferedImages allowing the images to easily be extracted from a Flash movie.
| Constructor Summary | |
|---|---|
BufferedImageDecoder()
|
|
| Method Summary | |
|---|---|
ImageTag |
defineImage(int identifier)
Create the image definition so it can be added to a movie. |
ImageTag |
defineImage(int identifier,
BufferedImage obj)
Create an image definition from a BufferedImage. |
int |
getHeight()
Get the height of the image. |
byte[] |
getImage()
Get the array of bytes that make up the image. |
int |
getWidth()
Get the width of the image. |
ImageDecoder |
newDecoder()
The method implemented by all ImageDecoders in order to be registered with the ImageRegistry and used by the ImageFactory to decode images. |
void |
read(BufferedImage obj)
Decode a BufferedImage. |
void |
read(File file)
Read an image from a file. |
void |
read(InputStream stream)
Read an image from an input stream. |
void |
read(URL url)
Read an image from a file referenced by a URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferedImageDecoder()
| Method Detail |
|---|
public ImageDecoder newDecoder()
newDecoder in interface ImageProvider
public void read(File file)
throws IOException,
DataFormatException
read in interface ImageDecoderfile - the path to the file.
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.
public void read(URL url)
throws IOException,
DataFormatException
read in interface ImageDecoderurl - the reference to the file.
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.
public void read(InputStream stream)
throws IOException,
DataFormatException
read in interface ImageDecoderstream - the stream used to read the image data.
IOException - if there is an error reading the image data.
DataFormatException - if the file contains an unsupported format.public ImageTag defineImage(int identifier)
defineImage in interface ImageDecoderidentifier - the unique identifier used to refer to the image.
public ImageTag defineImage(int identifier,
BufferedImage obj)
throws IOException,
DataFormatException
identifier - the unique identifier that will be used to refer to the image
in the Flash file.obj - the BufferedImage containing the image.
IOException - if there is a problem extracting the image, from the
BufferedImage.
DataFormatException - if the BufferedImage contains a format that is not currently
supported.public int getWidth()
getWidth in interface ImageDecoderpublic int getHeight()
getHeight in interface ImageDecoderpublic byte[] getImage()
getImage in interface ImageDecoder
public void read(BufferedImage obj)
throws IOException,
DataFormatException
obj - a BufferedImage.
IOException - if there is a problem extracting the image, from the
BufferedImage.
DataFormatException - if there is a problem decoding the BufferedImage.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||