Jamba C++ API 8.0.0
Loading...
Searching...
No Matches
Lerp.h File Reference
#include "Misc.h"
#include <concepts>

Go to the source code of this file.

Classes

class  Lerp< TFloat, X, Y >
 Util class to compute linear interpolation. More...
struct  Range< T >
 Defines a range of values. More...

Namespaces

namespace  pongasoft
namespace  pongasoft::Utils

Concepts

concept  pongasoft::Utils::HasStaticMapValue
 Concept for a static mapValue function.

Typedefs

using DPLerp = Lerp<double, double, double>
template<typename X>
using DPLerpX = Lerp<double, X, double>
template<typename X, typename Y>
using DPLerpXY = Lerp<double, X, Y>
template<typename Y>
using DPLerpY = Lerp<double, double, Y>
using SPLerp = Lerp<float, float, float>
template<typename X>
using SPLerpX = Lerp<float, X, float>
template<typename X, typename Y>
using SPLerpXY = Lerp<float, X, Y>
template<typename Y>
using SPLerpY = Lerp<float, float, Y>

Functions

template<typename X, typename Y>
static constexpr DPLerpXY< X, Y > mapRangeDPXY (X iFromLow, X iFromHigh, Y iToLow, Y iToHigh)
 Convenient shortcut for double precision.
template<typename X, typename Y>
static constexpr SPLerpXY< X, Y > mapRangeSPXY (X iFromLow, X iFromHigh, Y iToLow, Y iToHigh) noexcept
 Convenient shortcut for single precision.
static constexpr double mapValueDP (double iValue, double iFromLow, double iFromHigh, double iToLow, double iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename X>
static constexpr double mapValueDPX (X iValue, X iFromLow, X iFromHigh, double iToLow, double iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename X, typename Y>
static constexpr Y mapValueDPXY (X iValue, X iFromLow, X iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename Y>
static constexpr Y mapValueDPY (double iValue, double iFromLow, double iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
static constexpr float mapValueSP (float iValue, float iFromLow, float iFromHigh, float iToLow, float iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename X>
static constexpr float mapValueSPX (X iValue, X iFromLow, X iFromHigh, float iToLow, float iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename X, typename Y>
static constexpr Y mapValueSPXY (X iValue, X iFromLow, X iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.
template<typename Y>
static constexpr Y mapValueSPY (float iValue, float iFromLow, float iFromHigh, Y iToLow, Y iToHigh, bool iClamp=true)
 Convenient shortcut for single precision.

Variables

constexpr auto mapRangeDP = mapRangeDPXY<double, double>
template<typename X>
constexpr auto mapRangeDPX = mapRangeDPXY<X, double>
template<typename Y>
constexpr auto mapRangeDPY = mapRangeDPXY<double, Y>
constexpr auto mapRangeSP = mapRangeSPXY<float, float>
template<typename X>
constexpr auto mapRangeSPX = mapRangeSPXY<X, float>
template<typename Y>
constexpr auto mapRangeSPY = mapRangeSPXY<float, Y>