hack in compressor types for sip + a bunch of refactoring and fixes

This commit is contained in:
2023-10-09 21:17:00 +02:00
parent 62b00a4bd6
commit c24dc45e93
6 changed files with 94 additions and 49 deletions

View File

@@ -8,14 +8,14 @@
struct ImageLoaderI {
virtual ~ImageLoaderI(void) {}
struct ImageInfo {
struct ImageInfo final {
uint32_t width {0};
uint32_t height {0};
const char* file_ext {nullptr};
};
virtual ImageInfo loadInfoFromMemory(const uint8_t* data, uint64_t data_size) = 0;
struct ImageResult {
struct ImageResult final {
uint32_t width {0};
uint32_t height {0};
struct Frame {
@@ -24,6 +24,9 @@ struct ImageLoaderI {
};
std::vector<Frame> frames;
const char* file_ext {nullptr};
// only positive values are valid
ImageResult crop(int32_t c_x, int32_t c_y, int32_t c_w, int32_t c_h) const;
};
virtual ImageResult loadFromMemoryRGBA(const uint8_t* data, uint64_t data_size) = 0;
};