Image Component Library (ICL)
|
Utility clas for online FPS estimation. More...
#include <FPSEstimator.h>
Public Member Functions | |
FPSEstimator (int n=2) | |
Constructor. | |
virtual | ~FPSEstimator () |
virtual destructor | |
void | reset (int n) |
Sets a new averaging interval. | |
virtual void | tic () const |
pushes current time into the time averaging queue and pop oldest time from the queue | |
virtual float | getFPSVal () const |
applies tic() and returns current FPS estimate | |
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 | |
virtual void | showFPS (const std::string &text="") const |
applies tic() and shows current FPS estimate on std::out | |
Private Attributes | |
std::deque< Time > | m_qTimes |
internal time queue | |
int | m_iN |
time-queues size |
Utility clas for online FPS estimation.
icl::utils::FPSEstimator::FPSEstimator | ( | int | n = 2 | ) |
Constructor.
Current FPS values are averaged over given intervall n
virtual icl::utils::FPSEstimator::~FPSEstimator | ( | ) | [inline, virtual] |
virtual destructor
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.
int icl::utils::FPSEstimator::m_iN [private] |
time-queues size
std::deque<Time> icl::utils::FPSEstimator::m_qTimes [mutable, private] |
internal time queue