123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef PNGREADER_H
- #define PNGREADER_H
- #include <png.h>
- #include "utils/Color.h"
- #include "utils/Error.h"
- class PNGReader final {
- const char* path;
- int width;
- int height;
- int channels;
- int bitDepth;
- int rowBytes;
- FILE* file;
- png_structp read;
- png_infop info;
- ColorChannel** rowPointers;
- public:
- PNGReader();
- ~PNGReader();
- PNGReader(const PNGReader& other) = delete;
- PNGReader(PNGReader&& other) = delete;
- PNGReader& operator=(const PNGReader& other) = delete;
- PNGReader& operator=(PNGReader&& other) = delete;
- Error load(const char* path);
- int getWidth() const;
- int getHeight() const;
- int getChannels() const;
- int getBufferSize() const;
- Error readData(ColorChannel* buffer);
- };
- #endif
|