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

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

Constructor.

Current FPS values are averaged over given intervall n

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

virtual destructor

Member Function Documentation

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.

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

applies tic() and returns current FPS estimate

Reimplemented in icl::utils::FPSLimiter.

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

Sets a new averaging interval.

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.

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

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

time-queues size

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

internal time queue


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