33#include <NDEVR/BaseValues.h>
34#include <NDEVR/LibAssert.h>
55 template <
typename t_type>
56 constexpr t_type
getMin(
const t_type& left,
const t_type& right) {
return left < right ? left : right; }
57 template <
typename t_type>
58 constexpr t_type
getMin(
const t_type& left,
const t_type& middle,
const t_type& right) {
return getMin(
getMin(left, middle), right); }
93 template <
typename t_type>
94 constexpr t_type
getMax(
const t_type& left,
const t_type& right) {
return left > right ? left : right; }
95 template <
typename t_type>
96 constexpr t_type
getMax(
const t_type& left,
const t_type& middle,
const t_type& right) {
return getMax(
getMax(left, middle), right); }
133 template <
typename t_type>
150 template <
typename t_type>
151 constexpr t_type
sign(t_type value)
169 template<
class t_type>
178 return value != value;
184 return value != value;
206 template <
typename t_type>
207 constexpr t_type
clip(
const t_type& value,
const t_type& lower_bound,
const t_type& upper_bound)
209 lib_assert(
IsInvalid(lower_bound) ||
IsInvalid(upper_bound) || (lower_bound <= upper_bound),
"Invalid clip: upper bound is less than lower bound");
#define lib_assert(expression, message)
Definition LibAssert.h:61
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
constexpr t_type getMax(const t_type &left, const t_type &right)
Finds the max of the given arguments using the > operator The only requirement is that t_type have > ...
Definition BaseFunctions.hpp:94
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
Definition BaseValues.hpp:71
constexpr t_type clip(const t_type &value, const t_type &lower_bound, const t_type &upper_bound)
Clips the value given so that that the returned value falls between upper and lower bound.
Definition BaseFunctions.hpp:207
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
constexpr Vector< t_dims, Angle< t_angle_type > > quantize(const Vector< t_dims, Angle< t_angle_type > > &value, Angle< t_angle_type > d=Angle< t_angle_type >(DEGREES, 1.0))
Definition AngleFunctions.h:828
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
int8_t sint01
-Defines an alias representing a 1 byte, signed integer. -Can represent exact integer values -127 thr...
Definition BaseValues.hpp:50
int16_t sint02
-Defines an alias representing a 2 byte, signed integer. -Can represent exact integer values -32767 t...
Definition BaseValues.hpp:57
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:88
constexpr t_type sign(t_type value)
A simple function that returns 1 for all values greater than or equal to 0 and -1 for all values less...
Definition BaseFunctions.hpp:151
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
Definition BaseFunctions.hpp:56
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233