OpenWareLaboratory
LinearValue< T, Value > Class Template Reference

Linearly scaled value. More...

Inheritance diagram for LinearValue< T, Value >:
Collaboration diagram for LinearValue< 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 ()
 Get the input value. More...
 
 LinearValue (const LinearValue< T, Value > &other)
 
 LinearValue (T minimum, T maximum, T init)
 
 LinearValue (T value=0)
 
 operator T ()
 
LinearValue< T, Value > & operator*= (const T &other)
 
LinearValue< T, Value > & operator+= (const T &other)
 
LinearValue< T, Value > & operator-= (const T &other)
 
LinearValue< T, Value > & operator/= (const T &other)
 
LinearValue< T, Value > & operator= (const T &x)
 
void reset (T x)
 
void setRange (T from_lo, T from_hi, T to_lo, T to_hi)
 
void setRange (T minimum, T maximum)
 
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

adjust
 
offset
 
scale
 
value
 

Detailed Description

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

Linearly scaled value.

Scales an input on the range [0, 1] linearly to the range [min, max]. Minimum may be less than maximum for inverted scale.

Definition at line 113 of file SmoothValue.h.

Constructor & Destructor Documentation

◆ LinearValue() [1/3]

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

Definition at line 119 of file SmoothValue.h.

◆ LinearValue() [2/3]

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

Definition at line 120 of file SmoothValue.h.

◆ LinearValue() [3/3]

template<typename T , typename Value = SimpleValue<T>>
LinearValue< T, Value >::LinearValue ( minimum,
maximum,
init 
)
inline

Definition at line 122 of file SmoothValue.h.

References LinearValue< T, Value >::setRange().

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 LinearValue< T, Value >::getControl ( )
inline

Get the input value.

Definition at line 141 of file SmoothValue.h.

References LinearValue< T, Value >::adjust, LinearValue< T, Value >::offset, and LinearValue< T, Value >::scale.

◆ operator T()

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

Definition at line 167 of file SmoothValue.h.

◆ operator*=()

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

Definition at line 159 of file SmoothValue.h.

References LinearValue< T, Value >::update().

◆ operator+=()

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

Definition at line 151 of file SmoothValue.h.

References LinearValue< T, Value >::update().

◆ operator-=()

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

Definition at line 155 of file SmoothValue.h.

References LinearValue< T, Value >::update().

◆ operator/=()

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

Definition at line 163 of file SmoothValue.h.

References LinearValue< T, Value >::update().

◆ operator=()

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

Definition at line 147 of file SmoothValue.h.

References LinearValue< T, Value >::update().

◆ reset()

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

Definition at line 22 of file SimpleValue.h.

References SimpleValue< T >::value.

◆ setRange() [1/2]

template<typename T , typename Value = SimpleValue<T>>
void LinearValue< T, Value >::setRange ( from_lo,
from_hi,
to_lo,
to_hi 
)
inline

◆ setRange() [2/2]

template<typename T , typename Value = SimpleValue<T>>
void LinearValue< T, Value >::setRange ( minimum,
maximum 
)
inline

◆ update()

Field Documentation

◆ adjust

template<typename T , typename Value = SimpleValue<T>>
T LinearValue< T, Value >::adjust
protected

◆ 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.

◆ offset

template<typename T , typename Value = SimpleValue<T>>
T LinearValue< T, Value >::offset
protected

◆ scale

template<typename T , typename Value = SimpleValue<T>>
T LinearValue< T, Value >::scale
protected

◆ value


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