libcamera
v0.0.0+100-debian/0_git20200629+e7aa92a-8-9-g77f5237c-dirty (2021-05-05T16:20:29+01:00)
Supporting cameras in Linux since 2019
|
Describe a two-dimensional size. More...
Public Member Functions | |
constexpr | Size () |
Construct a Size with width and height set to 0. | |
constexpr | 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 & | alignDownTo (unsigned int hAlignment, unsigned int vAlignment) |
Align the size down horizontally and vertically in place. More... | |
Size & | alignUpTo (unsigned int hAlignment, unsigned int vAlignment) |
Align the size up horizontally and vertically in place. More... | |
Size & | boundTo (const Size &bound) |
Bound the size to bound in place. More... | |
Size & | expandTo (const Size &expand) |
Expand the size to expand. More... | |
__nodiscard constexpr Size | alignedDownTo (unsigned int hAlignment, unsigned int vAlignment) const |
Align the size down horizontally and vertically. More... | |
__nodiscard constexpr Size | alignedUpTo (unsigned int hAlignment, unsigned int vAlignment) const |
Align the size up horizontally and vertically. More... | |
__nodiscard constexpr Size | boundedTo (const Size &bound) const |
Bound the size to bound. More... | |
__nodiscard constexpr Size | expandedTo (const Size &expand) const |
Expand the size to expand. More... | |
__nodiscard Size | boundedToAspectRatio (const Size &ratio) const |
Bound the size down to match the aspect ratio given by ratio. More... | |
__nodiscard Size | expandedToAspectRatio (const Size &ratio) const |
Expand the size to match the aspect ratio given by ratio. More... | |
__nodiscard Rectangle | centeredTo (const Point ¢er) const |
Center a rectangle of this size at a given Point. More... | |
Size | operator* (float factor) const |
Scale size up by the given factor. More... | |
Size | operator/ (float factor) const |
Scale size down by the given factor. More... | |
Size & | operator*= (float factor) |
Scale this size up by the given factor in place. More... | |
Size & | operator/= (float factor) |
Scale this size down by the given factor in place. More... | |
Public Attributes | |
unsigned int | width |
The Size width. | |
unsigned int | height |
The Size height. | |
Describe a two-dimensional size.
The Size structure defines a two-dimensional size with integer precision.
|
inline |
|
inline |
Align the size down horizontally and vertically in place.
[in] | hAlignment | Horizontal alignment |
[in] | vAlignment | Vertical alignment |
This functions rounds the width and height down to the nearest multiple of hAlignment and vAlignment respectively.
|
inline |
Align the size down horizontally and vertically.
[in] | hAlignment | Horizontal alignment |
[in] | vAlignment | Vertical alignment |
|
inline |
Align the size up horizontally and vertically.
[in] | hAlignment | Horizontal alignment |
[in] | vAlignment | Vertical alignment |
|
inline |
Align the size up horizontally and vertically in place.
[in] | hAlignment | Horizontal alignment |
[in] | vAlignment | Vertical alignment |
This functions rounds the width and height up to the nearest multiple of hAlignment and vAlignment respectively.
|
inline |
Bound the size to bound.
[in] | bound | The maximum size |
Bound the size down to match the aspect ratio given by ratio.
[in] | ratio | The size whose aspect ratio must be matched |
The behaviour of this function is undefined if either the width or the height of the ratio is zero.
|
inline |
Bound the size to bound in place.
[in] | bound | The maximum size |
This function sets the width and height to the minimum of this size and the bound size.
|
inline |
Expand the size to expand.
[in] | expand | The minimum size |
Expand the size to match the aspect ratio given by ratio.
[in] | ratio | The size whose aspect ratio must be matched |
The behaviour of this function is undefined if either the width or the height of the ratio is zero.
|
inline |
Expand the size to expand.
[in] | expand | The minimum size |
This function sets the width and height to the maximum of this size and the expand size.
|
inline |
Check if the size is null.
Size libcamera::Size::operator* | ( | float | factor | ) | const |
Size & libcamera::Size::operator*= | ( | float | factor | ) |
Scale this size up by the given factor in place.
[in] | factor | The factor |
Size libcamera::Size::operator/ | ( | float | factor | ) | const |
Size & libcamera::Size::operator/= | ( | float | factor | ) |
Scale this size down by the given factor in place.
[in] | factor | The factor |
const std::string libcamera::Size::toString | ( | ) | const |
Assemble and return a string describing the size.