Scope
Scaler< T > Struct Template Reference

#include <helpers.h>

Public Member Functions

 Scaler (const double &_minin, const double &_maxin)
 
operator() (const double &v) const
 

Public Attributes

const double minin
 
const double maxin
 
const double maxout
 
const double minout
 
const double rangerelation
 

Detailed Description

template<class T>
struct Scaler< T >

Class for scaling to the full range of a datatype.

E.g. to scale -1.0 ... +1.0 to 0..65535 use Scaler<uint16_t> test(-1.0, 1.0).

Definition at line 113 of file helpers.h.

Constructor & Destructor Documentation

template<class T>
Scaler< T >::Scaler ( const double &  _minin,
const double &  _maxin 
)
inline
Parameters
[in]_minin,_maxinminimum and maximum of range to scale from

Definition at line 115 of file helpers.h.

Member Function Documentation

template<class T>
T Scaler< T >::operator() ( const double &  v) const
inline
Returns
scaled version of v (from maxin-minin to full scale of type T)

Definition at line 126 of file helpers.h.

Member Data Documentation

template<class T>
const double Scaler< T >::minin

minimum of range

Definition at line 129 of file helpers.h.

template<class T>
const double Scaler< T >::maxin

maximum of range

Definition at line 132 of file helpers.h.

template<class T>
const double Scaler< T >::maxout

maximum value of type T

Definition at line 135 of file helpers.h.

template<class T>
const double Scaler< T >::minout

minimum value of type T

Definition at line 138 of file helpers.h.

template<class T>
const double Scaler< T >::rangerelation

scaler between (maxin-minin) and (maxout - minout)

Definition at line 141 of file helpers.h.


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