libcamera  v0.0.0+1602-6c0afb8b
Supporting cameras in Linux since 2019
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Public Attributes | List of all members
libcamera::Size Struct Reference

Describe a two-dimensional size. More...

Public Member Functions

 Size ()
 Construct a Size with width and height set to 0.
 
 Size (unsigned int w, unsigned int h)
 Construct a Size with given width and height. More...
 
bool isNull () const
 Check if the size is null. More...
 
const std::string toString () const
 Assemble and return a string describing the size. More...
 
Size alignedDownTo (unsigned int hAlignment, unsigned int vAlignment) const
 Align the size down horizontally and vertically. More...
 
Size alignedUpTo (unsigned int hAlignment, unsigned int vAlignment) const
 Align the size up horizontally and vertically. More...
 
Size boundedTo (const Size &bound) const
 Bound the size to bound. More...
 
Size expandedTo (const Size &expand) const
 Expand the size to expand. More...
 

Public Attributes

unsigned int width
 The Size width.
 
unsigned int height
 The Size height.
 

Detailed Description

Describe a two-dimensional size.

The Size structure defines a two-dimensional size with integer precision.

Constructor & Destructor Documentation

◆ Size()

libcamera::Size::Size ( unsigned int  width,
unsigned int  height 
)
inline

Construct a Size with given width and height.

Parameters
[in]widthThe Size width
[in]heightThe Size height

Member Function Documentation

◆ alignedDownTo()

libcamera::Size::alignedDownTo ( unsigned int  hAlignment,
unsigned int  vAlignment 
) const
inline

Align the size down horizontally and vertically.

Parameters
[in]hAlignmentHorizontal alignment
[in]vAlignmentVertical alignment
Returns
A Size whose width and height are equal to the width and height of this size rounded down to the nearest multiple of hAlignment and vAlignment respectively

◆ alignedUpTo()

libcamera::Size::alignedUpTo ( unsigned int  hAlignment,
unsigned int  vAlignment 
) const
inline

Align the size up horizontally and vertically.

Parameters
[in]hAlignmentHorizontal alignment
[in]vAlignmentVertical alignment
Returns
A Size whose width and height are equal to the width and height of this size rounded up to the nearest multiple of hAlignment and vAlignment respectively

◆ boundedTo()

libcamera::Size::boundedTo ( const Size bound) const
inline

Bound the size to bound.

Parameters
[in]boundThe maximum size
Returns
A Size whose width and height are the minimum of the width and height of this size and the bound size

◆ expandedTo()

libcamera::Size::expandedTo ( const Size expand) const
inline

Expand the size to expand.

Parameters
[in]expandThe minimum size
Returns
A Size whose width and height are the maximum of the width and height of this size and the expand size

◆ isNull()

bool libcamera::Size::isNull ( ) const
inline

Check if the size is null.

Returns
True if both the width and height are 0, or false otherwise

◆ toString()

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

Assemble and return a string describing the size.

Returns
A string describing the size

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