ESPHome  2024.11.3
Public Member Functions | Protected Attributes
esphome::online_image::PngDecoder Class Reference

Image decoder specialization for PNG images. More...

#include <png_image.h>

Inheritance diagram for esphome::online_image::PngDecoder:
esphome::online_image::ImageDecoder

Public Member Functions

 PngDecoder (OnlineImage *image)
 Construct a new PNG Decoder object. More...
 
 ~PngDecoder () override
 
void prepare (uint32_t download_size) override
 
int HOT decode (uint8_t *buffer, size_t size) override
 
- Public Member Functions inherited from esphome::online_image::ImageDecoder
 ImageDecoder (OnlineImage *image)
 Construct a new Image Decoder object. More...
 
virtual ~ImageDecoder ()=default
 
void set_size (int width, int height)
 Request the image to be resized once the actual dimensions are known. More...
 
void draw (int x, int y, int w, int h, const Color &color)
 Draw a rectangle on the display_buffer using the defined color. More...
 
bool is_finished () const
 

Protected Attributes

pngle_t * pngle_
 
- Protected Attributes inherited from esphome::online_image::ImageDecoder
OnlineImageimage_
 
uint32_t download_size_ = 1
 
uint32_t decoded_bytes_ = 0
 
double x_scale_ = 1.0
 
double y_scale_ = 1.0
 

Detailed Description

Image decoder specialization for PNG images.

Definition at line 13 of file png_image.h.

Constructor & Destructor Documentation

◆ PngDecoder()

esphome::online_image::PngDecoder::PngDecoder ( OnlineImage image)
inline

Construct a new PNG Decoder object.

Parameters
displayThe image to decode the stream into.

Definition at line 20 of file png_image.h.

◆ ~PngDecoder()

esphome::online_image::PngDecoder::~PngDecoder ( )
inlineoverride

Definition at line 21 of file png_image.h.

Member Function Documentation

◆ decode()

int HOT esphome::online_image::PngDecoder::decode ( uint8_t *  buffer,
size_t  size 
)
overridevirtual

Reimplemented from esphome::online_image::ImageDecoder.

Definition at line 51 of file png_image.cpp.

◆ prepare()

void esphome::online_image::PngDecoder::prepare ( uint32_t  download_size)
overridevirtual

Reimplemented from esphome::online_image::ImageDecoder.

Definition at line 44 of file png_image.cpp.

Field Documentation

◆ pngle_

pngle_t* esphome::online_image::PngDecoder::pngle_
protected

Definition at line 27 of file png_image.h.


The documentation for this class was generated from the following files: