ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
bmp_decoder.h
Go to the documentation of this file.
1#pragma once
2
4#ifdef USE_RUNTIME_IMAGE_BMP
5
6#include "image_decoder.h"
7#include "runtime_image.h"
8
10
14class BmpDecoder : public ImageDecoder {
15 public:
22
23 int HOT decode(uint8_t *buffer, size_t size) override;
24
25 bool is_finished() const override {
26 // BMP is finished when we've decoded all pixel data
27 return this->paint_index_ >= static_cast<size_t>(this->width_ * this->height_);
28 }
29
30 protected:
31 size_t current_index_{0};
32 size_t paint_index_{0};
35 uint16_t bits_per_pixel_{0};
37 uint32_t image_data_size_{0};
39 size_t width_bytes_{0};
40 size_t data_offset_{0};
41 uint8_t padding_bytes_{0};
42};
43
44} // namespace esphome::runtime_image
45
46#endif // USE_RUNTIME_IMAGE_BMP
Image decoder specialization for BMP images.
Definition bmp_decoder.h:14
bool is_finished() const override
Definition bmp_decoder.h:25
BmpDecoder(RuntimeImage *image)
Construct a new BMP Decoder object.
Definition bmp_decoder.h:21
int HOT decode(uint8_t *buffer, size_t size) override
Class to abstract decoding different image formats.
A dynamic image that can be loaded and decoded at runtime.
__int64 ssize_t
Definition httplib.h:178
size_t size
Definition helpers.h:729