libcamera: libcamera::SizeRange Class Reference

libcamera v0.7.1 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::SizeRange Class Reference

Describe a range of sizes. More...

Collaboration diagram for libcamera::SizeRange:
[legend]

## Public Member Functions
| SizeRange ()
| Construct a size range initialized to 0.
| SizeRange (const Size &size)
| Construct a size range representing a single size.
| SizeRange (const Size &minSize, const Size &maxSize)
| Construct a size range with specified min and max, and steps of 1.
| SizeRange (const Size &minSize, const Size &maxSize, unsigned int hstep, unsigned int vstep)
| Construct a size range with specified min, max and step.
bool | contains (const Size &size) const
| Test if a size is contained in the range.
std::string | toString () const
| Assemble and return a string describing the size range.

## 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] | size | The 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] | minSize | The minimum size
  [in] | maxSize | The 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] | minSize | The minimum size
  [in] | maxSize | The maximum size
  [in] | hstep | The horizontal step
  [in] | vstep | The 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] | size | Size 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:

- include/libcamera/geometry.h
- src/libcamera/geometry.cpp