|
HikoGUI
A low latency retained GUI
|
#include <TTauri/Foundation/ivec.hpp>
Public Member Functions | |
| tt_force_inline | ivec (ivec const &rhs)=default |
| tt_force_inline ivec & | operator= (ivec const &rhs)=default |
| tt_force_inline | ivec (ivec &&rhs)=default |
| tt_force_inline ivec & | operator= (ivec &&rhs)=default |
| tt_force_inline | ivec (__m128i rhs) noexcept |
| Create a ivec out of a __m128i. | |
| tt_force_inline ivec & | operator= (__m128i rhs) noexcept |
| Create a ivec out of a __m128i. | |
| tt_force_inline | operator __m128i () const noexcept |
| Convert a ivec to a __m128i. | |
| tt_force_inline | ivec (vec const &rhs) noexcept |
| tt_force_inline ivec & | operator= (vec const &rhs) noexcept |
| tt_force_inline | operator vec () const noexcept |
| tt_force_inline | operator std::array< int32_t, 4 > () const noexcept |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline | ivec (T rhs) noexcept |
| Initialize a ivec with all elements set to a value. | |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | operator= (T rhs) noexcept |
| Initialize a ivec with all elements set to a value. | |
| template<typename T , typename U , typename V = int, typename W = int, std::enable_if_t< std::is_arithmetic_v< T > &&std::is_arithmetic_v< U > &&std::is_arithmetic_v< V > &&std::is_arithmetic_v< W >, int > = 0> | |
| tt_force_inline | ivec (T x, U y, V z=0, W w=0) noexcept |
| Create a ivec out of 2 to 4 values. | |
| template<size_t I, typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | set (T rhs) noexcept |
| template<size_t I> | |
| tt_force_inline int | get () const noexcept |
| constexpr size_t | size () const noexcept |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | x (T rhs) noexcept |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | y (T rhs) noexcept |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | z (T rhs) noexcept |
| template<typename T , std::enable_if_t< std::is_arithmetic_v< T >, int > = 0> | |
| tt_force_inline ivec & | w (T rhs) noexcept |
| tt_force_inline int | x () const noexcept |
| tt_force_inline int | y () const noexcept |
| tt_force_inline int | z () const noexcept |
| tt_force_inline int | w () const noexcept |
| tt_force_inline int | width () const noexcept |
| tt_force_inline int | height () const noexcept |
| tt_force_inline ivec & | operator+= (ivec const &rhs) noexcept |
| tt_force_inline ivec & | operator-= (ivec const &rhs) noexcept |
| tt_force_inline ivec & | operator*= (ivec const &rhs) noexcept |
| template<char a, char b, char c, char d> | |
| tt_force_inline ivec | swizzle () const noexcept |
Static Public Member Functions | |
| template<typename T , typename U , typename V = int, typename W = int, std::enable_if_t< std::is_arithmetic_v< T > &&std::is_arithmetic_v< U > &&std::is_arithmetic_v< V > &&std::is_arithmetic_v< W >, int > = 0> | |
| static tt_force_inline ivec | point (T x, U y, V z=0, W w=1) noexcept |
| Create a ivec out of 2 to 4 values. | |
| template<char a, char b, char c, char d> | |
| static constexpr int | swizzle_permute_mask () noexcept |
Friends | |
| tt_force_inline friend ivec | operator+ (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend ivec | operator- (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend ivec | operator* (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend ivec | max (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend ivec | min (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend bool | operator== (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend bool | operator!= (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend int | eq (ivec const &lhs, ivec const &rhs) noexcept |
| Equal to. | |
| tt_force_inline friend int | operator< (ivec const &lhs, ivec const &rhs) noexcept |
| Less than. | |
| tt_force_inline friend int | operator> (ivec const &lhs, ivec const &rhs) noexcept |
| Greater than. | |
| tt_force_inline friend int | operator<= (ivec const &lhs, ivec const &rhs) noexcept |
| tt_force_inline friend int | operator>= (ivec const &lhs, ivec const &rhs) noexcept |
| std::string | to_string (ivec const &rhs) noexcept |
| std::ostream friend & | operator<< (std::ostream &lhs, ivec const &rhs) noexcept |
| template<std::size_t I> | |
| tt_force_inline friend int | get (ivec const &rhs) noexcept |
A 4D vector.
If you need a 3D vector or point, you can use this vector class as a homogenious coordinate.
This class supports swizzeling. Swizzeling is done using member functions which will return a vec. The name of the member function consists of 2 to 4 of the following characters: 'x', 'y', 'z', 'w', 'r', 'g', 'b', 'a', '0' & '1'. If the swizzle member function name would start with a '0' or '1' character it will be prefixed with an underscore '_'.
Since swizzle member functions always return a 4D vec, the third and forth element will default to '0' and 'w'. This allows a 2D vector to maintain its homogeniousness.
|
inlinenoexcept |
Create a ivec out of a __m128i.
|
inlineexplicitnoexcept |
Initialize a ivec with all elements set to a value.
Useful as a scalar converter, when combined with an arithmetic operator.
|
inlinenoexcept |
Create a ivec out of 2 to 4 values.
This vector is used as a homogeneous coordinate, meaning:
|
inlinenoexcept |
Convert a ivec to a __m128i.
|
inlinenoexcept |
Create a ivec out of a __m128i.
|
inlinenoexcept |
Initialize a ivec with all elements set to a value.
Useful as a scalar converter, when combined with an arithmetic operator.
|
inlinestaticnoexcept |
Create a ivec out of 2 to 4 values.
This vector is used as a homogeneous coordinate, meaning:
Equal to.
Less than.
Greater than.