2023-07-30 16:00:55 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
struct ImageLoaderI {
|
|
|
|
virtual ~ImageLoaderI(void) {}
|
|
|
|
|
|
|
|
struct ImageInfo {
|
|
|
|
uint32_t width {0};
|
|
|
|
uint32_t height {0};
|
2023-10-04 02:11:06 +02:00
|
|
|
const char* file_ext {nullptr};
|
2023-07-30 16:00:55 +02:00
|
|
|
};
|
|
|
|
virtual ImageInfo loadInfoFromMemory(const uint8_t* data, uint64_t data_size) = 0;
|
|
|
|
|
|
|
|
struct ImageResult {
|
|
|
|
uint32_t width {0};
|
|
|
|
uint32_t height {0};
|
|
|
|
struct Frame {
|
|
|
|
int32_t ms {0};
|
|
|
|
std::vector<uint8_t> data;
|
|
|
|
};
|
|
|
|
std::vector<Frame> frames;
|
2023-10-04 02:11:06 +02:00
|
|
|
const char* file_ext {nullptr};
|
2023-07-30 16:00:55 +02:00
|
|
|
};
|
|
|
|
virtual ImageResult loadFromMemoryRGBA(const uint8_t* data, uint64_t data_size) = 0;
|
|
|
|
};
|
|
|
|
|