14#include "sensorring/platform/SensorringExport.hpp"
26namespace measurement {
32template <
typename T, std::
size_t RESOLUTION>
struct SENSORRING_EXPORT
ScalarImage {
33 static_assert(std::is_arithmetic<T>::value,
"T must be an arithmetic type");
36 std::array<T, RESOLUTION>
data = {};
105template <
typename T, std::
size_t RESOLUTION>
struct SENSORRING_EXPORT
RgbImage {
106 static_assert(std::is_arithmetic<T>::value,
"T must be an arithmetic type");
109 std::array<std::array<T, 3>, RESOLUTION>
data = {};
static constexpr unsigned int THERMAL_RESOLUTION
Thermal image resolution constant (32x32).
Definition Image.hpp:21
static constexpr unsigned int MAX_MSG_LENGTH
Maximum message length in bytes.
Definition Image.hpp:24
Template for images with three channels (R, G, B) and variable arithmetic type.
Definition Image.hpp:105
void copyTo(T *buffer, int size)
Copy image data to a pre-allocated buffer (flattened: R,G,B,R,G,B,...).
std::array< std::array< T, 3 >, RESOLUTION > data
Internal data structure for the image.
Definition Image.hpp:109
Template for images with one scalar value per pixel and variable arithmetic type.
Definition Image.hpp:32
ScalarImage & operator+=(const ScalarImage &other)
Add two ScalarImage images pixel wise.
ScalarImage & operator+=(const ScalarImage< U, RESOLUTION > &other)
Add two ScalarImage images of different data types pixel wise.
ScalarImage & operator/=(const T other)
Divide each pixel by the same value.
ScalarImage & operator-=(const ScalarImage &other)
Subtract two ScalarImage images pixel wise.
ScalarImage & round()
Round each pixel value when a floating point type is used.
ScalarImage & operator-=(const T other)
Subtract the same value from each pixel.
std::array< T, RESOLUTION > data
Internal data structure for the image.
Definition Image.hpp:36
double avg()
Calculate the average over all pixels.
ScalarImage & operator-=(const ScalarImage< U, RESOLUTION > &other)
Subtract two ScalarImage images of different data types pixel wise.
ScalarImage & operator+=(const T other)
Add the same value to each pixel.
void copyTo(T *buffer, int size)
Copy image data to a pre-allocated buffer.