cpp-bmp-reader/image-lib/pixelarray.h

44 lines
No EOL
896 B
C++

#pragma once
#include <cstdint>
#include <utils-lib/utils.h>
static_assert(true);
#pragma pack(push, 1)
struct Pixel {
uint8_t r = 255;
uint8_t g = 0;
uint8_t b = 255;
};
#pragma pack(pop)
class PixelArray {
Pixel **array;
uint32_t _width;
uint32_t _height;
public:
PixelArray(uint32_t width, uint32_t height);
PixelArray(const PixelArray &);
~PixelArray();
[[nodiscard]] const uint32_t &width() const;
[[nodiscard]] const uint32_t &height() const;
Pixel &operator()(const uint32_t &, const uint32_t &);
Pixel *&operator()(const uint32_t &);
};
Pixel operator/(const Pixel &, const uint8_t &);
Pixel operator+(const Pixel &, const Pixel &);
Pixel operator*(const Pixel &, const int &);
Pixel operator-(const Pixel &, const uint8_t &);
Pixel operator-(const uint8_t &, const Pixel &);
Pixel operator-(const Pixel &, const Pixel &);