An abstract base class for image decoders.
More...
#include <ImageDecoder.hpp>
|
virtual void | readMetadata (ccxx::DataReader *reader)=0 |
| This method must be implemented to perform the image metadata decoding. More...
|
|
virtual void | readPixmap (ccxx::DataReader *reader, Pixmap *pixmap)=0 |
| This method must be implemented to perform the image data decoding. More...
|
|
void | setSize (const Size &size) |
| This method should be called from readMetadata() to store the image size, once it has been determined. More...
|
|
An abstract base class for image decoders.
An ImageDecoder decodes an image from a DataReader into a Pixmap. Thus it can be used to read images from files, from memory buffers, or from Android assets.
The steps to decode an image are as follows:
- Author
- Mark Lindner
◆ ImageDecoder()
Construct a new ImageDecoder that will read an image from the given DataReader.
◆ ~ImageDecoder()
◆ decodeImage()
void decodeImage |
( |
Pixmap * |
pixmap | ) |
|
Decode the image itself.
This method must be called after decodeMetadata().
- Parameters
-
pixmap | The Pixmap in which to store the image data. |
- Exceptions
-
IOException | If an I/O error occurs, or if the supplied Pixmap is too small to accommodate the image. |
◆ decodeMetadata()
Decode the metadata for the image.
This method must be called before decodeImage().
- Exceptions
-
IOException | If an I/O error occurs. |
◆ getSize()
Get the size of the image, in pixels.
This method will return a size of 0x0 if decodeMetadata() has not yet been called.
◆ readMetadata()
virtual void readMetadata |
( |
ccxx::DataReader * |
reader | ) |
|
|
protectedpure virtual |
This method must be implemented to perform the image metadata decoding.
- Exceptions
-
IOException | If an I/O error occurs. |
Implemented in PNGImageDecoder.
◆ readPixmap()
virtual void readPixmap |
( |
ccxx::DataReader * |
reader, |
|
|
Pixmap * |
pixmap |
|
) |
| |
|
protectedpure virtual |
This method must be implemented to perform the image data decoding.
- Parameters
-
reader | The DataReader that the image is being read from. |
pixmap | The Pixmap to store the image into. |
- Exceptions
-
IOException | If an I/O error occurs. |
Implemented in PNGImageDecoder.
◆ setSize()
void setSize |
( |
const Size & |
size | ) |
|
|
inlineprotected |
This method should be called from readMetadata() to store the image size, once it has been determined.
The documentation for this class was generated from the following files: