Jamba
3.2.0
|
#include <Lerp.h>
Public Types | |
using | value_type = T |
Public Member Functions | |
template<typename U > | |
Range< U > | cast () const |
T | clamp (T iValue) const |
bool | contains (T iValue) const |
bool | isSingleValue () const |
template<typename U , typename TLerp = DPLerpXY<T, U>> | |
Range< U > | mapRange (Range< U > const &iRange, bool iClampToRange=true) const |
template<typename U , typename TLerp = DPLerpXY<T, U>> | |
Range< U > | mapSubRange (Range< T > const &iSubRange, Range< U > const &iRange, bool iClampToRange=true) const |
template<typename U , typename TLerp = DPLerpXY<T, U>> | |
U | mapValue (T iValue, Range< U > const &iRange, bool iClampToRange=true) const |
bool | operator!= (const Range &rhs) const |
bool | operator== (const Range &rhs) const |
Range ()=default | |
Range (T iValue) noexcept | |
Range (T iFrom, T iTo) | |
Public Attributes | |
T | fFrom {} |
T | fTo {} |
Defines a range of values.
using pongasoft::Utils::Range< T >::value_type = T |
Gives access to the type of elements in the range
|
default |
|
inlineexplicitnoexcept |
|
inline |
|
inline |
Cast this range to another one
|
inline |
Clamp the value to this range
|
inline |
This method assumes that fFrom
and fTo
are part of the range or another way to put it:
range.contains(range.fFrom) // returns true range.contains(range.fTo) // returns true
true
if the range contains the value
|
inline |
|
inline |
Map this range to the other range
iRange | the range to map the iValue into |
|
inline |
Map a sub range of this range to the other range
iRange | the range to map the iValue into |
TLerp
only once
|
inline |
Map the value from this range into the provide range
iValue | the value from this range [fFrom, fTo] |
iRange | the range to map the iValue into |
|
inline |
|
inline |
T pongasoft::Utils::Range< T >::fFrom {} |
T pongasoft::Utils::Range< T >::fTo {} |