OpenWareLaboratory
LogarithmicValue< T, Value > Class Template Reference

Logarithmically scaled value. More...

Inheritance diagram for LogarithmicValue< T, Value >:
Collaboration diagram for LogarithmicValue< T, Value >:

Public Member Functions

const float DEFAULT_DELTA
 
const int DEFAULT_DELTA
 
const float DEFAULT_DELTA
 
const int DEFAULT_DELTA
 
const float DEFAULT_EXP_C
 
const int DEFAULT_EXP_C
 
const float DEFAULT_EXP_C
 
const int DEFAULT_EXP_C
 
const float DEFAULT_EXP_K
 
const int DEFAULT_EXP_K
 
const float DEFAULT_EXP_K
 
const int DEFAULT_EXP_K
 
const float DEFAULT_LAMBDA
 
const int DEFAULT_LAMBDA
 
const float DEFAULT_LAMBDA
 
const int DEFAULT_LAMBDA
 
const float DEFAULT_LOG_C
 
const int DEFAULT_LOG_C
 
const float DEFAULT_LOG_C
 
const int DEFAULT_LOG_C
 
const float DEFAULT_LOG_K
 
const int DEFAULT_LOG_K
 
const float DEFAULT_LOG_K
 
const int DEFAULT_LOG_K
 
get ()
 
getControl ()
 
 LogarithmicValue ()
 Default range scales [0, 1] to [0.5, 2]. More...
 
 LogarithmicValue (const LogarithmicValue< T > &other)
 
 LogarithmicValue (T a, T b, T init)
 
 LogarithmicValue (T value)
 
 operator T ()
 
LogarithmicValue< T, Value > & operator*= (const T &other)
 
LogarithmicValue< T, Value > & operator+= (const T &other)
 
LogarithmicValue< T, Value > & operator-= (const T &other)
 
LogarithmicValue< T, Value > & operator/= (const T &other)
 
LogarithmicValue< T, Value > & operator= (const T &x)
 
void reset (T x)
 
void setRange (T a, T b)
 
void update (T x)
 

Static Public Attributes

static const T DEFAULT_DELTA
 
static const T DEFAULT_EXP_C
 
static const T DEFAULT_EXP_K
 
static const T DEFAULT_LAMBDA
 
static const T DEFAULT_LOG_C
 
static const T DEFAULT_LOG_K
 

Protected Attributes

c = Value::DEFAULT_LOG_C
 
k = Value::DEFAULT_LOG_K
 
value
 

Detailed Description

template<typename T, typename Value = SimpleValue<T>>
class LogarithmicValue< T, Value >

Logarithmically scaled value.

Scales an input on the range [0, 1] logarithmically to the range [min, max]. Minimum may be less than maximum for inverted scale. Note: coefficients scale exponentially with range and may explode!

Ref: https://www.desmos.com/calculator/xljgqopbhy

Definition at line 253 of file SmoothValue.h.

Constructor & Destructor Documentation

◆ LogarithmicValue() [1/4]

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue< T, Value >::LogarithmicValue ( )
inline

Default range scales [0, 1] to [0.5, 2].

Definition at line 259 of file SmoothValue.h.

◆ LogarithmicValue() [2/4]

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue< T, Value >::LogarithmicValue ( value)
inline

Definition at line 260 of file SmoothValue.h.

◆ LogarithmicValue() [3/4]

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue< T, Value >::LogarithmicValue ( const LogarithmicValue< T > &  other)
inline

Definition at line 261 of file SmoothValue.h.

◆ LogarithmicValue() [4/4]

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue< T, Value >::LogarithmicValue ( a,
b,
init 
)
inline

Definition at line 262 of file SmoothValue.h.

Member Function Documentation

◆ DEFAULT_DELTA() [1/4]

const float SimpleValue< float >::DEFAULT_DELTA
inherited

Definition at line 11 of file SimpleValue.cpp.

