DGtal  1.3.beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::Thresholder< T, isLower, isEqual > Class Template Reference

Aim: A small functor with an operator () that compares one value to a threshold value according to two bool template parameters. More...

#include <DGtal/base/BasicFunctors.h>

Inheritance diagram for DGtal::functors::Thresholder< T, isLower, isEqual >:
[legend]

Public Types

typedef T Input
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((boost::EqualityComparable< T >))
 
 BOOST_CONCEPT_ASSERT ((boost::LessThanComparable< T >))
 
 Thresholder (const Input &aT=0)
 
bool operator() (const Input &aI) const
 

Private Attributes

Input myT
 

Detailed Description

template<typename T, bool isLower = true, bool isEqual = true>
class DGtal::functors::Thresholder< T, isLower, isEqual >

Aim: A small functor with an operator () that compares one value to a threshold value according to two bool template parameters.

// template class Thresholder

Template Parameters
Ttype for a value that must be equally and less-than comparable
isLowera bool for the comparison sign : 'true' for < (default), 'false' for <
isEquala bool for the equality : 'true' for a large inequality (default), 'false' for a strict one
Examples
geometry/volumes/distance/exampleFMM3D.cpp, and images/exampleConstImageAdapter.cpp.

Definition at line 500 of file BasicFunctors.h.

Member Typedef Documentation

◆ Input

template<typename T , bool isLower = true, bool isEqual = true>
typedef T DGtal::functors::Thresholder< T, isLower, isEqual >::Input

Definition at line 506 of file BasicFunctors.h.

Constructor & Destructor Documentation

◆ Thresholder()

template<typename T , bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::Thresholder ( const Input aT = 0)
inline

Constructor.

Parameters
aTthe threshold value (default 0).

Definition at line 512 of file BasicFunctors.h.

512 :myT(aT) {}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename T , bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::BOOST_CONCEPT_ASSERT ( (boost::EqualityComparable< T >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename T , bool isLower = true, bool isEqual = true>
DGtal::functors::Thresholder< T, isLower, isEqual >::BOOST_CONCEPT_ASSERT ( (boost::LessThanComparable< T >)  )

◆ operator()()

template<typename T , bool isLower = true, bool isEqual = true>
bool DGtal::functors::Thresholder< T, isLower, isEqual >::operator() ( const Input aI) const
inline

Compares aI to @ myT.

Parameters
aIany input value
Returns
'true' or 'false' according to isLower and isEqual

Definition at line 518 of file BasicFunctors.h.

518  {
519  std::less_equal<Input> c;
520  return c(aI,myT);
521  }

Field Documentation

◆ myT

template<typename T , bool isLower = true, bool isEqual = true>
Input DGtal::functors::Thresholder< T, isLower, isEqual >::myT
private

The documentation for this class was generated from the following file:
DGtal::functors::Thresholder::myT
Input myT
Definition: BasicFunctors.h:526