summaryrefslogtreecommitdiff
path: root/imagealgos.h
diff options
context:
space:
mode:
Diffstat (limited to 'imagealgos.h')
-rw-r--r--imagealgos.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/imagealgos.h b/imagealgos.h
index bf5611a..77ac625 100644
--- a/imagealgos.h
+++ b/imagealgos.h
@@ -1,5 +1,6 @@
#pragma once
+#include <array>
#include <cstddef>
#include <cstdio>
@@ -9,6 +10,13 @@ constexpr size_t img_width = 1280;
constexpr size_t img_height = 800;
constexpr uint32_t patternSize = 16;
+struct Counters
+{
+ uint32_t timestampUs { 0 };
+ uint32_t measurementCounter { 0 };
+ int32_t encoderPosition { 0 };
+};
+
struct Image
{
int width;
@@ -18,9 +26,17 @@ struct Image
size_t dataSize;
unsigned int stride;
libcamera::PixelFormat pixelFormat;
- float pixels[img_width];
- unsigned int measurementCounter;
- uint64_t timestampNs;
+ // float pixels[img_width];
+ Counters counters {};
+ // unsigned int measurementCounter;
+ // uint32_t timestampUs;
+ // int32_t encoderPosition;
+};
+
+struct Pixels
+{
+ Counters counters {};
+ std::array<float, img_width> pixels { 0.f };
};
size_t pgm_save(Image *img, FILE *outfile, bool really_save = false);
@@ -35,4 +51,4 @@ T median3(const T& a, const T& b, const T& c) {
}
void rotate(Image & image);
-void process_columns(Image & image);
+Pixels process_columns(Image & image);