Image decoder specialization for QOI images.
More...
#include <qoi_decoder.h>
|
| | QoiDecoder (RuntimeImage *image) |
| | Construct a new QOI decoder object.
|
| |
| void | reset () override |
| |
| int HOT | decode (uint8_t *buffer, size_t size) override |
| |
| bool | knows_end () const override |
| | The header gives the pixel count, so the end is known once it has been parsed.
|
| |
| bool | is_finished () const override |
| |
| | ImageDecoder (RuntimeImage *image, ImageFormat format) |
| | Construct a new Image Decoder object.
|
| |
| virtual | ~ImageDecoder ()=default |
| |
| ImageFormat | get_format () const |
| | Get the image format handled by this decoder.
|
| |
| bool | is_active () const |
| | Check if a decoding session is in progress (prepare() called, reset() not yet).
|
| |
| virtual int | prepare (size_t expected_size) |
| | Initialize the decoder, starting a new decoding session.
|
| |
| bool | set_size (int width, int height) |
| | Request the image to be resized once the actual dimensions are known.
|
| |
| void | draw (int x, int y, int w, int h, const Color &color) |
| | Fill a rectangle on the display_buffer using the defined color.
|
| |
Image decoder specialization for QOI images.
Definition at line 16 of file qoi_decoder.h.
◆ QoiDecoder()
| esphome::runtime_image::QoiDecoder::QoiDecoder |
( |
RuntimeImage * | image | ) |
|
|
inline |
Construct a new QOI decoder object.
- Parameters
-
Definition at line 23 of file qoi_decoder.h.
◆ decode()
| int HOT esphome::runtime_image::QoiDecoder::decode |
( |
uint8_t * | buffer, |
|
|
size_t | size ) |
|
overridevirtual |
QOI Header definition, for reference: char magic[4]; // magic bytes "qoif" uint32_t width; // image width in pixels (BE) uint32_t height; // image height in pixels (BE) uint8_t channels; // 3 = RGB, 4 = RGBA uint8_t colorspace; // 0 = sRGB with linear alpha, 1 = all channels linear
Implements esphome::runtime_image::ImageDecoder.
Definition at line 51 of file qoi_decoder.cpp.
◆ is_finished()
| bool esphome::runtime_image::QoiDecoder::is_finished |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ knows_end()
| bool esphome::runtime_image::QoiDecoder::knows_end |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ reset()
| void esphome::runtime_image::QoiDecoder::reset |
( |
| ) |
|
|
overridevirtual |
◆ bits_per_pixel_
| uint16_t esphome::runtime_image::QoiDecoder::bits_per_pixel_ {0} |
|
protected |
◆ color_table_
| std::unique_ptr<Color[]> esphome::runtime_image::QoiDecoder::color_table_ |
|
protected |
◆ current_index_
| size_t esphome::runtime_image::QoiDecoder::current_index_ {0} |
|
protected |
◆ height_
| size_t esphome::runtime_image::QoiDecoder::height_ {0} |
|
protected |
◆ last_pixel_
| Color esphome::runtime_image::QoiDecoder::last_pixel_ {0, 0, 0, 255} |
|
protected |
◆ paint_index_
| size_t esphome::runtime_image::QoiDecoder::paint_index_ {0} |
|
protected |
◆ width_
| size_t esphome::runtime_image::QoiDecoder::width_ {0} |
|
protected |
The documentation for this class was generated from the following files: