summaryrefslogtreecommitdiff
path: root/imagealgos.h
diff options
context:
space:
mode:
Diffstat (limited to 'imagealgos.h')
-rw-r--r--imagealgos.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/imagealgos.h b/imagealgos.h
new file mode 100644
index 0000000..b1efc87
--- /dev/null
+++ b/imagealgos.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <cstddef>
+#include <cstdio>
+
+#include <libcamera/pixel_format.h>
+
+constexpr size_t img_width = 1280;
+constexpr size_t img_height = 800;
+
+struct Image
+{
+ int width;
+ int height;
+ uint16_t data[img_height][img_width];
+ uint16_t rotated_cw[img_width][img_height];
+ size_t dataSize;
+ unsigned int stride;
+ libcamera::PixelFormat pixelFormat;
+ float pixels[img_width];
+};
+
+size_t pgm_save(Image *img, FILE *outfile, bool really_save = true);
+
+void unpack_10bit(uint8_t const *src, Image const &image, uint16_t *dest);
+void unpack_16bit(uint8_t const *src, Image const &image, uint16_t *dest);
+
+void rotate(Image & image);
+void process_columns(Image & image);