ESPHome 2026.3.0-dev
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; }
29 uint32_t get_pixels_decoded() const { return this->pixels_decoded_; }
30
31 protected:
33 pngle_t *pngle_{nullptr};
34 uint32_t pixels_decoded_{0};
35};
36
37} // namespace esphome::runtime_image
38
39#endif // USE_RUNTIME_IMAGE_PNG
An STL allocator that uses SPI or internal RAM.
Definition helpers.h:1665
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
RAMAllocator< pngle_t > allocator_
Definition png_decoder.h:32
int prepare(size_t expected_size) override
A dynamic image that can be loaded and decoded at runtime.
size_t size
Definition helpers.h:729