Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
optris::FramerateCounter Class Reference

Measures frame rates. More...

#include <FramerateCounter.h>

Collaboration diagram for optris::FramerateCounter:
Collaboration graph

Public Member Functions

OTC_SDK_API FramerateCounter (double interval=DEFAULT_INTERVAL, unsigned int smoothSize=DEFAULT_SMOOTH_SIZE)
 Constructor.
 
OTC_SDK_API FramerateCounter (const FramerateCounter &)=delete
 No copy constructor.
 
OTC_SDK_API FramerateCounteroperator= (const FramerateCounter &)=delete
 No copy assignment.
 
OTC_SDK_API FramerateCounter (FramerateCounter &&)=delete
 No move constructor.
 
OTC_SDK_API FramerateCounteroperator= (FramerateCounter &&)=delete
 No move assignment.
 
virtual OTC_SDK_API ~FramerateCounter ()
 Destructor.
 
OTC_SDK_API bool trigger ()
 Takes a new time measurement and updates the frames per seconds.
 
double getFps () const noexcept
 Returns the current frames per seconds.
 

Static Public Attributes

static constexpr double DEFAULT_INTERVAL = 1000.
 Default interval in milliseconds.
 
static constexpr unsigned int DEFAULT_SMOOTH_SIZE = 30
 Default smoothing size.
 

Detailed Description

Measures frame rates.

Internally a linked list is used to average the time measurements. This list always has an even number of elements to avoid aliasing effects.

Constructor & Destructor Documentation

◆ FramerateCounter()

OTC_SDK_API optris::FramerateCounter::FramerateCounter ( double interval = DEFAULT_INTERVAL,
unsigned int smoothSize = DEFAULT_SMOOTH_SIZE )

Constructor.

Parameters
[in]intervaltime interval in milliseconds. Can be used to check the elapsed time between two subsequent calls of the trigger() method.
[in]smoothSizehalf the amount of data points used to calculate the frames per seconds. The resulting amount is rounded up to an even number.

Member Function Documentation

◆ getFps()

double optris::FramerateCounter::getFps ( ) const
inlinenoexcept

Returns the current frames per seconds.

Returns
current frames per seconds.

◆ trigger()

OTC_SDK_API bool optris::FramerateCounter::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.

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