HikoGUI
Select Version: ⚠️ This documents the main development branch of HikoGUI. It might differ from release versions.
A low latency retained GUI
|
#include <hikogui/geometry/extent2.hpp>
Public Types | |
using | array_type = simd<float, 4> |
using | value_type = array_type::value_type |
Public Member Functions | |
constexpr | extent2 (extent2 const &) noexcept=default |
constexpr | extent2 (extent2 &&) noexcept=default |
constexpr extent2 & | operator= (extent2 const &) noexcept=default |
constexpr extent2 & | operator= (extent2 &&) noexcept=default |
constexpr | extent2 (array_type const &other) noexcept |
constexpr | operator array_type () const noexcept |
Convert a extent to its array_type-nummeric_array. | |
constexpr | extent2 (vector2 const &other) noexcept |
constexpr | operator vector2 () const noexcept |
constexpr | extent2 () noexcept |
Construct a empty extent / zero length. | |
constexpr | extent2 (float width, float height) noexcept |
Construct a 3D extent from width, height and depth. | |
constexpr | operator bool () const noexcept |
constexpr float & | width () noexcept |
Access the x-as-width element from the extent. | |
constexpr float & | height () noexcept |
Access the y-as-height element from the extent. | |
constexpr float | width () const noexcept |
Access the x-as-width element from the extent. | |
constexpr float | height () const noexcept |
Access the y-as-height element from the extent. | |
constexpr vector2 | right () const noexcept |
constexpr vector2 | up () const noexcept |
constexpr extent2 & | operator+= (extent2 const &rhs) noexcept |
constexpr bool | holds_invariant () const noexcept |
Check if the extent is valid. | |
Static Public Member Functions | |
static constexpr extent2 | infinity () noexcept |
static constexpr extent2 | large () noexcept |
static constexpr extent2 | nan () noexcept |
Friends | |
constexpr friend extent2 | operator+ (extent2 const &lhs, extent2 const &rhs) noexcept |
Add two extents from each other. | |
constexpr friend extent2 | operator- (extent2 const &lhs, extent2 const &rhs) noexcept |
Subtract two extents from each other. | |
constexpr friend extent2 | operator* (extent2 const &lhs, float const &rhs) noexcept |
Scale the extent by a scaler. | |
constexpr friend extent2 | operator+ (extent2 const &lhs, vector2 const &rhs) noexcept |
constexpr friend vector2 | operator+ (vector2 const &lhs, extent2 const &rhs) noexcept |
constexpr friend extent2 | operator+ (extent2 const &lhs, float const &rhs) noexcept |
Add a scaler to the extent. | |
constexpr friend extent2 | operator* (float const &lhs, extent2 const &rhs) noexcept |
Scale the extent by a scaler. | |
constexpr friend bool | operator== (extent2 const &lhs, extent2 const &rhs) noexcept |
Compare if two extents are equal. | |
constexpr friend std::partial_ordering | operator<=> (extent2 const &lhs, extent2 const &rhs) noexcept |
hi_force_inline constexpr friend float | squared_hypot (extent2 const &rhs) noexcept |
Get the squared length of the extent. | |
float | hypot (extent2 const &rhs) noexcept |
Get the length of the extent. | |
constexpr friend float | rcp_hypot (extent2 const &rhs) noexcept |
Get the length of the extent. | |
constexpr friend extent2 | normalize (extent2 const &rhs) noexcept |
Normalize a extent to a unit extent. | |
constexpr friend extent2 | ceil (extent2 const &rhs) noexcept |
constexpr friend extent2 | floor (extent2 const &rhs) noexcept |
constexpr friend extent2 | round (extent2 const &rhs) noexcept |
constexpr friend extent2 | min (extent2 const &lhs, extent2 const &rhs) noexcept |
constexpr friend extent2 | max (extent2 const &lhs, extent2 const &rhs) noexcept |
constexpr friend extent2 | clamp (extent2 const &value, extent2 const &min, extent2 const &max) noexcept |
std::string | to_string (extent2 const &rhs) noexcept |
std::ostream & | operator<< (std::ostream &lhs, extent2 const &rhs) noexcept |
A high-level geometric extent.
A extent, for both 2D or 3D is internally represented as a 4D homogeneous extent. Which can be efficiently implemented as a __m128 SSE register.
|
inlineconstexprnoexcept |
Construct a empty extent / zero length.
|
inlineconstexprnoexcept |
Construct a 3D extent from width, height and depth.
width | The width element. |
height | The height element. |
depth | The depth element. |
|
inlineconstexprnoexcept |
Access the y-as-height element from the extent.
A extent can be seen as having a width, height and depth, these accessors are aliases for x, y, and z.
|
inlineconstexprnoexcept |
Access the y-as-height element from the extent.
A extent can be seen as having a width, height and depth, these accessors are aliases for x, y, and z.
|
inlineconstexprnoexcept |
Check if the extent is valid.
Extends must be positive. This function will check if w is zero, and with 2D extent is z is zero.
|
inlineexplicitconstexprnoexcept |
Convert a extent to its array_type-nummeric_array.
|
inlineconstexprnoexcept |
Access the x-as-width element from the extent.
A extent can be seen as having a width, height and depth, these accessors are aliases for x, y, and z.
|
inlineconstexprnoexcept |
Access the x-as-width element from the extent.
A extent can be seen as having a width, height and depth, these accessors are aliases for x, y, and z.
|
friend |
Get the length of the extent.
rhs | The extent. |
Normalize a extent to a unit extent.
rhs | The extent. |
Scale the extent by a scaler.
lhs | The extent to scale. |
rhs | The scaling factor. |
Scale the extent by a scaler.
lhs | The extent to scale. |
rhs | The scaling factor. |
Add two extents from each other.
lhs | The first extent. |
rhs | The second extent. |
Add a scaler to the extent.
lhs | The extent to scale. |
rhs | The scaling factor. |
Subtract two extents from each other.
lhs | The first extent. |
rhs | The second extent. |
Compare if two extents are equal.
lhs | The first extent. |
rhs | The second extent. |
|
friend |
Get the length of the extent.
rhs | The extent. |
|
friend |
Get the squared length of the extent.
rhs | The extent. |