ImageReader.h 506 B

1234567891011121314151617181920212223242526
  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. Image();
  13. Cleaner<ColorChannel*, clean> data;
  14. unsigned int width;
  15. unsigned int height;
  16. unsigned int channels;
  17. unsigned int bitdepth;
  18. };
  19. Error load(Image& image, const char* path);
  20. }
  21. #endif