Image Component Library (ICL)
Public Member Functions | Private Attributes | List of all members
icl::utils::FPSEstimator Class Reference

Utility clas for online FPS estimation. More...

#include <FPSEstimator.h>

Inheritance diagram for icl::utils::FPSEstimator:
icl::utils::FPSLimiter

Public Member Functions

 FPSEstimator (int n=2)
 Constructor. More...
 
virtual ~FPSEstimator ()
 virtual destructor More...
 
void reset (int n)
 Sets a new averaging interval. More...
 
virtual void tic () const
 pushes current time into the time averaging queue and pop oldest time from the queue More...
 
virtual float getFPSVal () const
 applies tic() and returns current FPS estimate More...
 
virtual std::string getFPSString (const std::string &fmt="%3.4f fps", int bufferSize=30) const
 applies tic() and returns current fps estimate as formated string More...
 
virtual void showFPS (const std::string &text="") const
 applies tic() and shows current FPS estimate on std::out More...
 

Private Attributes

std::deque< Timem_qTimes
 internal time queue More...
 
int m_iN
 time-queues size More...
 

Detailed Description

Utility clas for online FPS estimation.

Constructor & Destructor Documentation

◆ FPSEstimator()

icl::utils::FPSEstimator::FPSEstimator ( int  n = 2)

Constructor.

Current FPS values are averaged over given intervall n

◆ ~FPSEstimator()

virtual icl::utils::FPSEstimator::~FPSEstimator ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ getFPSString()

virtual std::string icl::utils::FPSEstimator::getFPSString ( const std::string &  fmt = "%3.4f fps",
int  bufferSize = 30 
) const
virtual

applies tic() and returns current fps estimate as formated string

Reimplemented in icl::utils::FPSLimiter.

◆ getFPSVal()

virtual float icl::utils::FPSEstimator::getFPSVal ( ) const
virtual

applies tic() and returns current FPS estimate

Reimplemented in icl::utils::FPSLimiter.

◆ reset()

void icl::utils::FPSEstimator::reset ( int  n)

Sets a new averaging interval.

◆ showFPS()

virtual void icl::utils::FPSEstimator::showFPS ( const std::string &  text = "") const
virtual

applies tic() and shows current FPS estimate on std::out

Reimplemented in icl::utils::FPSLimiter.

◆ tic()

virtual void icl::utils::FPSEstimator::tic ( ) const
virtual

pushes current time into the time averaging queue and pop oldest time from the queue

Reimplemented in icl::utils::FPSLimiter.

Member Data Documentation

◆ m_iN

int icl::utils::FPSEstimator::m_iN
private

time-queues size

◆ m_qTimes

std::deque<Time> icl::utils::FPSEstimator::m_qTimes
mutableprivate

internal time queue


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