ImageReader.h 489 B

12345678910111213141516171819202122232425
  1. #ifndef IMAGEREADER_H
  2. #define IMAGEREADER_H
  3. #include "utils/Cleaner.h"
  4. #include "utils/Color.h"
  5. #include "utils/Error.h"
  6. namespace ImageReader {
  7. class Image final {
  8. static void clean(ColorChannel*& c) {
  9. free(c);
  10. }
  11. public:
  12. Cleaner<ColorChannel*, clean> data;
  13. unsigned int width;
  14. unsigned int height;
  15. unsigned int channels;
  16. unsigned int bitdepth;
  17. };
  18. Error load(Image& image, const char* path);
  19. }
  20. #endif