ESPHome 2026.3.0
Loading...
Searching...
No Matches
png_decoder.h
Go to the documentation of this file.
1#pragma once
2
5#include "image_decoder.h"
6#include "runtime_image.h"
7#ifdef USE_RUNTIME_IMAGE_PNG
8#include <pngle.h>
9
10namespace esphome::runtime_image {
11
15class PngDecoder : public ImageDecoder {
16 public:
23 ~PngDecoder() override;
24
25 int prepare(size_t expected_size) override;
26 int HOT decode(uint8_t *buffer, size_t size) override;
27
28 void increment_pixels_decoded(uint32_t count) { this->pixels_decoded_ += count; }
30
31 protected:
32 pngle_t *pngle_{nullptr};
34};
35
36} // namespace esphome::runtime_image
37
38#endif // USE_RUNTIME_IMAGE_PNG
Class to abstract decoding different image formats.
Image decoder specialization for PNG images.
Definition png_decoder.h:15
int HOT decode(uint8_t *buffer, size_t size) override
PngDecoder(RuntimeImage *image)
Construct a new PNG Decoder object.
void increment_pixels_decoded(uint32_t count)
Definition png_decoder.h:28
int prepare(size_t expected_size) override
A dynamic image that can be loaded and decoded at runtime.
size_t size
Definition helpers.h:929
static void uint32_t