EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
Image.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <array>
13
14#include "sensorring/platform/SensorringExport.hpp"
15
16namespace eduart {
17
19static constexpr unsigned int THERMAL_RESOLUTION = 1024;
20
22static constexpr unsigned int MAX_MSG_LENGTH = 64;
23
24namespace measurement {
25
30template <typename T, std::size_t RESOLUTION> struct SENSORRING_EXPORT GenericGrayscaleImage {
31 static_assert(std::is_arithmetic<T>::value, "T must be an arithmetic type");
32
34 std::array<T, RESOLUTION> data = {};
35
42 void copyTo(T* buffer, int size);
43
48 double avg();
49
55
61
67
73
79
85
91
97};
98
103template <typename T, std::size_t RESOLUTION> struct SENSORRING_EXPORT GenericRGBImage {
104 static_assert(std::is_arithmetic<T>::value, "T must be an arithmetic type");
105
107 std::array<std::array<T, 3>, RESOLUTION> data = {};
108
115 void copyTo(T* buffer, int size);
116};
117
118} // namespace measurement
119
120} // namespace eduart
static constexpr unsigned int THERMAL_RESOLUTION
Thermal image resolution constant (32x32).
Definition Image.hpp:19
static constexpr unsigned int MAX_MSG_LENGTH
Maximum message length in bytes.
Definition Image.hpp:22
Template for images with one channel and variable type.
Definition Image.hpp:30
GenericGrayscaleImage & operator-=(const GenericGrayscaleImage &other)
Subtract two GrayScaleImage images pixel wise.
GenericGrayscaleImage & operator+=(const T other)
Add the same value to each pixel.
GenericGrayscaleImage & operator-=(const GenericGrayscaleImage< U, RESOLUTION > &other)
Subtract two GrayScaleImage images of different data types pixel wise.
GenericGrayscaleImage & operator+=(const GenericGrayscaleImage &other)
Add two GrayScaleImage images pixel wise.
double avg()
Calculate the average over all pixels.
GenericGrayscaleImage & round()
Round each pixel value when a floating point type is used.
GenericGrayscaleImage & operator+=(const GenericGrayscaleImage< U, RESOLUTION > &other)
Add two GrayScaleImage images of different data types pixel wise.
void copyTo(T *buffer, int size)
Copy image data to a pre-allocated buffer.
GenericGrayscaleImage & operator-=(const T other)
Subtract the same value from each pixel.
GenericGrayscaleImage & operator/=(const T other)
Divide each pixel by the same value.
std::array< T, RESOLUTION > data
Internal data structure for the image.
Definition Image.hpp:34
Template for images with three channels and variable type.
Definition Image.hpp:103
std::array< std::array< T, 3 >, RESOLUTION > data
Internal data structure for the image.
Definition Image.hpp:107
void copyTo(T *buffer, int size)
Copy image data to a pre-allocated buffer (flattened: R,G,B,R,G,B,...).