◆ DEFAULT_DELTA() [2/4]

const int SimpleValue< int >::DEFAULT_DELTA
inherited

Definition at line 17 of file SimpleValue.cpp.

◆ DEFAULT_DELTA() [3/4]

const float SimpleValue< float >::DEFAULT_DELTA
inherited

Definition at line 61 of file SimpleValue.h.

◆ DEFAULT_DELTA() [4/4]

const int SimpleValue< int >::DEFAULT_DELTA
inherited

Definition at line 67 of file SimpleValue.h.

◆ DEFAULT_EXP_C() [1/4]

const float SimpleValue< float >::DEFAULT_EXP_C
inherited

Definition at line 12 of file SimpleValue.cpp.

◆ DEFAULT_EXP_C() [2/4]

const int SimpleValue< int >::DEFAULT_EXP_C
inherited

Definition at line 18 of file SimpleValue.cpp.

◆ DEFAULT_EXP_C() [3/4]

const float SimpleValue< float >::DEFAULT_EXP_C
inherited

Definition at line 62 of file SimpleValue.h.

◆ DEFAULT_EXP_C() [4/4]

const int SimpleValue< int >::DEFAULT_EXP_C
inherited

Definition at line 68 of file SimpleValue.h.

◆ DEFAULT_EXP_K() [1/4]

const float SimpleValue< float >::DEFAULT_EXP_K
inherited

Definition at line 13 of file SimpleValue.cpp.

◆ DEFAULT_EXP_K() [2/4]

const int SimpleValue< int >::DEFAULT_EXP_K
inherited

Definition at line 19 of file SimpleValue.cpp.

◆ DEFAULT_EXP_K() [3/4]

const float SimpleValue< float >::DEFAULT_EXP_K
inherited

Definition at line 63 of file SimpleValue.h.

◆ DEFAULT_EXP_K() [4/4]

const int SimpleValue< int >::DEFAULT_EXP_K
inherited

Definition at line 69 of file SimpleValue.h.

◆ DEFAULT_LAMBDA() [1/4]

const float SimpleValue< float >::DEFAULT_LAMBDA
inherited

Definition at line 10 of file SimpleValue.cpp.

◆ DEFAULT_LAMBDA() [2/4]

const int SimpleValue< int >::DEFAULT_LAMBDA
inherited

Definition at line 16 of file SimpleValue.cpp.

◆ DEFAULT_LAMBDA() [3/4]

const float SimpleValue< float >::DEFAULT_LAMBDA
inherited

Definition at line 60 of file SimpleValue.h.

◆ DEFAULT_LAMBDA() [4/4]

const int SimpleValue< int >::DEFAULT_LAMBDA
inherited

Definition at line 66 of file SimpleValue.h.

◆ DEFAULT_LOG_C() [1/4]

const float SimpleValue< float >::DEFAULT_LOG_C
inherited

Definition at line 14 of file SimpleValue.cpp.

◆ DEFAULT_LOG_C() [2/4]

const int SimpleValue< int >::DEFAULT_LOG_C
inherited

Definition at line 20 of file SimpleValue.cpp.

◆ DEFAULT_LOG_C() [3/4]

const float SimpleValue< float >::DEFAULT_LOG_C
inherited

Definition at line 64 of file SimpleValue.h.

◆ DEFAULT_LOG_C() [4/4]

const int SimpleValue< int >::DEFAULT_LOG_C
inherited

Definition at line 70 of file SimpleValue.h.

◆ DEFAULT_LOG_K() [1/4]

const float SimpleValue< float >::DEFAULT_LOG_K
inherited

Definition at line 15 of file SimpleValue.cpp.

◆ DEFAULT_LOG_K() [2/4]

const int SimpleValue< int >::DEFAULT_LOG_K
inherited

Definition at line 21 of file SimpleValue.cpp.

◆ DEFAULT_LOG_K() [3/4]

const float SimpleValue< float >::DEFAULT_LOG_K
inherited

