libcamera
v0.0.0
Supporting cameras in Linux since 2019
|
Describe V4L2Device and V4L2SubDevice image formats. More...
Public Member Functions | |
int | addFormat (unsigned int format, const std::vector< SizeRange > &sizes) |
Add a format and corresponding sizes to the description. More... | |
bool | isEmpty () const |
Check if the list of devices supported formats is empty. More... | |
std::vector< unsigned int > | formats () const |
Retrieve a list of all supported image formats. More... | |
const std::vector< SizeRange > & | sizes (unsigned int format) const |
Retrieve all sizes for a specific format. More... | |
const std::map< unsigned int, std::vector< SizeRange > > & | data () const |
Retrieve the map that associates formats to image sizes. More... | |
Describe V4L2Device and V4L2SubDevice image formats.
This class stores a list of image formats, each associated with a corresponding set of image sizes. It is used to describe the formats and sizes supported by a V4L2Device or V4L2Subdevice.
Formats are stored as an integer. When used for a V4L2Device, the image formats are fourcc pixel formats. When used for a V4L2Subdevice they are media bus codes. Both are defined by the V4L2 specification.
Sizes are stored as a list of SizeRange.
int libcamera::ImageFormats::addFormat | ( | unsigned int | format, |
const std::vector< SizeRange > & | sizes | ||
) |
Add a format and corresponding sizes to the description.
[in] | format | Pixel format or media bus code to describe |
[in] | sizes | List of supported size ranges for the format |
-EEXIST | The format is already described |
const std::map< unsigned int, std::vector< SizeRange > > & libcamera::ImageFormats::data | ( | ) | const |
Retrieve the map that associates formats to image sizes.
std::vector< unsigned int > libcamera::ImageFormats::formats | ( | ) | const |
Retrieve a list of all supported image formats.
bool libcamera::ImageFormats::isEmpty | ( | ) | const |
Check if the list of devices supported formats is empty.
const std::vector< SizeRange > & libcamera::ImageFormats::sizes | ( | unsigned int | format | ) | const |
Retrieve all sizes for a specific format.
[in] | format | The pixel format or mbus code |
Retrieve all size ranges for a specific format. For V4L2Device format is a pixel format while for a V4L2Subdevice format is a media bus code.