libcamera
v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
|
Hold information about supported stream formats. More...
Public Member Functions | |
StreamFormats (const std::map< PixelFormat, std::vector< SizeRange >> &formats) | |
Construct a StreamFormats object with a map of image formats. More... | |
std::vector< PixelFormat > | pixelformats () const |
Retrieve the list of supported pixel formats. More... | |
std::vector< Size > | sizes (const PixelFormat &pixelformat) const |
Retrieve the list of frame sizes supported for pixelformat. More... | |
SizeRange | range (const PixelFormat &pixelformat) const |
Retrieve the range of minimum and maximum sizes. More... | |
Hold information about supported stream formats.
The StreamFormats class holds information about the pixel formats and frame sizes a stream supports. The class groups size information by the pixel format which can produce it.
There are two ways to examine the size information, as a range or as a list of discrete sizes. When sizes are viewed as a range it describes the minimum and maximum width and height values. The range description can include horizontal and vertical steps.
When sizes are viewed as a list of discrete sizes they describe the exact dimensions which can be selected and used.
Pipeline handlers can create StreamFormats describing each pixel format using either a range or a list of discrete sizes. The StreamFormats class attempts to translate between the two different ways to view them. The translations are performed as:
Applications examining sizes as a range with step values of 0 shall be aware that the range are generated from a list of discrete sizes and there could be a large number of possible Size combinations that may not be supported by the Stream.
All sizes retrieved from StreamFormats shall be treated as advisory and no size shall be considered to be supported until it has been verified using CameraConfiguration::validate().
libcamera::StreamFormats::StreamFormats | ( | const std::map< PixelFormat, std::vector< SizeRange >> & | formats | ) |
Construct a StreamFormats object with a map of image formats.
[in] | formats | A map of pixel formats to a sizes description |
std::vector< PixelFormat > libcamera::StreamFormats::pixelformats | ( | ) | const |
Retrieve the list of supported pixel formats.
SizeRange libcamera::StreamFormats::range | ( | const PixelFormat & | pixelformat | ) | const |
Retrieve the range of minimum and maximum sizes.
[in] | pixelformat | PixelFormat to retrieve range for |
If the size described for pixelformat is a range, that range is returned directly. If the sizes described are a list of discrete sizes, a range is created from the minimum and maximum sizes in the list. The step values of the range are set to 0 to indicate that the range is generated and that not all image sizes contained in the range might be supported.
std::vector< Size > libcamera::StreamFormats::sizes | ( | const PixelFormat & | pixelformat | ) | const |
Retrieve the list of frame sizes supported for pixelformat.
[in] | pixelformat | PixelFormat to retrieve sizes for |
If the sizes described for pixelformat are discrete they are returned directly.
If the sizes are described as a range, a list of discrete sizes are computed from a list of common resolutions that fit inside the described range. When computing the discrete list step values are considered but there are no guarantees that all sizes computed are supported.