Definition at line 65 of file SimpleValue.h.

◆ DEFAULT_LOG_K() [4/4]

const int SimpleValue< int >::DEFAULT_LOG_K
inherited

Definition at line 71 of file SimpleValue.h.

◆ get()

template<typename T >
T SimpleValue< T >::get ( )
inlineinherited

Definition at line 19 of file SimpleValue.h.

References SimpleValue< T >::value.

Referenced by SimpleValue< T >::operator T().

◆ getControl()

template<typename T , typename Value = SimpleValue<T>>
T LogarithmicValue< T, Value >::getControl ( )
inline

Definition at line 272 of file SmoothValue.h.

◆ operator T()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue< T, Value >::operator T ( )
inline

Definition at line 276 of file SmoothValue.h.

◆ operator*=()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue<T, Value>& LogarithmicValue< T, Value >::operator*= ( const T &  other)
inline

Definition at line 292 of file SmoothValue.h.

◆ operator+=()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue<T, Value>& LogarithmicValue< T, Value >::operator+= ( const T &  other)
inline

Definition at line 284 of file SmoothValue.h.

◆ operator-=()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue<T, Value>& LogarithmicValue< T, Value >::operator-= ( const T &  other)
inline

Definition at line 288 of file SmoothValue.h.

◆ operator/=()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue<T, Value>& LogarithmicValue< T, Value >::operator/= ( const T &  other)
inline

Definition at line 296 of file SmoothValue.h.

◆ operator=()

template<typename T , typename Value = SimpleValue<T>>
LogarithmicValue<T, Value>& LogarithmicValue< T, Value >::operator= ( const T &  x)
inline

Definition at line 280 of file SmoothValue.h.

◆ reset()

template<typename T >
void SimpleValue< T >::reset ( x)
inlineinherited

Definition at line 22 of file SimpleValue.h.

References SimpleValue< T >::value.

◆ setRange()

template<typename T , typename Value = SimpleValue<T>>
void LogarithmicValue< T, Value >::setRange ( a,
b 
)
inline

Definition at line 265 of file SmoothValue.h.

◆ update()

template<typename T , typename Value = SimpleValue<T>>
void LogarithmicValue< T, Value >::update ( x)
inline

Definition at line 269 of file SmoothValue.h.

Field Documentation

◆ c

template<typename T , typename Value = SimpleValue<T>>
T LogarithmicValue< T, Value >::c = Value::DEFAULT_LOG_C
protected

Definition at line 255 of file SmoothValue.h.

◆ DEFAULT_DELTA

template<typename T >
const T SimpleValue< T >::DEFAULT_DELTA
staticinherited

Definition at line 52 of file SimpleValue.h.

◆ DEFAULT_EXP_C

template<typename T >
const T SimpleValue< T >::DEFAULT_EXP_C
staticinherited

Definition at line 53 of file SimpleValue.h.

◆ DEFAULT_EXP_K

template<typename T >
const T SimpleValue< T >::DEFAULT_EXP_K
staticinherited

Definition at line 54 of file SimpleValue.h.

◆ DEFAULT_LAMBDA

template<typename T >
const T SimpleValue< T >::DEFAULT_LAMBDA
staticinherited

Definition at line 51 of file SimpleValue.h.

◆ DEFAULT_LOG_C

template<typename T >
const T SimpleValue< T >::DEFAULT_LOG_C
staticinherited

Definition at line 55 of file SimpleValue.h.

◆ DEFAULT_LOG_K

template<typename T >
const T SimpleValue< T >::DEFAULT_LOG_K
staticinherited

Definition at line 56 of file SimpleValue.h.

◆ k

template<typename T , typename Value = SimpleValue<T>>
T LogarithmicValue< T, Value >::k = Value::DEFAULT_LOG_K
protected

Definition at line 256 of file SmoothValue.h.

◆ value


The documentation for this class was generated from the following file: