Image file loader and saver. More...
#include <imagefile.h>
Public Types | |
| enum | ID { Invalid = 0 , PNG } |
| Identifiers for supported image file formats. More... | |
Public Member Functions | |
| ImageFile (int id=0) | |
| Constructs an ImageFile for the given format. | |
| const String & | filename () const |
| Returns the filename associated with this image file. | |
| void | setFilename (const String &val) |
| Sets the filename for loading or saving. | |
| const Image & | image () const |
| Returns the image data. | |
| void | setImage (const Image &val) |
| Sets the image data for saving. | |
| Error | load () |
| Loads an image from the file specified by filename(). | |
| Error | save () |
| Saves the image to the file specified by filename(). | |
Image file loader and saver.
Provides a simple interface for loading and saving image files. The file format is determined by the ID passed at construction, which selects the corresponding ImageFileIO backend.
| ImageFile::ImageFile | ( | int | id = 0 | ) |
Constructs an ImageFile for the given format.
| id | The format identifier (e.g. ImageFile::PNG). Defaults to Invalid. |
Returns the filename associated with this image file.
Returns the image data.
| Error ImageFile::load | ( | ) |
Loads an image from the file specified by filename().
| Error ImageFile::save | ( | ) |
Saves the image to the file specified by filename().
Sets the filename for loading or saving.
| val | The filename to set. |
Sets the image data for saving.
| val | The Image to set. |