DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::Rescaling< TInputType, TOutputType > Struct Template Reference

Aim: Functor allowing to rescale a value. Values of the initial scale [initMin,initMax] are rescaled to the new scale [newMin,newMax]. More...

#include <DGtal/base/BasicFunctors.h>

Public Member Functions

 Rescaling (const TInputType &initMin, const TInputType &initMax, const TOutputType &newMin, const TOutputType &newMax)
 
TOutputType operator() (const TInputType &anInitVal) const
 

Data Fields

TInputType myInitMin
 
TInputType myInitMax
 
TInputType myInitRange
 
TOutputType myNewMin
 
TOutputType myNewMax
 
TOutputType myNewRange
 

Detailed Description

template<typename TInputType, typename TOutputType>
struct DGtal::functors::Rescaling< TInputType, TOutputType >

Aim: Functor allowing to rescale a value. Values of the initial scale [initMin,initMax] are rescaled to the new scale [newMin,newMax].

Description of template class 'Rescaling'

Template Parameters
TInputTypethe type of values on the inital scale.
TOutputTypethe type of values on the new scale.

Definition at line 905 of file BasicFunctors.h.

Constructor & Destructor Documentation

◆ Rescaling()

template<typename TInputType , typename TOutputType >
DGtal::functors::Rescaling< TInputType, TOutputType >::Rescaling ( const TInputType & initMin,
const TInputType & initMax,
const TOutputType & newMin,
const TOutputType & newMax )
inline

Constructor.

Parameters
initMinthe minimum value of the initial scale. Lower values are set to this value.
initMaxthe maximum value of the initial scale. Greater values are set to this value.
newMinthe minimum value of the new scale.
newMaxthe maximum value of the new scale.

Definition at line 923 of file BasicFunctors.h.

923 :
924 myInitMin(initMin), myInitMax(initMax), myInitRange(initMax-initMin), myNewMin(newMin), myNewMax(newMax), myNewRange(newMax-newMin) {}

Member Function Documentation

◆ operator()()

template<typename TInputType , typename TOutputType >
TOutputType DGtal::functors::Rescaling< TInputType, TOutputType >::operator() ( const TInputType & anInitVal) const
inline

Field Documentation

◆ myInitMax

template<typename TInputType , typename TOutputType >
TInputType DGtal::functors::Rescaling< TInputType, TOutputType >::myInitMax

◆ myInitMin

template<typename TInputType , typename TOutputType >
TInputType DGtal::functors::Rescaling< TInputType, TOutputType >::myInitMin

◆ myInitRange

template<typename TInputType , typename TOutputType >
TInputType DGtal::functors::Rescaling< TInputType, TOutputType >::myInitRange

◆ myNewMax

template<typename TInputType , typename TOutputType >
TOutputType DGtal::functors::Rescaling< TInputType, TOutputType >::myNewMax

◆ myNewMin

template<typename TInputType , typename TOutputType >
TOutputType DGtal::functors::Rescaling< TInputType, TOutputType >::myNewMin

◆ myNewRange

template<typename TInputType , typename TOutputType >
TOutputType DGtal::functors::Rescaling< TInputType, TOutputType >::myNewRange

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