These are the pre-v12 classes, kept so existing code keeps building. New code should use the modern API — see Migration Guide: v11 to v12.
optris::FramerateCounter
Internally a linked list is used to average the time measurements. This list always has an even number of elements to avoid aliasing effects.
Public static attributes
DEFAULT_INTERVAL
static constexpr double DEFAULT_INTERVAL = 1000.
Default interval in milliseconds.
DEFAULT_SMOOTH_SIZE
static constexpr unsigned int DEFAULT_SMOOTH_SIZE = 30
Default smoothing size.
Public functions
FramerateCounter
OTC_SDK_API FramerateCounter(double interval=DEFAULT_INTERVAL, unsigned int smoothSize=DEFAULT_SMOOTH_SIZE)
Constructor.
Parameters
| Name | Description |
|---|---|
interval |
time interval in milliseconds. Can be used to check the elapsed time between two subsequent calls of the trigger() method. |
smoothSize |
half the amount of data points used to calculate the frames per seconds. The resulting amount is rounded up to an even number. |
FramerateCounter
FramerateCounter(const FramerateCounter &)=delete
No copy constructor.
operator=
FramerateCounter & operator=(const FramerateCounter &)=delete
No copy assignment.
FramerateCounter
FramerateCounter(FramerateCounter &&)=delete
No move constructor.
operator=
FramerateCounter & operator=(FramerateCounter &&)=delete
No move assignment.
~FramerateCounter
OTC_SDK_API ~FramerateCounter()
Destructor.
trigger
OTC_SDK_API bool trigger()
Takes a new time measurement and updates the frames per seconds.
Returns: true if more time has elapsed since the last call of this method than specified by the interval parameter of the constructor. False otherwise.
getFps
double getFps() const noexcept
Returns the current frames per seconds.
Returns: current frames per seconds.