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

A four-character code (FourCC) identifier. More...

#include <fourcc.h>

Public Member Functions

constexpr FourCC (char c0, char c1, char c2, char c3)
 Constructs a FourCC from four individual characters.
 
template<size_t N>
constexpr FourCC (const char(&str)[N])
 Constructs a FourCC from a string literal.
 
constexpr uint32_t value () const
 Returns the packed 32-bit integer value.
 

Friends

constexpr bool operator== (const FourCC &a, const FourCC &b)
 Returns true if both FourCC values are equal.
 
constexpr bool operator!= (const FourCC &a, const FourCC &b)
 Returns true if the FourCC values are not equal.
 
constexpr bool operator< (const FourCC &a, const FourCC &b)
 Less-than comparison by numeric value.
 
constexpr bool operator> (const FourCC &a, const FourCC &b)
 Greater-than comparison by numeric value.
 
constexpr bool operator<= (const FourCC &a, const FourCC &b)
 Less-than-or-equal comparison by numeric value.
 
constexpr bool operator>= (const FourCC &a, const FourCC &b)
 Greater-than-or-equal comparison by numeric value.
 

Detailed Description

A four-character code (FourCC) identifier.

Stores four ASCII characters packed into a 32-bit integer in big-endian order. Commonly used to identify codecs, pixel formats, and container formats in multimedia applications. All operations are constexpr and suitable for use as compile-time constants.

Constructor & Destructor Documentation

◆ FourCC() [1/2]

constexpr FourCC::FourCC ( char  c0,
char  c1,
char  c2,
char  c3 
)
inlineconstexpr

Constructs a FourCC from four individual characters.

Parameters
c0First (most significant) character.
c1Second character.
c2Third character.
c3Fourth (least significant) character.

◆ FourCC() [2/2]

template<size_t N>
constexpr FourCC::FourCC ( const char(&)  str[N])
inlineconstexpr

Constructs a FourCC from a string literal.

Template Parameters
NThe size of the string literal (must be 5, including null terminator).
Parameters
strA 4-character string literal (e.g. "RIFF").

Member Function Documentation

◆ value()

constexpr uint32_t FourCC::value ( ) const
inlineconstexpr

Returns the packed 32-bit integer value.

Returns
The FourCC as a uint32_t in big-endian byte order.

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