summaryrefslogtreecommitdiff
path: root/src/image.h
blob: 934aa4006d3d66515111643df544616d2cfa4306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include "constants.h"
#include "typedefs.h"

class Pixels;

// TODO: template
struct Image
{
    int width{0};
    int height{0};
    uint8_t data[img_height][img_width] = {{0}};
    uint8_t rotated_cw[img_width][img_height] = {{0}};
    // size_t dataSize{0};
    // unsigned int stride{0};
    libcamera::PixelFormat pixelFormat{0};
    Counters counters{};

    void rotate();
    std::shared_ptr<Pixels> pixels() const;
    void copyFromData(const void* src, size_t size);
};