libcamera image pixel format
More...
|
constexpr | PixelFormat () |
| Construct a PixelFormat with an invalid format.
|
|
constexpr | PixelFormat (uint32_t fourcc, uint64_t modifier=0) |
| Construct a PixelFormat from a DRM FourCC and a modifier.
|
|
bool | operator== (const PixelFormat &other) const |
| Compare pixel formats for equality.
|
|
bool | operator!= (const PixelFormat &other) const |
| Compare pixel formats for inequality.
|
|
bool | operator< (const PixelFormat &other) const |
| Compare pixel formats for smaller than order.
|
|
constexpr bool | isValid () const |
| Check if the pixel format is valid.
|
|
constexpr | operator uint32_t () const |
| Convert the the pixel format numerical value.
|
|
constexpr uint32_t | fourcc () const |
| Retrieve the pixel format FourCC.
|
|
constexpr uint64_t | modifier () const |
| Retrieve the pixel format modifier.
|
|
std::string | toString () const |
| Assemble and return a string describing the pixel format.
|
|
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.
◆ PixelFormat() [1/2]
libcamera::PixelFormat::PixelFormat |
( |
| ) |
|
|
inlineconstexpr |
Construct a PixelFormat with an invalid format.
PixelFormat instances constructed with the default constructor are invalid, calling the isValid() function returns false.
◆ PixelFormat() [2/2]
libcamera::PixelFormat::PixelFormat |
( |
uint32_t |
fourcc, |
|
|
uint64_t |
modifier = 0 |
|
) |
| |
|
inlineexplicitconstexpr |
Construct a PixelFormat from a DRM FourCC and a modifier.
- Parameters
-
[in] | fourcc | A DRM FourCC |
[in] | modifier | A DRM FourCC modifier |
◆ fourcc()
libcamera::PixelFormat::fourcc |
( |
| ) |
const |
|
inlineconstexpr |
Retrieve the pixel format FourCC.
- Returns
- DRM FourCC
◆ fromString()
PixelFormat libcamera::PixelFormat::fromString |
( |
const std::string & |
name | ) |
|
|
static |
Create a PixelFormat from a string.
- Returns
- The PixelFormat represented by the name if known, or an invalid pixel format otherwise.
◆ isValid()
bool libcamera::PixelFormat::isValid |
( |
| ) |
const |
|
inlineconstexpr |
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.
- Returns
- True if the pixel format is valid, false otherwise
◆ modifier()
libcamera::PixelFormat::modifier |
( |
| ) |
const |
|
inlineconstexpr |
Retrieve the pixel format modifier.
- Returns
- DRM modifier
◆ operator uint32_t()
libcamera::PixelFormat::operator uint32_t |
( |
| ) |
const |
|
inlineconstexpr |
Convert the the pixel format numerical value.
- Returns
- The pixel format numerical value
◆ operator!=()
bool libcamera::PixelFormat::operator!= |
( |
const PixelFormat & |
other | ) |
const |
|
inline |
Compare pixel formats for inequality.
- Returns
- True if the two pixel formats are not equal, false otherwise
◆ operator<()
bool libcamera::PixelFormat::operator< |
( |
const PixelFormat & |
other | ) |
const |
Compare pixel formats for smaller than order.
- Returns
- True if this is smaller than other, false otherwise
◆ operator==()
bool libcamera::PixelFormat::operator== |
( |
const PixelFormat & |
other | ) |
const |
Compare pixel formats for equality.
- Returns
- True if the two pixel formats are equal, false otherwise
◆ toString()
std::string libcamera::PixelFormat::toString |
( |
| ) |
const |
Assemble and return a string describing the pixel format.
- Returns
- A string describing the pixel format
The documentation for this class was generated from the following files: