![]() |
IDS peak ICV v1.0.0
|
#include <peak_common/types/geometry/peak_common_size.hpp>
Public Member Functions | |
| constexpr | SizeT ()=default |
| Default constructor for SizeT. | |
| template<typename H = T> | |
| constexpr | SizeT (T width, T height) |
| Constructs a SizeT object from integral width and height. | |
| template<typename H = T> | |
| constexpr | SizeT (T width, T height) |
| Constructs a SizeT object from floating-point width and height. | |
| constexpr T | GetWidth () const |
| Returns the width. | |
| constexpr T | GetHeight () const |
| Returns the height. | |
| constexpr SizeT< T > | Transposed () const |
| Returns a transposed size with width and height swapped. | |
| template<typename H > | |
| constexpr bool | operator== (const SizeT< H > &rhs) const |
| Equality operator for integral types. | |
| template<typename H > | |
| constexpr bool | operator== (const SizeT< H > &rhs) const |
| Equality operator for floating point types. | |
| template<typename H > | |
| constexpr bool | operator!= (const SizeT< H > &rhs) const |
| Inequality operator. | |
| std::string | ToString () const |
| Convert the SizeT instance to a string representation. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, SizeT size) |
| Stream operator to output SizeT in a readable format. | |
Represents a two-dimensional size with non-negative width and height.
A SizeT stores the width and height of an object or area. Both dimensions must be greater than or equal to zero.
| T | Arithmetic type used for width and height. |
Definition at line 41 of file peak_common_size.hpp.
|
constexprdefault |
Default constructor for SizeT.
Initializes a size with default values for width and height.
Constructs a SizeT object from integral width and height.
Initializes the size with the specified width and height values.
| width | Width of the size. |
| height | Height of the size. |
Definition at line 72 of file peak_common_size.hpp.
Constructs a SizeT object from floating-point width and height.
Initializes the size with the specified width and height values. Throws an exception if either value is negative.
| width | Width of the size. |
| height | Height of the size. |
| InvalidParameterException | If width or height is less than zero. |
Definition at line 98 of file peak_common_size.hpp.
|
inlineconstexpr |
Returns the height.
Definition at line 131 of file peak_common_size.hpp.
|
inlineconstexpr |
Returns the width.
Definition at line 119 of file peak_common_size.hpp.
|
inlineconstexpr |
Inequality operator.
Returns true if the sizes are not equal.
| rhs | The SizeT object to compare against. |
Definition at line 207 of file peak_common_size.hpp.
|
inlineconstexpr |
Equality operator for integral types.
Compares width and height for exact equality.
| rhs | The SizeT object to compare against. |
Definition at line 164 of file peak_common_size.hpp.
|
inlineconstexpr |
Equality operator for floating point types.
Compares width and height using a tolerance based on ULP (Units in Last Place).
| rhs | The SizeT object to compare against. |
Definition at line 185 of file peak_common_size.hpp.
|
inline |
Convert the SizeT instance to a string representation.
Outputs width and height in the form: { width: ..., height: ... }
Definition at line 237 of file peak_common_size.hpp.
|
inlineconstexpr |
Returns a transposed size with width and height swapped.
Definition at line 143 of file peak_common_size.hpp.
|
friend |
Stream operator to output SizeT in a readable format.
Outputs width and height in the form: { width: ..., height: ... }
| os | Output stream |
| size | SizeT instance to output |
Definition at line 223 of file peak_common_size.hpp.