libcamera  v0.3.0
Supporting cameras in Linux since 2019
Public Member Functions | Public Attributes | List of all members
libcamera::SizeRange Class Reference

Describe a range of sizes. More...

Collaboration diagram for libcamera::SizeRange:
Collaboration graph
[legend]

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SizeRange() [1/3]

libcamera::SizeRange::SizeRange ( const Size size)
inline

Construct a size range representing a single size.

Parameters
[in]sizeThe size

◆ SizeRange() [2/3]

libcamera::SizeRange::SizeRange ( const Size minSize,
const Size maxSize 
)
inline

Construct a size range with specified min and max, and steps of 1.

Parameters
[in]minSizeThe minimum size
[in]maxSizeThe maximum size

◆ SizeRange() [3/3]

libcamera::SizeRange::SizeRange ( const Size minSize,
const Size maxSize,
unsigned int  hstep,
unsigned int  vstep 
)
inline

Construct a size range with specified min, max and step.

Parameters
[in]minSizeThe minimum size
[in]maxSizeThe maximum size
[in]hstepThe horizontal step
[in]vstepThe vertical step

Member Function Documentation

◆ contains()

bool libcamera::SizeRange::contains ( const Size size) const

Test if a size is contained in the range.

Parameters
[in]sizeSize to check
Returns
True if size is contained in the range

◆ toString()

std::string libcamera::SizeRange::toString ( ) const

Assemble and return a string describing the size range.

Returns
A string describing the SizeRange

The documentation for this class was generated from the following files: