diff options
| author | Nikita Kostovsky <luntik2012@gmail.com> | 2024-11-09 17:26:11 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <luntik2012@gmail.com> | 2024-11-09 17:26:11 +0100 |
| commit | 053237b9c91f1b5892782c1c4b2eb50cc8aeadfd (patch) | |
| tree | ab3d3d2e896c7c71228bdb62c4fd4364a1364347 /imagealgos.h | |
Initial commit
Diffstat (limited to 'imagealgos.h')
| -rw-r--r-- | imagealgos.h | 29 |
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); |
