47 image::Image *placeholder =
nullptr,
bool is_big_endian =
false,
int fixed_width = 0,
48 int fixed_height = 0);
66 int resize(
int width,
int height);
An STL allocator that uses SPI or internal RAM.
A dynamic image that can be loaded and decoded at runtime.
size_t get_buffer_size_(int width, int height) const
Get the buffer size in bytes for given dimensions.
bool is_loaded() const
Check if an image is currently loaded.
RAMAllocator< uint8_t > allocator_
bool is_decoding() const
Check if decoding is currently in progress.
bool is_big_endian_
Whether the image is stored in big-endian format.
void draw(int x, int y, display::Display *display, Color color_on, Color color_off) override
int buffer_width_
Actual width of the current image.
bool end_decode()
Complete the decoding process.
int get_buffer_height() const
void set_progressive_display(bool progressive)
Set whether to allow progressive display during decode.
int get_position_(int x, int y) const
Get the position in the buffer for a pixel.
const int fixed_height_
Fixed height requested on configuration, or 0 if not specified.
void release_buffer_()
Release only the image buffer without resetting the decoder.
int resize(int width, int height)
Resize the image buffer to the requested dimensions.
int feed_data(uint8_t *data, size_t len)
Feed data to the decoder.
const int fixed_width_
Fixed width requested on configuration, or 0 if not specified.
bool is_decode_finished() const
Check if the decoder has finished processing all data.
void release()
Release the image buffer and free memory.
image::Image * placeholder_
Placeholder image to show when the runtime image is not available.
RuntimeImage(ImageFormat format, image::ImageType type, image::Transparency transparency, image::Image *placeholder=nullptr, bool is_big_endian=false, int fixed_width=0, int fixed_height=0)
Construct a new RuntimeImage object.
ImageFormat get_format() const
Get the image format.
const ImageFormat format_
The image format this RuntimeImage is configured to decode.
int get_buffer_width() const
size_t resize_buffer_(int width, int height)
Resize the image buffer to the requested dimensions.
std::unique_ptr< ImageDecoder > decoder_
bool progressive_display_
std::unique_ptr< ImageDecoder > create_decoder_()
Create decoder instance for the image's format.
void draw_pixel(int x, int y, const Color &color)
int buffer_height_
Actual height of the current image.
bool begin_decode(size_t expected_size=0)
Begin decoding an image.
void map_chroma_key(Color &color)
ImageFormat
Image format types that can be decoded dynamically.
@ AUTO
Automatically detect from data.