Thermal Camera SDK 10.1.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
FrameMetadata.h
Go to the documentation of this file.
1// Copyright (c) 2008-2025 Optris GmbH & Co. KG
2
10
11#pragma once
12
13#include <vector>
14
15#include "otcsdk/Api.h"
16#include "otcsdk/Exceptions.h"
18
19
20namespace optris
21{
22// Forward declaration
23struct FrameMetadata2;
24
25
32{
33public:
36
37
48 static FrameMetadata fromRawMetadata(FrameMetadata2* raw,
49 bool initializing,
50 int pifActualDeviceCount,
51 int pifConfigurableDeviceCount);
52
53
59 int getSize() const noexcept;
60
66 void setSize(int size) noexcept;
67
68
76 bool isFrameDataReliable() const noexcept;
77
78
84 unsigned int getCounter() const noexcept;
85
93 unsigned int getCounterHardware() const noexcept;
94
101 void setCounters(unsigned int counter, unsigned int counterHardware) noexcept;
102
103
109 long long getTimestamp() const noexcept;
110
116 long long getTimestampMedia() const noexcept;
117
124 void setTimestamps(long long timestamp, long long timestampMedia) noexcept;
125
126
132 FlagState getFlagState() const noexcept;
133
139 void setFlagState(FlagState flagState) noexcept;
140
141
147 float getTemperatureFlag() const noexcept;
148
154 float getTemperatureBox() const noexcept;
155
161 float getTemperatureChip() const noexcept;
162
170 void setTemperatures(float flag, float box, float chip) noexcept;
171
172
187 OTC_SDK_API float getPifAiValue(int deviceIndex, int pinIndex) const;
188
203 OTC_SDK_API bool getPifDiValue(int deviceIndex, int pinIndex) const;
204
210 int getPifActualDeviceCount() const noexcept;
211
217 int getPifConfigurableDeviceCount() const noexcept;
218
224 int getPifAiCountPerDevice() const noexcept;
225
231 int getPifDiCountPerDevice() const noexcept;
232
241 OTC_SDK_API void setPifCounts(int actualDeviceCount,
242 int configurableDeviceCount,
243 int aiCountPerDevice,
244 int diCountPerDevice) noexcept;
245
255 OTC_SDK_API void setPifAiValue(int deviceIndex, int pinIndex, float value);
256
266 OTC_SDK_API void setPifDiValue(int deviceIndex, int pinIndex, bool value);
267
268
274 OTC_SDK_API FrameMetadata clone() const noexcept;
275
276
277private:
279 unsigned short _size;
280
282 unsigned int _counter;
284 unsigned int _counterHardware;
285
287 long long _timestamp;
289 long long _timestampMedia;
290
292 FlagState _flagState;
293
295 float _temperatureFlag;
297 float _temperatureBox;
299 float _temperatureChip;
300
302 int _pifActualDeviceCount;
304 int _pifConfigurableDeviceCount;
305
307 int _pifAiCountPerDevice;
309 std::vector<float> _pifAiValues;
310
312 int _pifDiCountPerDevice;
314 std::vector<bool> _pifDiValues;
315};
316
317
318// Inline implementations
319inline int FrameMetadata::getSize() const noexcept
320{
321 return _size;
322}
323
324inline void FrameMetadata::setSize(int size) noexcept
325{
326 _size = size;
327}
328
329inline bool FrameMetadata::isFrameDataReliable() const noexcept
330{
331 return (_flagState != FlagState::Initializing);
332}
333
334inline unsigned int FrameMetadata::getCounter() const noexcept
335{
336 return _counter;
337}
338
339inline unsigned int FrameMetadata::getCounterHardware() const noexcept
340{
341 return _counterHardware;
342}
343
344inline void FrameMetadata::setCounters(unsigned int counter, unsigned int counterHardware) noexcept
345{
346 _counter = counter;
347 _counterHardware = counterHardware;
348}
349
350inline long long FrameMetadata::getTimestamp() const noexcept
351{
352 return _timestamp;
353}
354
355inline long long FrameMetadata::getTimestampMedia() const noexcept
356{
357 return _timestampMedia;
358}
359
360inline void FrameMetadata::setTimestamps(long long timestamp, long long timestampMedia) noexcept
361{
362 _timestamp = timestamp;
363 _timestampMedia = timestampMedia;
364}
365
367{
368 return _flagState;
369}
370
371inline void FrameMetadata::setFlagState(FlagState flagState) noexcept
372{
373 _flagState = flagState;
374}
375
376inline float FrameMetadata::getTemperatureFlag() const noexcept
377{
378 return _temperatureFlag;
379}
380
381inline float FrameMetadata::getTemperatureBox() const noexcept
382{
383 return _temperatureBox;
384}
385
386inline float FrameMetadata::getTemperatureChip() const noexcept
387{
388 return _temperatureChip;
389}
390
391inline void FrameMetadata::setTemperatures(float flag, float box, float chip) noexcept
392{
393 _temperatureFlag = flag;
394 _temperatureBox = box;
395 _temperatureChip = chip;
396}
397
398inline int FrameMetadata::getPifActualDeviceCount() const noexcept
399{
400 return _pifActualDeviceCount;
401}
402
404{
405 return _pifConfigurableDeviceCount;
406}
407
408inline int FrameMetadata::getPifAiCountPerDevice() const noexcept
409{
410 return _pifAiCountPerDevice;
411}
412
413inline int FrameMetadata::getPifDiCountPerDevice() const noexcept
414{
415 return _pifDiCountPerDevice;
416}
417
418inline FrameMetadata FrameMetadata::clone() const noexcept
419{
420 return FrameMetadata{*this};
421}
422
423} // 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
Contains the exceptions raised by the SDK.
Contains an enum representing the different states of the shutter flag.
OTC_SDK_API void setPifDiValue(int deviceIndex, int pinIndex, bool value)
Sets the value of the specified PIF digital input channel.
float getTemperatureChip() const noexcept
Returns the sensor chip temperature in °C at frame capturing time.
Definition FrameMetadata.h:386
OTC_SDK_API FrameMetadata() noexcept
Constructor.
OTC_SDK_API FrameMetadata clone() const noexcept
Returns a complete copy of this metadata.
Definition FrameMetadata.h:418
unsigned int getCounter() const noexcept
Returns a consecutive number for each received frame.
Definition FrameMetadata.h:334
void setCounters(unsigned int counter, unsigned int counterHardware) noexcept
Sets the frame counters.
Definition FrameMetadata.h:344
OTC_SDK_API float getPifAiValue(int deviceIndex, int pinIndex) const
Returns the analog input value on the given PIF channel.
float getTemperatureBox() const noexcept
Returns the housing temperature in °C at frame capturing time.
Definition FrameMetadata.h:381
void setTimestamps(long long timestamp, long long timestampMedia) noexcept
Sets the timestamps.
Definition FrameMetadata.h:360
int getPifAiCountPerDevice() const noexcept
Returns the count of analog input channels per PIF device.
Definition FrameMetadata.h:408
FlagState getFlagState() const noexcept
Returns the state of the shutter flag at frame capturing time.
Definition FrameMetadata.h:366
int getPifConfigurableDeviceCount() const noexcept
Returns the count of configurable PIF devices.
Definition FrameMetadata.h:403
void setSize(int size) noexcept
Sets the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:324
OTC_SDK_API void setPifAiValue(int deviceIndex, int pinIndex, float value)
Sets the value of the specified PIF analog input channel.
void setTemperatures(float flag, float box, float chip) noexcept
Set the flag, box and chip temperatures in °C.
Definition FrameMetadata.h:391
int getPifDiCountPerDevice() const noexcept
Returns the count of digital input channels per PIF device.
Definition FrameMetadata.h:413
static FrameMetadata fromRawMetadata(FrameMetadata2 *raw, bool initializing, int pifActualDeviceCount, int pifConfigurableDeviceCount)
Creates a frame metadata object from raw metadata.
void setFlagState(FlagState flagState) noexcept
Sets the state of the shutter flag.
Definition FrameMetadata.h:371
long long getTimestampMedia() const noexcept
Returns the media timestamp.
Definition FrameMetadata.h:355
int getPifActualDeviceCount() const noexcept
Returns the count of actually connected PIF devices.
Definition FrameMetadata.h:398
int getSize() const noexcept
Returns the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:319
OTC_SDK_API void setPifCounts(int actualDeviceCount, int configurableDeviceCount, int aiCountPerDevice, int diCountPerDevice) noexcept
Sets the counts of the PIF devices and input channels.
OTC_SDK_API bool getPifDiValue(int deviceIndex, int pinIndex) const
Returns the digital input value on the given PIF channel.
unsigned int getCounterHardware() const noexcept
Returns the frame number received from the device.
Definition FrameMetadata.h:339
float getTemperatureFlag() const noexcept
Returns the shutter flag temperature in °C at frame capturing time.
Definition FrameMetadata.h:376
long long getTimestamp() const noexcept
Returns the frame timestamp in UNITS (10000000 units per second).
Definition FrameMetadata.h:350
bool isFrameDataReliable() const noexcept
Returns whether the data provided in the associated frame is reliable.
Definition FrameMetadata.h:329
Main SDK namespace.
Definition DeviceInfo.h:23
FlagState
Represents the different states of the shutter flag.
Definition FlagState.h:33
@ Initializing
Flag state is beeing initialized/calibrated.
Definition FlagState.h:39