ESPHome  2025.2.0
bmp_image.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "esphome/core/defines.h"
4 #ifdef USE_ONLINE_IMAGE_BMP_SUPPORT
5 
6 #include "image_decoder.h"
7 
8 namespace esphome {
9 namespace online_image {
10 
14 class BmpDecoder : public ImageDecoder {
15  public:
21  BmpDecoder(OnlineImage *image) : ImageDecoder(image) {}
22 
23  int HOT decode(uint8_t *buffer, size_t size) override;
24 
25  protected:
26  size_t current_index_{0};
27  ssize_t width_{0};
28  ssize_t height_{0};
29  uint16_t bits_per_pixel_{0};
30  uint32_t compression_method_{0};
31  uint32_t image_data_size_{0};
32  uint32_t color_table_entries_{0};
33  size_t width_bytes_{0};
34  size_t data_offset_{0};
35 };
36 
37 } // namespace online_image
38 } // namespace esphome
39 
40 #endif // USE_ONLINE_IMAGE_BMP_SUPPORT
int HOT decode(uint8_t *buffer, size_t size) override
Definition: bmp_image.cpp:14
BmpDecoder(OnlineImage *image)
Construct a new BMP Decoder object.
Definition: bmp_image.h:21
Download an image from a given URL, and decode it using the specified decoder.
Definition: online_image.h:39
Class to abstract decoding different image formats.
Definition: image_decoder.h:18
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Image decoder specialization for PNG images.
Definition: bmp_image.h:14