|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Abstract base class for LCD panels. More...
Classes | |
| struct | config |
| Configuration structure for LCD panels. More... | |
Public Member Functions | |
| virtual | ~panel ()=default |
| panel (const panel &)=delete | |
| panel & | operator= (const panel &)=delete |
| esp_lcd_panel_handle_t | idf_handle () const |
| Returns the underlying ESP-IDF handle. | |
| size_t | width () const noexcept |
| Returns the panel's native width in pixels. | |
| size_t | height () const noexcept |
| Returns the panel's native height in pixels. | |
| void | draw_bitmap (int x_start, int y_start, int x_end, int y_end, const void *color_data) |
| Draws bitmap data to a region of the display. | |
| void | invert_color (bool invert) |
| Inverts the color of the display. | |
| void | swap_xy (bool swap) |
| Swaps the X and Y axes. | |
| void | mirror (bool mirror_x, bool mirror_y) |
| Mirrors the display. | |
| void | display_on (bool on) |
| Turns the display on or off. | |
| result< void > | try_draw_bitmap (int x_start, int y_start, int x_end, int y_end, const void *color_data) |
| Draws bitmap data to a region of the display. | |
| result< void > | try_invert_color (bool invert) |
| Inverts the color of the display. | |
| result< void > | try_swap_xy (bool swap) |
| Swaps the X and Y axes. | |
| result< void > | try_mirror (bool mirror_x, bool mirror_y) |
| Mirrors the display. | |
| result< void > | try_display_on (bool on) |
| Turns the display on or off. | |
Protected Member Functions | |
| panel ()=default | |
| panel (size_t width, size_t height) noexcept | |
| Constructs a panel reporting the given native dimensions. | |
| panel (panel &&) noexcept=default | |
| panel & | operator= (panel &&) noexcept=default |
| virtual esp_lcd_panel_handle_t | do_idf_handle () const =0 |
| Hook for idf_handle. | |
| virtual result< void > | do_draw_bitmap (int x_start, int y_start, int x_end, int y_end, const void *color_data) |
| Hook for try_draw_bitmap. | |
| virtual result< void > | do_invert_color (bool invert) |
| Hook for try_invert_color. | |
| virtual result< void > | do_swap_xy (bool swap) |
| Hook for try_swap_xy. | |
| virtual result< void > | do_mirror (bool mirror_x, bool mirror_y) |
| Hook for try_mirror. | |
| virtual result< void > | do_display_on (bool on) |
| Hook for try_display_on. | |
Abstract base class for LCD panels.
The public interface is non-virtual; concrete drivers (e.g. idfxx::lcd::ili9341) customize behaviour by overriding the protected do_* hooks, mirroring the standard library's non-virtual-interface pattern (cf. std::pmr::memory_resource).
|
virtualdefault |
|
delete |
|
protecteddefault |
|
inlineprotectednoexcept |
|
protecteddefaultnoexcept |
|
inline |
Turns the display on or off.
| on | true to turn on, false to turn off. |
| std::system_error | on error. |
Definition at line 145 of file panel.hpp.
References try_display_on(), and idfxx::unwrap().
|
protectedvirtual |
Hook for try_display_on.
The default implementation switches the display via the panel handle returned by do_idf_handle().
Referenced by try_display_on().
|
protectedvirtual |
Hook for try_draw_bitmap.
The default implementation draws via the panel handle returned by do_idf_handle().
Referenced by try_draw_bitmap().
|
protectedpure virtual |
Hook for idf_handle.
Referenced by idf_handle().
|
protectedvirtual |
Hook for try_invert_color.
The default implementation inverts via the panel handle returned by do_idf_handle().
Referenced by try_invert_color().
|
protectedvirtual |
Hook for try_mirror.
The default implementation mirrors via the panel handle returned by do_idf_handle().
Referenced by try_mirror().
|
protectedvirtual |
Hook for try_swap_xy.
The default implementation swaps via the panel handle returned by do_idf_handle().
Referenced by try_swap_xy().
|
inline |
Draws bitmap data to a region of the display.
The region is end-exclusive: it spans columns [x_start, x_end) and rows [y_start, y_end). The buffer layout of color_data is panel-specific (e.g. RGB565 pixels for color panels, page-packed 1-bpp data for monochrome OLEDs); consult the concrete driver's documentation.
| x_start | Start column, inclusive. |
| y_start | Start row, inclusive. |
| x_end | End column, exclusive. |
| y_end | End row, exclusive. |
| color_data | Pixel data in the panel's native format. |
| std::system_error | on error. |
Definition at line 110 of file panel.hpp.
References try_draw_bitmap(), and idfxx::unwrap().
|
inlinenoexcept |
|
inline |
Returns the underlying ESP-IDF handle.
Definition at line 71 of file panel.hpp.
References do_idf_handle().
|
inline |
Inverts the color of the display.
| invert | true to invert colors, false for normal. |
| std::system_error | on error. |
Definition at line 120 of file panel.hpp.
References try_invert_color(), and idfxx::unwrap().
|
inline |
Mirrors the display.
| mirror_x | true to mirror horizontally. |
| mirror_y | true to mirror vertically. |
| std::system_error | on error. |
Definition at line 137 of file panel.hpp.
References try_mirror(), and idfxx::unwrap().
|
inline |
Swaps the X and Y axes.
| swap | true to swap, false for normal. |
| std::system_error | on error. |
Definition at line 128 of file panel.hpp.
References try_swap_xy(), and idfxx::unwrap().
|
inline |
Turns the display on or off.
| on | true to turn on, false to turn off. |
Definition at line 194 of file panel.hpp.
References do_display_on().
Referenced by display_on().
|
inline |
Draws bitmap data to a region of the display.
The region is end-exclusive: it spans columns [x_start, x_end) and rows [y_start, y_end). The buffer layout of color_data is panel-specific (e.g. RGB565 pixels for color panels, page-packed 1-bpp data for monochrome OLEDs); consult the concrete driver's documentation.
| x_start | Start column, inclusive. |
| y_start | Start row, inclusive. |
| x_end | End column, exclusive. |
| y_end | End row, exclusive. |
| color_data | Pixel data in the panel's native format. |
Definition at line 163 of file panel.hpp.
References do_draw_bitmap().
Referenced by draw_bitmap(), idfxx::lcd::mono_framebuffer::try_flush(), idfxx::lcd::rgb565_framebuffer::try_flush(), idfxx::lcd::mono_framebuffer::try_flush_region(), and idfxx::lcd::rgb565_framebuffer::try_flush_region().
|
inline |
Inverts the color of the display.
| invert | true to invert colors, false for normal. |
Definition at line 172 of file panel.hpp.
References do_invert_color().
Referenced by invert_color().
|
inline |
Mirrors the display.
| mirror_x | true to mirror horizontally. |
| mirror_y | true to mirror vertically. |
Definition at line 187 of file panel.hpp.
References do_mirror().
Referenced by mirror().
|
inline |
Swaps the X and Y axes.
| swap | true to swap, false for normal. |
Definition at line 179 of file panel.hpp.
References do_swap_xy().
Referenced by swap_xy().
|
inlinenoexcept |