Kanzi 3.9.10
math_utils.hpp File Reference

Namespaces

namespace  kanzi
 

Functions

template<typename T >
T kanzi::componentWiseClamp (const T &value, const T &minvalue, const T &maxvalue)
 Clamps all vector fields between the given minimum and the maximum values.
 
constexpr float kanzi::degreesToRadians (float angleInDegrees)
 Converts degrees to radians.
 
bool kanzi::floatIsAlmostEqual (float valueA, float valueB)
 Check if two floats are approximately equal.
 
bool kanzi::floatIsAlmostEqualAbsolute (float valueA, float valueB, float maxAbsoluteDifference)
 Check if two floats are equal up to a given difference.
 
bool kanzi::floatIsAlmostEqualUlps (float valueA, float valueB, unsigned int maxUlps)
 Floating point helper methods.
 
constexpr bool kanzi::floatIsEqual (float valueA, float valueB)
 Check if two floats are equal.
 
constexpr unsigned int kanzi::floatToUint (float value)
 Casts a float to unsigned int.
 
constexpr float kanzi::getCloseToZeroRange ()
 Returns the largest value of a floating point number which is considered as "almost zero".
 
tuple< float, float, floatkanzi::hslTosRGBColor (float h, float s, float l)
 Converts a color from the HSL color space to the sRGB color space.
 
bool kanzi::isCloseToZero (float value)
 Checks if floating point value is too close to zero.
 
template<class T >
bool kanzi::isInClosedInterval (T value, T min, T max)
 Check whether value is in [min, max] (an interval inclusive of the limit points).
 
float kanzi::linearTosRGB (float cl)
 Conversion from linear to sRGB for default gamma 2.2.
 
float kanzi::positiveModulo (float dividend, float divisor)
 Same as positiveModulo(), but for floating point numbers.
 
unsigned int kanzi::positiveModulo (int dividend, unsigned int divisor)
 Returns the positive modulo(dividend % divisor) for signed numbers in a way that negative numbers are treated as an extension instead of mirroring compared to positive numbers.
 
constexpr float kanzi::radiansToDegrees (float angleInRadians)
 Converts radians to degrees.
 
tuple< float, float, floatkanzi::sRGBToHSLColor (float r, float g, float b)
 Converts a color from the sRGB color space to the HSL color space.
 
float kanzi::sRGBToLinear (float cs)
 Conversion from sRGB to linear for default gamma 2.2.
 
constexpr float kanzi::step (float edge, float value)
 Calculate step for floating point values.
 
constexpr int kanzi::step (int edge, int value)
 Calculate step for integers.