Inheritance diagram for ImageFileFormat:

This class also contains static methods to make it easy to load images from files, streams or from memory.
Public Member Functions | |
| virtual | ~ImageFileFormat () throw () |
| Destructor. | |
| virtual const String | getFormatName ()=0 |
| Returns a description of this file format. | |
| virtual bool | canUnderstand (InputStream &input)=0 |
| Returns true if the given stream seems to contain data that this format understands. | |
| virtual Image * | decodeImage (InputStream &input)=0 |
| Tries to decode and return an image from the given stream. | |
| virtual bool | writeImageToStream (const Image &sourceImage, OutputStream &destStream)=0 |
| Attempts to write an image to a stream. | |
Static Public Member Functions | |
| static ImageFileFormat * | findImageFormatForStream (InputStream &input) |
| Tries the built-in decoders to see if it can find one to read this stream. | |
| static Image * | loadFrom (InputStream &input) |
| Tries to load an image from a stream. | |
| static Image * | loadFrom (const File &file) |
| Tries to load an image from a file. | |
| static Image * | loadFrom (const void *rawData, const int numBytesOfData) |
| Tries to load an image from a block of raw image data. | |
Protected Member Functions | |
| ImageFileFormat () throw () | |
| Creates an ImageFormat. | |
|
|
Creates an ImageFormat.
|
|
|
Destructor.
|
|
|
Returns a description of this file format. E.g. "JPEG", "PNG" Implemented in PNGImageFormat, and JPEGImageFormat. |
|
|
Returns true if the given stream seems to contain data that this format understands. The format class should only read the first few bytes of the stream and sniff for header bytes that it understands.
Implemented in PNGImageFormat, and JPEGImageFormat. |
|
|
Tries to decode and return an image from the given stream. This will be called for an image format after calling its canUnderStand() method to see if it can handle the stream.
Implemented in PNGImageFormat, and JPEGImageFormat. |
|
||||||||||||
|
Attempts to write an image to a stream. To specify extra information like encoding quality, there will be appropriate parameters in the subclasses of the specific file types.
Implemented in PNGImageFormat, and JPEGImageFormat. |
|
|
Tries the built-in decoders to see if it can find one to read this stream. There are currently built-in decoders for PNG, JPEG and GIF formats. The object that is returned should not be deleted by the caller.
|
|
|
Tries to load an image from a stream. This will use the findImageFormatForStream() method to locate a suitable codec, and use that to load the image.
|
|
|
Tries to load an image from a file. This will use the findImageFormatForStream() method to locate a suitable codec, and use that to load the image.
|
|
||||||||||||
|
Tries to load an image from a block of raw image data. This will use the findImageFormatForStream() method to locate a suitable codec, and use that to load the image.
|