Version 8.9.0
 
Loading...
Searching...
No Matches
FramerateCounter.h
1/******************************************************************************
2 * Copyright (c) 2012-2017 All Rights Reserved, http://www.evocortex.com *
3 * Evocortex GmbH *
4 * Emilienstr. 1 *
5 * 90489 Nuremberg *
6 * Germany *
7 * *
8 * Contributors: *
9 * Initial version for Linux 64-Bit platform supported by Fraunhofer IPA, *
10 * http://www.ipa.fraunhofer.de *
11 *****************************************************************************/
12
13#ifndef FRAMERATECOUNTER_H_
14#define FRAMERATECOUNTER_H_
15
16#include <iostream>
17#include <list>
18#include "irdirectsdk_defs.h"
19
20namespace evo
21{
22
23struct LinkedElement;
24
25class Timer;
26
32class __IRDIRECTSDK_API__ FramerateCounter
33{
34public:
40 FramerateCounter(double interval=1000.0, unsigned int smoothSize=30);
41
46
52 bool trigger(double* fps=NULL);
53
58 double getFps();
59
60private:
61
62 Timer* _tElapsed;
63
64 Timer* _tPrint;
65
66 double _fps;
67
68 double _interval;
69
70 struct LinkedElement* _oldest;
71
72 struct LinkedElement* _newest;
73
74};
75
76}
77
78#endif /* FRAMERATECOUNTER_H_ */
Framerate calculation helper.
Definition: FramerateCounter.h:33
bool trigger(double *fps=NULL)
Trigger, i.e., integrate new measurement.
virtual ~FramerateCounter()
Destructor.
FramerateCounter(double interval=1000.0, unsigned int smoothSize=30)
Standard constructor.
double getFps()
Accessor to current frames per second rate (no triggering is performed)
Time measurement class.
Definition: Timer.h:27