ESPHome 2026.10.0-dev
Loading...
Searching...
No Matches
snapshot_display.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_HOST
7
8namespace esphome::snapshot {
9
13class SnapshotDisplay final : public display::DisplayBuffer, public Snapshot {
14 public:
15 void setup() override;
16 void update() override { this->do_update_(); }
17 void dump_config() override;
18 float get_setup_priority() const override { return setup_priority::HARDWARE; }
20
21 void set_dimensions(uint16_t width, uint16_t height) {
22 this->width_ = width;
23 this->height_ = height;
24 }
25
26 void draw_pixels_at(int x_start, int y_start, int w, int h, const uint8_t *ptr, display::ColorOrder order,
27 display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) override;
28
29 protected:
30 void draw_absolute_pixel_internal(int x, int y, Color color) override;
31 int get_width_internal() override { return this->width_; }
32 int get_height_internal() override { return this->height_; }
33
34 int snapshot_width() override { return this->width_; }
35 int snapshot_height() override { return this->height_; }
36 bool capture_bgr(uint8_t *dest, size_t row_stride) override;
37
40 uint16_t *pixels_() { return reinterpret_cast<uint16_t *>(this->buffer_); }
41
42 int width_{};
43 int height_{};
44};
45
46} // namespace esphome::snapshot
47
48#endif
uint8_t h
Definition bl0906.h:2
A display with nowhere to show anything: it keeps the picture in memory, where the snapshot action ca...
bool capture_bgr(uint8_t *dest, size_t row_stride) override
display::DisplayType get_display_type() override
void draw_pixels_at(int x_start, int y_start, int w, int h, const uint8_t *ptr, display::ColorOrder order, display::ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) override
uint16_t * pixels_()
The picture, one 16 bit RGB565 value per pixel, topmost row first.
void set_dimensions(uint16_t width, uint16_t height)
float get_setup_priority() const override
void draw_absolute_pixel_internal(int x, int y, Color color) override
Base for anything that can hand over the picture it is showing so it can be written to a file.
Definition snapshot.h:23
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:43
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6