Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
FramerateCounter.h
Go to the documentation of this file.
1// Copyright (c) 2025 Optris GmbH Co. KG
2
10
11#pragma once
12
13#include <memory>
14
15#include "otcsdk/Api.h"
16
17
18namespace optris
19{
20
21// Forward declarations
22class Timer;
23struct LinkedElement;
24
25
33{
34public:
36 static constexpr double DEFAULT_INTERVAL = 1000.;
38 static constexpr unsigned int DEFAULT_SMOOTH_SIZE = 30;
39
40
49 OTC_SDK_API FramerateCounter(double interval = DEFAULT_INTERVAL, unsigned int smoothSize = DEFAULT_SMOOTH_SIZE);
50
55
60
63
64
72
78 double getFps() const noexcept;
79
80
81private:
82 std::unique_ptr<Timer> _tElapsed;
83 std::unique_ptr<Timer> _tPrint;
84
85 double _fps;
86 double _interval;
87
88 struct LinkedElement* _oldest;
89 struct LinkedElement* _newest;
90};
91
92
93// Inline implementation
94inline double FramerateCounter::getFps() const noexcept
95{
96 return _fps;
97}
98
99} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
OTC_SDK_API FramerateCounter & operator=(const FramerateCounter &)=delete
No copy assignment.
OTC_SDK_API FramerateCounter(double interval=DEFAULT_INTERVAL, unsigned int smoothSize=DEFAULT_SMOOTH_SIZE)
Constructor.
OTC_SDK_API FramerateCounter(FramerateCounter &&)=delete
No move constructor.
OTC_SDK_API FramerateCounter & operator=(FramerateCounter &&)=delete
No move assignment.
virtual OTC_SDK_API ~FramerateCounter()
Destructor.
double getFps() const noexcept
Returns the current frames per seconds.
Definition FramerateCounter.h:94
static constexpr double DEFAULT_INTERVAL
Default interval in milliseconds.
Definition FramerateCounter.h:36
static constexpr unsigned int DEFAULT_SMOOTH_SIZE
Default smoothing size.
Definition FramerateCounter.h:38
OTC_SDK_API bool trigger()
Takes a new time measurement and updates the frames per seconds.
OTC_SDK_API FramerateCounter(const FramerateCounter &)=delete
No copy constructor.
Main SDK namespace.
Definition DeviceInfo.h:23