libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
EncodedDesc Class Reference

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 ImageDescsourceImageDesc () 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 Metadatametadata () const
 Returns a const reference to the metadata.
 
Metadatametadata ()
 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().
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EncodedDesc() [1/2]

EncodedDesc::EncodedDesc ( const FourCC codec)
inline

Constructs an encoded description with the given codec.

Parameters
codecThe codec identifier (e.g. "JPEG", "H264").

◆ EncodedDesc() [2/2]

EncodedDesc::EncodedDesc ( const FourCC codec,
const ImageDesc sourceImageDesc 
)
inline

Constructs an encoded description with codec and source image format.

Parameters
codecThe codec identifier.
sourceImageDescThe uncompressed image format this was encoded from.

Member Function Documentation

◆ codec()

FourCC EncodedDesc::codec ( ) const
inline

Returns the codec identifier.

Returns
The FourCC codec value.

◆ formatEquals()

bool EncodedDesc::formatEquals ( const EncodedDesc other) const
inline

Returns true if the format fields match (codec, quality).

Parameters
otherThe EncodedDesc to compare against.
Returns
true if the format matches, ignoring metadata.

◆ isValid()

bool EncodedDesc::isValid ( ) const
inline

Returns true if this encoded description has a valid (non-zero) codec.

Returns
true if valid.

◆ operator!=()

bool EncodedDesc::operator!= ( const EncodedDesc other) const
inline

Returns true if the encoded descriptions are not equal.

Parameters
otherThe EncodedDesc to compare against.
Returns
true if not equal.

◆ operator==()

bool EncodedDesc::operator== ( const EncodedDesc other) const
inline

Returns true if both encoded descriptions are fully equal, including metadata.

Parameters
otherThe EncodedDesc to compare against.
Returns
true if equal.

◆ quality()

int EncodedDesc::quality ( ) const
inline

Returns the codec-specific quality parameter.

For JPEG this is quality 1-100. Returns -1 if not applicable.

Returns
The quality value.

◆ setCodec()

void EncodedDesc::setCodec ( const FourCC codec)
inline

Sets the codec identifier.

Parameters
codecThe new codec FourCC.

◆ setQuality()

void EncodedDesc::setQuality ( int  q)
inline

Sets the codec-specific quality parameter.

Parameters
qThe quality value (e.g. JPEG quality 1-100, or -1 for not applicable).

◆ setSourceImageDesc()

void EncodedDesc::setSourceImageDesc ( const ImageDesc desc)
inline

Sets the source image description.

Parameters
descThe uncompressed image format.

◆ sourceImageDesc()

const ImageDesc & EncodedDesc::sourceImageDesc ( ) const
inline

Returns the source image description this was encoded from.

Returns
The source ImageDesc.

◆ toString()

String EncodedDesc::toString ( ) const

Returns a human-readable string representation.

Returns
A String describing the codec and quality.

The documentation for this class was generated from the following file: