summaryrefslogtreecommitdiff
path: root/imagealgos.h
diff options
context:
space:
mode:
authorNikita Kostovsky <luntik2012@gmail.com>2024-11-24 19:54:52 +0100
committerNikita Kostovsky <luntik2012@gmail.com>2024-11-24 19:54:52 +0100
commit53979d9d26c5bb51e86e70eb9c3a998bc50f713c (patch)
tree4ab3fb55d37db89a8f0e61135efc69d89d2e4f11 /imagealgos.h
parente21934bca43b8dc68bbcf37e2ad1da6bd5ac6db6 (diff)
implement printer controls; implement calibration data collection
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);