|
CoreComponents 4.0.0
A Modern C++ Toolkit
|
Description of an image file format. More...
#include <cc/ImageIoPlugin>
Public Member Functions | |
| ImageIoPlugin ()=default | |
| Create a null image plugin. | |
| ImageIoPlugin (const String &mediaType, const String &fileSuffix="") | |
| Get access to an image I/O plugin for given mediaType and/or fileSuffix. | |
| String | mediaType () const |
| Unqiue name identifying this plugin. | |
| List< String > | fileSuffix () const |
| Common file name extensions used for this image format. | |
| bool | detect (const Bytes &data, Out< int > width=None{}, Out< int > height=None{}) const |
| Check if data is of this image file format and optionally return the width and height of the image. | |
| Image | decode (const Bytes &data) const |
| Load the image from given data. | |
| bool | decodeInto (InOut< Image > image, const Bytes &data) const |
| Load image from data. | |
| void | encode (const Stream &sink, const Image &image) const |
| Write encoded image to sink. | |
Public Member Functions inherited from Object | |
| Object ()=default | |
| Create a null object. | |
| operator bool () const | |
| Check if this is a non-null object. | |
| bool | isNull () const |
| Check if this is a null object. | |
| int | useCount () const |
| Reference count. | |
| template<class T > | |
| bool | is () const |
| Check if this object is of type T. | |
| template<class T > | |
| T | as () const |
| Cast this object to type T. | |
| bool | isWeak () const |
| Check if the underlying object reference is weak. | |
| bool | operator== (const Object &other) const |
| Equality operator. | |
| std::strong_ordering | operator<=> (const Object &other) const |
| Ordering operator. | |
Static Public Member Functions | |
| static ImageIoPlugin | detect (const String &path, const Bytes &data, Out< int > width=None{}, Out< int > height=None{}) |
| Detect image I/O plugin for loading an image. | |
Protected Member Functions | |
| ImageIoPlugin (State *newState) | |
| const State & | me () const |
Protected Member Functions inherited from Object | |
| template<class T > | |
| T | weak () const |
| template<class T > | |
| void | initOnce () |
| Create the object state when called the first time. | |
| template<class T > | |
| void | initOncePerThread () |
| Create a distinct object state for each thread when called the first time in that thread. | |
| Object (State *newState) | |
| Initialize object with newState. | |
| Object (State *state, Alias) | |
| Object (State *state, Weak) | |
| Object & | operator= (std::nullptr_t) |
Additional Inherited Members | |
Public Types inherited from Object | |
| using | NullAccess = cc::NullAccess |
| Error thrown when trying to access a null object. | |
| using | VirginityTestFailed = cc::VirginityTestFailed |
| Error thrown when trying to initialize an object with a non-virgin state. | |
Static Protected Member Functions inherited from Object | |
| template<class T > | |
| static T | alias (const State *state) |
| Create an alias object for the given state. | |
| template<class T > | |
| static T | weak (const State *state) |
Protected Attributes inherited from Object | |
| Handle< State > | me |
| Internal object state | |
Description of an image file format.
|
default |
Create a null image plugin.
|
explicit |
Get access to an image I/O plugin for given mediaType and/or fileSuffix.
|
static |
Detect image I/O plugin for loading an image.
| path | File path |
| data | File contents |
| width | Returns the image width |
| height | Returns the image height |
| String mediaType | ( | ) | const |
Unqiue name identifying this plugin.
Check if data is of this image file format and optionally return the width and height of the image.
Load the image from given data.
Load image from data.
| image | Target image (output is scaled to match the user-defined size) |
| data | Encoded image data |