diff options
Diffstat (limited to 'src/image.h')
| -rw-r--r-- | src/image.h | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/src/image.h b/src/image.h index 7a7ba31..d6fec04 100644 --- a/src/image.h +++ b/src/image.h @@ -5,34 +5,39 @@ #include <memory> #include <string> -struct Pixel +namespace TehImage { - uint8_t r, g, b, a; -}; -class Image -{ -protected: - std::unique_ptr<Pixel[]> pixels; - // uint8_t* imageData; - uint8_t colorValues; - uint8_t bpp; -public: - Image() = default; - - // template<std::derived_from<Image> T> - Image(const Image& other); - - virtual int readFromFile(std::string filename) = 0; - virtual int writeToFile(std::string filename) = 0; + struct Pixel + { + uint8_t r, g, b, a; + }; + + class Image + { + protected: + std::unique_ptr<Pixel[]> pixels; + // uint8_t* imageData; + uint8_t colorValues; + uint8_t bpp; + public: + Image() = default; + + // template<std::derived_from<Image> T> + Image(const Image& other); + + virtual int readFromFile(std::string filename) = 0; + virtual int writeToFile(std::string filename) = 0; - Pixel& operator[](int x, int y); - - uint32_t width = 0; - uint32_t height = 0; - uint8_t bitDepth; - uint8_t colorType; - uint8_t compressionMethod; - uint8_t filterMethod; - uint8_t interlaceMethod; -}; + Pixel& operator[](int x, int y); + + uint32_t width = 0; + uint32_t height = 0; + uint8_t bitDepth; + uint8_t colorType; + uint8_t compressionMethod; + uint8_t filterMethod; + uint8_t interlaceMethod; + }; + +} |
