33 virtual int prepare(
size_t expected_size) {
59 bool set_size(
int width,
int height);
73 void draw(
int x,
int y,
int w,
int h,
const Color &color);
Class to abstract decoding different image formats.
virtual bool is_finished() const
Check if the decoder has finished processing.
virtual ~ImageDecoder()=default
virtual int decode(uint8_t *buffer, size_t size)=0
Decode a part of the image.
void draw(int x, int y, int w, int h, const Color &color)
Fill a rectangle on the display_buffer using the defined color.
ImageDecoder(RuntimeImage *image)
Construct a new Image Decoder object.
bool set_size(int width, int height)
Request the image to be resized once the actual dimensions are known.
virtual int prepare(size_t expected_size)
Initialize the decoder.
A dynamic image that can be loaded and decoded at runtime.
@ DECODE_ERROR_OUT_OF_MEMORY
@ DECODE_ERROR_UNSUPPORTED_FORMAT
@ DECODE_ERROR_INVALID_TYPE