Describes a compressed or encoded media format. More...
#include <encodeddesc.h>
Public Types | |
| using | Ptr = SharedPtr< EncodedDesc > |
| Shared pointer type for EncodedDesc. | |
| using | List = promeki::List< EncodedDesc > |
| Plain value list of EncodedDesc objects. | |
| using | PtrList = promeki::List< Ptr > |
| List of shared pointers to EncodedDesc. | |
Public Member Functions | |
| EncodedDesc ()=default | |
| Constructs an invalid (default) encoded description. | |
| EncodedDesc (const FourCC &codec) | |
| Constructs an encoded description with the given codec. | |
| EncodedDesc (const FourCC &codec, const ImageDesc &sourceImageDesc) | |
| Constructs an encoded description with codec and source image format. | |
| bool | isValid () const |
| Returns true if this encoded description has a valid (non-zero) codec. | |
| FourCC | codec () const |
| Returns the codec identifier. | |
| void | setCodec (const FourCC &codec) |
| Sets the codec identifier. | |
| const ImageDesc & | sourceImageDesc () const |
| Returns the source image description this was encoded from. | |
| void | setSourceImageDesc (const ImageDesc &desc) |
| Sets the source image description. | |
| int | quality () const |
| Returns the codec-specific quality parameter. | |
| void | setQuality (int q) |
| Sets the codec-specific quality parameter. | |
| const Metadata & | metadata () const |
| Returns a const reference to the metadata. | |
| Metadata & | metadata () |
| Returns a mutable reference to the metadata. | |
| bool | formatEquals (const EncodedDesc &other) const |
| Returns true if the format fields match (codec, quality). | |
| bool | operator== (const EncodedDesc &other) const |
| Returns true if both encoded descriptions are fully equal, including metadata. | |
| bool | operator!= (const EncodedDesc &other) const |
| Returns true if the encoded descriptions are not equal. | |
| String | toString () const |
| Returns a human-readable string representation. | |
| operator String () const | |
| Implicit conversion to String via toString(). | |
Describes a compressed or encoded media format.
EncodedDesc is analogous to ImageDesc and AudioDesc but for encoded bitstreams such as JPEG, H.264, or HEVC. It identifies the codec, the source image format the data was encoded from, and an optional quality parameter.
Constructs an encoded description with the given codec.
| codec | The codec identifier (e.g. "JPEG", "H264"). |
Constructs an encoded description with codec and source image format.
| codec | The codec identifier. |
| sourceImageDesc | The uncompressed image format this was encoded from. |
|
inline |
Returns the codec identifier.
|
inline |
Returns true if the format fields match (codec, quality).
| other | The EncodedDesc to compare against. |
|
inline |
Returns true if this encoded description has a valid (non-zero) codec.
|
inline |
Returns true if the encoded descriptions are not equal.
| other | The EncodedDesc to compare against. |
|
inline |
Returns true if both encoded descriptions are fully equal, including metadata.
| other | The EncodedDesc to compare against. |
|
inline |
Returns the codec-specific quality parameter.
For JPEG this is quality 1-100. Returns -1 if not applicable.
Sets the codec identifier.
| codec | The new codec FourCC. |
|
inline |
Sets the codec-specific quality parameter.
| q | The quality value (e.g. JPEG quality 1-100, or -1 for not applicable). |
Sets the source image description.
| desc | The uncompressed image format. |
Returns the source image description this was encoded from.
| String EncodedDesc::toString | ( | ) | const |
Returns a human-readable string representation.