Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle.
More...
#include <cvb/size_2d.hpp>
|
| Size2D () noexcept=default |
| Creates a default, empty size. More...
|
|
| Size2D (T width, T height) noexcept |
| Creates a size with a given width and height. More...
|
|
T | Width () const noexcept |
| Gets the horizontal component of the size. More...
|
|
void | SetWidth (T width) noexcept |
| Sets the horizontal component of the size. More...
|
|
T | Height () const noexcept |
| Gets the vertical component of the size. More...
|
|
void | SetHeight (T height) noexcept |
| Sets the vertical component of the size. More...
|
|
bool | operator== (const Size2D< T > &size) const noexcept |
| Compares to an other size. More...
|
|
bool | operator!= (const Size2D< T > &size) const noexcept |
| Compares to an other size. More...
|
|
template<class C > |
| operator Size2D< C > () const noexcept |
| Enable casting.
|
|
template<class T, class ENABLE = void>
class Cvb::Size2D< T, ENABLE >
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle.
- Template Parameters
-
T | The type of the numbers which is an integer or a floating-point number. |
- Examples
- ShapeFinder2/QtShapeFinder2, and ShapeFinder2/QtShapeFinder2Cuda.
◆ Size2D() [1/2]
Creates a default, empty size.
- Exceptions
-
Does | not throw any exception. |
◆ Size2D() [2/2]
Creates a size with a given width and height.
- Parameters
-
[in] | width | Horizontal component of the size. |
[in] | height | Vertical component of the size. |
- Exceptions
-
Does | not throw any exception. |
◆ Height()
Gets the vertical component of the size.
- Returns
- The vertical component.
- Exceptions
-
Does | not throw any exception. |
◆ operator!=()
bool operator!= |
( |
const Size2D< T > & |
size | ) |
const |
|
inlinenoexcept |
Compares to an other size.
- Parameters
-
- Returns
- True if not equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ operator==()
bool operator== |
( |
const Size2D< T > & |
size | ) |
const |
|
inlinenoexcept |
Compares to an other size.
- Parameters
-
- Returns
- True if equal, otherwise false.
- Exceptions
-
Does | not throw any exception. |
◆ SetHeight()
void SetHeight |
( |
T |
height | ) |
|
|
inlinenoexcept |
Sets the vertical component of the size.
- Parameters
-
[in] | height | The vertical component. |
- Exceptions
-
Does | not throw any exception. |
◆ SetWidth()
Sets the horizontal component of the size.
- Parameters
-
[in] | width | The horizontal component. |
- Exceptions
-
Does | not throw any exception. |
◆ Width()
Gets the horizontal component of the size.
- Returns
- The horizontal component.
- Exceptions
-
Does | not throw any exception. |