Thermal Camera SDK 10.1.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
MeasurementField.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 <string>
14#include <vector>
15
16#include "otcsdk/Api.h"
17#include "otcsdk/Exceptions.h"
21
22
23namespace optris
24{
25
33{
34 // Special iterator access.
35 friend class ConstMeasurementFieldIterator;
36
37
38public:
41
53 long long fieldId,
54 int referenceFrameWidth,
55 int referenceFrameHeight);
56
57
61 OTC_SDK_API MeasurementField& operator=(const MeasurementField& rhs) = default;
62
66 OTC_SDK_API MeasurementField& operator=(MeasurementField&& rhs) noexcept = default;
67
70
71
77 MeasurementFieldConfig getConfig() const noexcept;
78
84 long long getId() const noexcept;
85
91 int getIndex() const noexcept;
92
98 void setIndex(int index) noexcept;
99
105 std::string getName() const noexcept;
106
112 void setName(const std::string& name) noexcept;
113
123 OTC_SDK_API unsigned short getValue(int index) const;
124
134 float getTemperature(int index) const;
135
146 OTC_SDK_API unsigned short getValue(int x, int y) const;
147
158 float getTemperature(int x, int y) const noexcept(false);
159
160
168 ConstMeasurementFieldIterator getConstIterator() const noexcept;
169
176
182 int getX() const noexcept;
183
189 int getY() const noexcept;
190
198 OTC_SDK_API void setPosition(int x, int y) noexcept;
199
205 FieldShape getShape() const noexcept;
206
212 FieldMode getMode() const noexcept;
213
219 void setMode(FieldMode mode) noexcept;
220
226 int getWidth() const noexcept;
227
233 int getHeight() const noexcept;
234
240 int getSize() const noexcept;
241
250 OTC_SDK_API void resize(int width, int height);
251
259 OTC_SDK_API void scale(int frameWidth, int frameHeight);
260
261
268
275
282
283
290
296 void setRadiationParameters(const RadiationParameters& radiation) noexcept;
297
305 RadiationParameterSource ambientTemperatureSource) noexcept;
306
307
313 float getMeanTemperature() const noexcept;
314
320 float getMinTemperature() const noexcept;
321
327 float getMaxTemperature() const noexcept;
328
334 OTC_SDK_API float getDataPoint() const noexcept;
335
343 void setTemperatures(float mean, float min, float max) noexcept;
344
345
353 TemperatureConverter getConverter() const noexcept;
354
355
361 MeasurementField clone() const noexcept;
362
372 OTC_SDK_API void setData(const unsigned short* source, int frameWidth, TemperaturePrecision precision);
373
380 OTC_SDK_API void setFromRawData(const void* source, TemperaturePrecision precision);
381
390 OTC_SDK_API void copyTemperaturesTo(float* destination, int size) const noexcept;
391
400 OTC_SDK_API void copyDataTo(unsigned short* destination, int size) const noexcept;
401
407 const unsigned short* getData() const noexcept;
408
409
410private:
413
415 long long _id;
417 int _index;
418
420 int _positionXScaled;
422 int _positionYScaled;
423
425 int _widthScaled;
427 int _heightScaled;
428
430 int _referenceFrameWidth;
432 int _referenceFrameHeight;
433
435 RadiationParameterSource _emissivitySource;
437 RadiationParameterSource _ambientTemperatureSource;
438
440 std::vector<unsigned short> _values;
441
443 float _meanTemperature;
445 float _minTemperature;
447 float _maxTemperature;
448
450 TemperatureConverter _converter;
451};
452
453
454// Inline implementations
456{
457 return _config;
458}
459
460inline long long MeasurementField::getId() const noexcept
461{
462 return _id;
463}
464
465inline int MeasurementField::getIndex() const noexcept
466{
467 return _index;
468}
469
470inline void MeasurementField::setIndex(int index) noexcept
471{
472 _index = index;
473}
474
475inline std::string MeasurementField::getName() const noexcept
476{
477 return _config.name;
478}
479
480inline void MeasurementField::setName(const std::string& name) noexcept
481{
482 _config.name = name;
483}
484
485inline float MeasurementField::getTemperature(int index) const noexcept(false)
486{
487 return _converter.toTemperature(getValue(index));
488}
489
490inline float MeasurementField::getTemperature(int x, int y) const noexcept(false)
491{
492 return _converter.toTemperature(getValue(x, y));
493}
494
495inline ConstMeasurementFieldIterator MeasurementField::getConstIterator() const noexcept
496{
497 return ConstMeasurementFieldIterator{*this};
498}
499
501{
502 return _converter.getPrecision();
503}
504
505inline int MeasurementField::getX() const noexcept
506{
507 return _positionXScaled;
508}
509
510inline int MeasurementField::getY() const noexcept
511{
512 return _positionYScaled;
513}
514
516{
517 return _config.shape;
518}
519
521{
522 return _config.mode;
523}
524
525inline void MeasurementField::setMode(FieldMode mode) noexcept
526{
527 _config.mode = mode;
528}
529
530inline int MeasurementField::getWidth() const noexcept
531{
532 return _widthScaled;
533}
534
535inline int MeasurementField::getHeight() const noexcept
536{
537 return _heightScaled;
538}
539
540inline int MeasurementField::getSize() const noexcept
541{
542 return static_cast<int>(_values.size());
543}
544
546{
547 return _emissivitySource;
548}
549
554
556{
557 return _ambientTemperatureSource;
558}
559
561{
562 return _config.radiation;
563}
564
566{
567 _config.radiation = radiation;
568}
569
571 RadiationParameterSource ambientTemperatureSource) noexcept
572{
573 _emissivitySource = emissivitySource;
574 _ambientTemperatureSource = ambientTemperatureSource;
575}
576
577inline float MeasurementField::getMeanTemperature() const noexcept
578{
579 return _meanTemperature;
580}
581
582inline float MeasurementField::getMinTemperature() const noexcept
583{
584 return _minTemperature;
585}
586
587inline float MeasurementField::getMaxTemperature() const noexcept
588{
589 return _maxTemperature;
590}
591
592inline void MeasurementField::setTemperatures(float mean, float min, float max) noexcept
593{
594 _meanTemperature = mean;
595 _minTemperature = min;
596 _maxTemperature = max;
597}
598
600{
601 return _converter;
602}
603
605{
606 return MeasurementField{*this};
607}
608
609inline const unsigned short* MeasurementField::getData() const noexcept
610{
611 return _values.data();
612}
613
614} // 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 a class encapsulating the configuration of a measurement field.
Contains a class realizing the iteration over measurement field data.
Contains a class that converts between temperatures in the internal SDK format and in °C.
Encapsulates the configuration of a measurement field.
Definition MeasurementFieldConfig.h:26
OTC_SDK_API void setFromRawData(const void *source, TemperaturePrecision precision)
Sets the field data values from raw data.
RadiationParameterSource getTransmissivitySource() const noexcept
Returns the source of the transmissivity value.
Definition MeasurementField.h:550
int getX() const noexcept
Returns the x-coordinate of the upper left corner.
Definition MeasurementField.h:505
OTC_SDK_API void scale(int frameWidth, int frameHeight)
Scales the position and dimensions of the measurement field based on new frame dimensions.
const unsigned short * getData() const noexcept
Returns a pointer to the first element of the internal value array.
Definition MeasurementField.h:609
OTC_SDK_API void resize(int width, int height)
Resizes the measurement field.
int getIndex() const noexcept
Returns the index of the measurement field.
Definition MeasurementField.h:465
int getY() const noexcept
Returns the y-coordinate of the upper left corner.
Definition MeasurementField.h:510
void setRadiationParameterSources(RadiationParameterSource emissivitySource, RadiationParameterSource ambientTemperatureSource) noexcept
Sets the sources of the radiation parameters.
Definition MeasurementField.h:570
void setRadiationParameters(const RadiationParameters &radiation) noexcept
Sets the radiation parameters stored in the measurement field.
Definition MeasurementField.h:565
OTC_SDK_API void copyTemperaturesTo(float *destination, int size) const noexcept
Copies the thermal data as degree Celsius to a one-dimensional array or vector.
MeasurementFieldConfig getConfig() const noexcept
Returns the configuration of the measurement field.
Definition MeasurementField.h:455
OTC_SDK_API unsigned short getValue(int index) const
Returns the field data value at the given index.
TemperatureConverter getConverter() const noexcept
Returns the temperature converter.
Definition MeasurementField.h:599
void setName(const std::string &name) noexcept
Sets the name of the measurement field.
Definition MeasurementField.h:480
FieldShape getShape() const noexcept
Returns the shape of the measurement field.
Definition MeasurementField.h:515
int getSize() const noexcept
Returns the overall size of the field (width * height).
Definition MeasurementField.h:540
TemperaturePrecision getTemperaturePrecision() const noexcept
Returns the precision of the temperatures stored in the measurement field.
Definition MeasurementField.h:500
int getWidth() const noexcept
Returns the width in pixels of the field.
Definition MeasurementField.h:530
FieldMode getMode() const noexcept
Returns the mode for the measurement field.
Definition MeasurementField.h:520
OTC_SDK_API float getDataPoint() const noexcept
Returns the data point specified by the the mode of this field.
OTC_SDK_API void copyDataTo(unsigned short *destination, int size) const noexcept
Copies the internal values to a one-dimensional array or vector.
RadiationParameters getRadiationParameters() const noexcept
Grants read access to the radiation parameters used to process the measurement field.
Definition MeasurementField.h:560
std::string getName() const noexcept
Returns the name of the measurement field.
Definition MeasurementField.h:475
RadiationParameterSource getEmissivitySource() const noexcept
Returns the source of the emissivity value.
Definition MeasurementField.h:545
float getMinTemperature() const noexcept
Returns the minimum temperature in the field in °C.
Definition MeasurementField.h:582
float getMaxTemperature() const noexcept
Returns the maximum temperature in the field in °C.
Definition MeasurementField.h:587
OTC_SDK_API void setData(const unsigned short *source, int frameWidth, TemperaturePrecision precision)
Sets the thermal field data values.
float getTemperature(int index) const
Returns the temperature in in °C at the given index.
Definition MeasurementField.h:485
void setIndex(int index) noexcept
Sets the index of the measurement field.
Definition MeasurementField.h:470
int getHeight() const noexcept
Returns the height in pixels of the field.
Definition MeasurementField.h:535
ConstMeasurementFieldIterator getConstIterator() const noexcept
Returns an iterator with read access.
Definition MeasurementField.h:495
void setTemperatures(float mean, float min, float max) noexcept
Sets the mean, minimum and maximum temperatures in °C.
Definition MeasurementField.h:592
OTC_SDK_API void setPosition(int x, int y) noexcept
Sets the position of the measurement field by providing the coordinates of the upper left corner.
RadiationParameterSource getAmbientTemperatureSource() const noexcept
Returns the source of the ambient temperature value.
Definition MeasurementField.h:555
MeasurementField clone() const noexcept
Returns a complete copy of this frame.
Definition MeasurementField.h:604
void setMode(FieldMode mode) noexcept
Sets the mode for the measurement field.
Definition MeasurementField.h:525
OTC_SDK_API MeasurementField() noexcept
Constructor.
long long getId() const noexcept
Returns the ID uniquely identifying the measurement field.
Definition MeasurementField.h:460
float getMeanTemperature() const noexcept
Returns the overall mean temperature of the field in °C.
Definition MeasurementField.h:577
Holds the radiation parameters for a frame or a measurement field.
Definition RadiationParameters.h:34
Converts temperatures in °C to and from their internal SDK representation.
Definition TemperatureConverter.h:23
Main SDK namespace.
Definition DeviceInfo.h:24
RadiationParameterSource
Represents the different sources of radiation parameters.
Definition RadiationParameters.h:26
@ Sdk
The radiation parameter are/can be set via the SDK.
Definition RadiationParameters.h:27
FieldShape
Represents the different available shapes of fields.
Definition FieldProperties.h:24
FieldMode
Represents the different field modes that define what data point is calculated.
Definition FieldProperties.h:30
TemperaturePrecision
Represents the available temperature precisions.
Definition TemperaturePrecision.h:32