libcamera
v0.4.0
Supporting cameras in Linux since 2019
|
libcamera image pixel format More...
Public Member Functions | |
constexpr | PixelFormat () |
Construct a PixelFormat with an invalid format. More... | |
constexpr | PixelFormat (uint32_t fourcc, uint64_t modifier=0) |
Construct a PixelFormat from a DRM FourCC and a modifier. More... | |
bool | operator== (const PixelFormat &other) const |
Compare pixel formats for equality. More... | |
bool | operator!= (const PixelFormat &other) const |
Compare pixel formats for inequality. More... | |
bool | operator< (const PixelFormat &other) const |
Compare pixel formats for smaller than order. More... | |
constexpr bool | isValid () const |
Check if the pixel format is valid. More... | |
constexpr | operator uint32_t () const |
Convert the the pixel format numerical value. More... | |
constexpr uint32_t | fourcc () const |
Retrieve the pixel format FourCC. More... | |
constexpr uint64_t | modifier () const |
Retrieve the pixel format modifier. More... | |
std::string | toString () const |
Assemble and return a string describing the pixel format. More... | |
Static Public Member Functions | |
static PixelFormat | fromString (const std::string &name) |
Create a PixelFormat from a string. More... | |
libcamera image pixel format
The PixelFormat type describes the format of images in the public libcamera API. It stores a FourCC value as a 32-bit unsigned integer and a modifier. The FourCC and modifier values are defined in the Linux kernel DRM/KMS API (see linux/drm_fourcc.h). Constant expressions for all pixel formats supported by libcamera are available in libcamera/formats.h.
|
inline |
Construct a PixelFormat with an invalid format.
PixelFormat instances constructed with the default constructor are invalid, calling the isValid() function returns false.
|
inlineexplicit |
Construct a PixelFormat from a DRM FourCC and a modifier.
[in] | fourcc | A DRM FourCC |
[in] | modifier | A DRM FourCC modifier |
|
inline |
Retrieve the pixel format FourCC.
|
static |
Create a PixelFormat from a string.
|
inline |
Check if the pixel format is valid.
PixelFormat instances constructed with the default constructor are invalid. Instances constructed with a FourCC defined in the DRM API are valid. The behaviour is undefined otherwise.
|
inline |
Retrieve the pixel format modifier.
|
inline |
Convert the the pixel format numerical value.
|
inline |
Compare pixel formats for inequality.
bool libcamera::PixelFormat::operator< | ( | const PixelFormat & | other | ) | const |
Compare pixel formats for smaller than order.
bool libcamera::PixelFormat::operator== | ( | const PixelFormat & | other | ) | const |
Compare pixel formats for equality.
std::string libcamera::PixelFormat::toString | ( | ) | const |
Assemble and return a string describing the pixel format.