Abstract backend for image file format I/O. More...
#include <imagefileio.h>

Public Member Functions | |
| ImageFileIO ()=default | |
| Default constructor. | |
| virtual | ~ImageFileIO () |
| Virtual destructor. | |
| int | id () const |
| Returns the format identifier for this backend. | |
| bool | isValid () const |
| Returns true if this backend has a valid (non-zero) format ID. | |
| bool | canLoad () const |
| Returns true if this backend supports loading images. | |
| bool | canSave () const |
| Returns true if this backend supports saving images. | |
| String | name () const |
| Returns the human-readable name of this backend. | |
| virtual Error | load (ImageFile &imageFile) const |
| Loads an image from a file into the given ImageFile. | |
| virtual Error | save (ImageFile &imageFile) const |
| Saves the image from the given ImageFile to disk. | |
Static Public Member Functions | |
| static int | registerImageFileIO (ImageFileIO *object) |
| Registers an ImageFileIO backend in the global registry. | |
| static const ImageFileIO * | lookup (int id) |
| Looks up a registered backend by format ID. | |
Protected Attributes | |
| int | _id = 0 |
| Format identifier. | |
| bool | _canLoad = false |
| Whether loading is supported. | |
| bool | _canSave = false |
| Whether saving is supported. | |
| String | _name |
| Human-readable format name. | |
Abstract backend for image file format I/O.
Subclasses implement format-specific loading and saving of images (e.g. PNG). Backends register themselves via PROMEKI_REGISTER_IMAGEFILEIO and are looked up by their format ID.
|
inline |
Returns true if this backend supports loading images.
|
inline |
Returns true if this backend supports saving images.
|
inline |
Returns the format identifier for this backend.
|
inline |
Returns true if this backend has a valid (non-zero) format ID.
|
static |
Looks up a registered backend by format ID.
| id | The format identifier (e.g. ImageFile::PNG). |
|
inline |
Returns the human-readable name of this backend.
|
static |
Registers an ImageFileIO backend in the global registry.
| object | Pointer to the backend to register. Ownership is taken. |