libcamera
v0.4.0
Supporting cameras in Linux since 2019
|
Describe a range of sizes. More...
Public Member Functions | |
SizeRange () | |
Construct a size range initialized to 0. | |
SizeRange (const Size &size) | |
Construct a size range representing a single size. More... | |
SizeRange (const Size &minSize, const Size &maxSize) | |
Construct a size range with specified min and max, and steps of 1. More... | |
SizeRange (const Size &minSize, const Size &maxSize, unsigned int hstep, unsigned int vstep) | |
Construct a size range with specified min, max and step. More... | |
bool | contains (const Size &size) const |
Test if a size is contained in the range. More... | |
std::string | toString () const |
Assemble and return a string describing the size range. More... | |
Public Attributes | |
Size | min |
The minimum size. | |
Size | max |
The maximum size. | |
unsigned int | hStep |
The horizontal step. | |
unsigned int | vStep |
The vertical step. | |
Describe a range of sizes.
A SizeRange describes a range of sizes included in the [min, max] interval for both the width and the height. If the minimum and maximum sizes are identical it represents a single size.
Size ranges may further limit the valid sizes through steps in the horizontal and vertical direction. The step values represent the increase in pixels between two valid width or height values, starting from the minimum. Valid sizes within the range are thus expressed as
width = min.width + hStep * x height = min.height + vStep * y
Where
width <= max.width height < max.height
Note that the step values are not equivalent to alignments, as the minimum width or height may not be a multiple of the corresponding step.
The step values may be zero when the range describes only minimum and maximum sizes without implying that all, or any, intermediate size is valid. SizeRange instances the describe a single size have both set values set to 1.
|
inline |
Construct a size range representing a single size.
[in] | size | The size |
Construct a size range with specified min and max, and steps of 1.
[in] | minSize | The minimum size |
[in] | maxSize | The maximum size |
|
inline |
Construct a size range with specified min, max and step.
[in] | minSize | The minimum size |
[in] | maxSize | The maximum size |
[in] | hstep | The horizontal step |
[in] | vstep | The vertical step |
bool libcamera::SizeRange::contains | ( | const Size & | size | ) | const |
Test if a size is contained in the range.
[in] | size | Size to check |
std::string libcamera::SizeRange::toString | ( | ) | const |
Assemble and return a string describing the size range.