Выделил переиспользуемые модули из проекта.
This commit is contained in:
parent
3fe2a87e35
commit
7c83d9c93e
15 changed files with 287 additions and 207 deletions
43
image-lib/pixelarray.h
Normal file
43
image-lib/pixelarray.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <utils-lib/utils.h>
|
||||
|
||||
#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 &);
|
Loading…
Add table
Add a link
Reference in a new issue