|
ESPHome 2026.11.0-dev
|
#include <display.h>
Public Member Functions | |
| virtual void | fill (Color color) |
| Fill the entire screen with the given color. | |
| virtual void | clear () |
| Clear the entire screen by filling it with OFF pixels. | |
| virtual int | get_width () |
| Get the calculated width of the display in pixels with rotation applied. | |
| virtual int | get_height () |
| Get the calculated height of the display in pixels with rotation applied. | |
| int | get_native_width () |
| Get the native (original) width of the display in pixels. | |
| int | get_native_height () |
| Get the native (original) height of the display in pixels. | |
| void | draw_pixel_at (int x, int y) |
| Set a single pixel at the specified coordinates to default color. | |
| virtual void | draw_pixel_at (int x, int y, Color color)=0 |
| Set a single pixel at the specified coordinates to the given color. | |
| void | draw_pixels_at (int x_start, int y_start, int w, int h, const uint8_t *ptr, ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) |
| Given an array of pixels encoded in the nominated format, draw these into the display's buffer. | |
| void | draw_pixels_at (int x_start, int y_start, int w, int h, const uint8_t *ptr, ColorBitness bitness, bool big_endian) |
| Convenience overload for base case where the pixels are packed into the buffer with no gaps (e.g. suits LVGL.) | |
| ESPDEPRECATED ("Pixels are always RGB: call draw_pixels_at() without the ColorOrder, and override draw_pixels_internal() " "to copy blocks. Removed in 2027.5.0", "2026.11.0") virtual void draw_pixels_at(int x_start | |
| The block form above with a color order. | |
| ESPDEPRECATED ("Pixels are always RGB, drop the ColorOrder argument. Removed in 2027.5.0", "2026.11.0") void draw_pixels_at(int x_start | |
| void | line (int x1, int y1, int x2, int y2, Color color=COLOR_ON) |
| Draw a straight line from the point [x1,y1] to [x2,y2] with the given color. | |
| void | line_at_angle (int x, int y, int angle, int length, Color color=COLOR_ON) |
| Draw a straight line at the given angle based on the origin [x, y] for a specified length with the given color. | |
| void | line_at_angle (int x, int y, int angle, int start_radius, int stop_radius, Color color=COLOR_ON) |
| Draw a straight line at the given angle based on the origin [x, y] from a specified start and stop radius with the given color. | |
| void | horizontal_line (int x, int y, int width, Color color=COLOR_ON) |
| Draw a horizontal line from the point [x,y] to [x+width,y] with the given color. | |
| void | vertical_line (int x, int y, int height, Color color=COLOR_ON) |
| Draw a vertical line from the point [x,y] to [x,y+width] with the given color. | |
| void | rectangle (int x1, int y1, int width, int height, Color color=COLOR_ON) |
| Draw the outline of a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height]. | |
| void | filled_rectangle (int x1, int y1, int width, int height, Color color=COLOR_ON) |
| Fill a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height]. | |
| void | circle (int center_x, int center_xy, int radius, Color color=COLOR_ON) |
| Draw the outline of a circle centered around [center_x,center_y] with the radius radius with the given color. | |
| void | filled_circle (int center_x, int center_y, int radius, Color color=COLOR_ON) |
| Fill a circle centered around [center_x,center_y] with the radius radius with the given color. | |
| void | filled_ring (int center_x, int center_y, int radius1, int radius2, Color color=COLOR_ON) |
| Fill a ring centered around [center_x,center_y] between two circles with the radius1 and radius2 with the given color. | |
| void | filled_gauge (int center_x, int center_y, int radius1, int radius2, int progress, Color color=COLOR_ON) |
| Fill a half-ring "gauge" centered around [center_x,center_y] between two circles with the radius1 and radius2 with he given color and filled up to 'progress' percent. | |
| void | triangle (int x1, int y1, int x2, int y2, int x3, int y3, Color color=COLOR_ON) |
| Draw the outline of a triangle contained between the points [x1,y1], [x2,y2] and [x3,y3] with the given color. | |
| void | filled_triangle (int x1, int y1, int x2, int y2, int x3, int y3, Color color=COLOR_ON) |
| Fill a triangle contained between the points [x1,y1], [x2,y2] and [x3,y3] with the given color. | |
| void | get_regular_polygon_vertex (int vertex_id, int *vertex_x, int *vertex_y, int center_x, int center_y, int radius, int edges, RegularPolygonVariation variation=VARIATION_POINTY_TOP, float rotation_degrees=ROTATION_0_DEGREES) |
| Get the specified vertex (x,y) coordinates for the regular polygon inscribed in the circle centered on [center_x,center_y] with the given radius. | |
| void | regular_polygon (int x, int y, int radius, int edges, RegularPolygonVariation variation=VARIATION_POINTY_TOP, float rotation_degrees=ROTATION_0_DEGREES, Color color=COLOR_ON, RegularPolygonDrawing drawing=DRAWING_OUTLINE) |
| Draw the outline of a regular polygon inscribed in the circle centered on [x,y] with the given radius and color. | |
| void | regular_polygon (int x, int y, int radius, int edges, RegularPolygonVariation variation, Color color, RegularPolygonDrawing drawing=DRAWING_OUTLINE) |
| void | regular_polygon (int x, int y, int radius, int edges, Color color, RegularPolygonDrawing drawing=DRAWING_OUTLINE) |
| void | filled_regular_polygon (int x, int y, int radius, int edges, RegularPolygonVariation variation=VARIATION_POINTY_TOP, float rotation_degrees=ROTATION_0_DEGREES, Color color=COLOR_ON) |
| Fill a regular polygon inscribed in the circle centered on [x,y] with the given radius and color. | |
| void | filled_regular_polygon (int x, int y, int radius, int edges, RegularPolygonVariation variation, Color color) |
| void | filled_regular_polygon (int x, int y, int radius, int edges, Color color) |
| void | print (int x, int y, BaseFont *font, Color color, TextAlign align, const char *text, Color background=COLOR_OFF) |
Print text with the anchor point at [x,y] with font. | |
| void | print (int x, int y, BaseFont *font, Color color, const char *text, Color background=COLOR_OFF) |
Print text with the top left at [x,y] with font. | |
| void | print (int x, int y, BaseFont *font, TextAlign align, const char *text) |
Print text with the anchor point at [x,y] with font. | |
| void | print (int x, int y, BaseFont *font, const char *text) |
Print text with the top left at [x,y] with font. | |
| void | printf (int x, int y, BaseFont *font, Color color, Color background, TextAlign align, const char *format,...) __attribute__((format(printf |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font. | |
| void void | printf (int x, int y, BaseFont *font, Color color, TextAlign align, const char *format,...) __attribute__((format(printf |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font. | |
| void void void | printf (int x, int y, BaseFont *font, Color color, const char *format,...) __attribute__((format(printf |
Evaluate the printf-format format and print the result with the top left at [x,y] with font. | |
| void void void void | printf (int x, int y, BaseFont *font, TextAlign align, const char *format,...) __attribute__((format(printf |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font. | |
| void void void void void | printf (int x, int y, BaseFont *font, const char *format,...) __attribute__((format(printf |
Evaluate the printf-format format and print the result with the top left at [x,y] with font. | |
| void void void void void void | strftime (int x, int y, BaseFont *font, Color color, Color background, TextAlign align, const char *format, ESPTime time) __attribute__((format(strftime |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font. | |
| void void void void void void void | strftime (int x, int y, BaseFont *font, Color color, TextAlign align, const char *format, ESPTime time) __attribute__((format(strftime |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font. | |
| void void void void void void void void | strftime (int x, int y, BaseFont *font, Color color, const char *format, ESPTime time) __attribute__((format(strftime |
Evaluate the strftime-format format and print the result with the top left at [x,y] with font. | |
| void void void void void void void void void | strftime (int x, int y, BaseFont *font, TextAlign align, const char *format, ESPTime time) __attribute__((format(strftime |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font. | |
| void void void void void void void void void void | strftime (int x, int y, BaseFont *font, const char *format, ESPTime time) __attribute__((format(strftime |
Evaluate the strftime-format format and print the result with the top left at [x,y] with font. | |
| void void void void void void void void void void void | image (int x, int y, BaseImage *image, Color color_on=COLOR_ON, Color color_off=COLOR_OFF) |
Draw the image with the top-left corner at [x,y] to the screen. | |
| void | image (int x, int y, BaseImage *image, ImageAlign align, Color color_on=COLOR_ON, Color color_off=COLOR_OFF) |
Draw the image at [x,y] to the screen. | |
| void | graph (int x, int y, graph::Graph *graph, Color color_on=COLOR_ON) |
Draw the graph with the top-left corner at [x,y] to the screen. | |
| void | legend (int x, int y, graph::Graph *graph, Color color_on=COLOR_ON) |
Draw the legend for graph with the top-left corner at [x,y] to the screen. | |
| void | qr_code (int x, int y, qr_code::QrCode *qr_code, Color color_on=COLOR_ON, int scale=1) |
Draw the qr_code with the top-left corner at [x,y] to the screen. | |
| void | menu (int x, int y, graphical_display_menu::GraphicalDisplayMenu *menu, int width, int height) |
| void | get_text_bounds (int x, int y, const char *text, BaseFont *font, TextAlign align, int *x1, int *y1, int *width, int *height) |
| Get the text bounds of the given string. | |
| void | set_writer (display_writer_t &&writer) |
| Internal method to set the display writer lambda. | |
| void | show_page (DisplayPage *page) |
| void | show_next_page () |
| void | show_prev_page () |
| void | set_pages (std::vector< DisplayPage * > pages) |
| const DisplayPage * | get_active_page () const |
| template<typename F > | |
| void | add_on_page_change_callback (F &&callback) |
| virtual void | set_rotation (DisplayRotation rotation) |
| Internal method to set the display rotation with. | |
| void | set_auto_clear (bool auto_clear_enabled) |
| virtual DisplayRotation | get_rotation () const |
| virtual bool | pixel_axes_swapped () const |
| True when draw_pixel_at() swaps x and y before writing, so pixels that are neighbours along x land a row apart in the frame buffer. | |
| virtual DisplayType | get_display_type ()=0 |
| Get the type of display that the buffer corresponds to. | |
| void | start_clipping (Rect rect) |
| Set the clipping rectangle for further drawing. | |
| void | start_clipping (int16_t left, int16_t top, int16_t right, int16_t bottom) |
| void | extend_clipping (Rect rect) |
| Add a rectangular region to the invalidation region. | |
| void | extend_clipping (int16_t left, int16_t top, int16_t right, int16_t bottom) |
| void | shrink_clipping (Rect rect) |
| substract a rectangular region to the invalidation region | |
| void | shrink_clipping (uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) |
| void | end_clipping () |
| Reset the invalidation region. | |
| Rect | get_clipping () const |
| Get the current the clipping rectangle. | |
| bool | is_clipping () const |
| bool ESPHOME_ALWAYS_INLINE | is_point_clipped (int x, int y) const |
| Whether (x, y) falls outside the active clipping rectangle. | |
| bool | clip (int x, int y) |
| Check if pixel is within region of display. | |
| void | test_card () |
| void | show_test_card () |
Public Member Functions inherited from esphome::PollingComponent | |
| PollingComponent () | |
| PollingComponent (uint32_t update_interval) | |
| Initialize this polling component with the given update interval in ms. | |
| void | set_update_interval (uint32_t update_interval) |
| Manually set the update interval in ms for this polling object. | |
| virtual void | update ()=0 |
| void | call_setup () override |
| virtual uint32_t | get_update_interval () const |
| Get the update interval in ms of this sensor. | |
| void | start_poller () |
| void | stop_poller () |
Public Member Functions inherited from esphome::Component | |
| virtual void | setup () |
| Where the component's initialization should happen. | |
| virtual void | loop () |
| This method will be called repeatedly. | |
| virtual void | dump_config () |
| virtual float | get_setup_priority () const |
| priority of setup(). | |
| float | get_actual_setup_priority () const |
| void | set_setup_priority (float priority) |
| void | call () |
| virtual void | on_shutdown () |
| virtual void | on_safe_shutdown () |
| virtual bool | teardown () |
| Called during teardown to allow component to gracefully finish operations. | |
| virtual void | on_powerdown () |
| Called after teardown is complete to power down hardware. | |
| uint8_t | get_component_state () const |
| void | reset_to_construction_state () |
| Reset this component back to the construction state to allow setup to run again. | |
| bool | is_in_loop_state () const |
| Check if this component has completed setup and is in the loop state. | |
| bool | is_idle () const |
| Check if this component is idle. | |
| void | mark_failed () |
| Mark this component as failed. | |
| void | mark_failed (const LogString *message) |
| void | disable_loop () |
| Disable this component's loop. | |
| void | enable_loop () |
| Enable this component's loop. | |
| void | enable_loop_soon_any_context () |
| Thread and ISR-safe version of enable_loop() that can be called from any context. | |
| bool | is_failed () const |
| bool | is_ready () const |
| virtual bool | can_proceed () |
| bool | status_has_warning () const |
| bool | status_has_error () const |
| void | status_set_warning () |
| void | status_set_warning (const char *message) |
| void | status_set_warning (const LogString *message) |
| bool | status_comm_result (bool ok) |
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok. | |
| bool | status_comm_result (bool ok, const LogString *message) |
| void | status_set_error () |
| void | status_set_error (const LogString *message) |
| void | status_clear_warning () |
| void | status_clear_error () |
| ESPDEPRECATED ("Use status_momentary_warning() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_warning(const char *name | |
| void | status_momentary_warning (uint32_t length=5000) |
Set warning status flag and clear it after length ms. | |
| void | status_momentary_warning (const LogString *message, uint32_t length=5000) |
| ESPDEPRECATED ("Use status_momentary_error() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_error(const char *name | |
| void | status_momentary_error (uint32_t length=5000) |
Set error status flag and clear it after length ms. | |
| void | status_momentary_error (const LogString *message, uint32_t length=5000) |
| bool | has_overridden_loop () const |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| Get the integration where this component was declared as a LogString for logging. | |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
Data Fields | |
| int | y_start |
| int int | w |
| int int int | h |
| int int int const uint8_t * | ptr |
| int int int const uint8_t ColorOrder | order |
| int int int const uint8_t ColorOrder ColorBitness | bitness |
| int int int const uint8_t ColorOrder ColorBitness bool | big_endian |
| int int int const uint8_t ColorOrder ColorBitness bool int | x_offset |
| int int int const uint8_t ColorOrder ColorBitness bool int int | y_offset |
| int int int const uint8_t ColorOrder ColorBitness bool int int int | x_pad |
Data Fields inherited from esphome::Component | |
| uint32_t | length = 5000) |
Protected Member Functions | |
| virtual void | draw_pixels_internal (int x_start, int y_start, int w, int h, const uint8_t *ptr, ColorBitness bitness, bool big_endian, int x_offset, int y_offset, int x_pad) |
| Draws a block for draw_pixels_at(); the parameters are the same. | |
| bool | clamp_x_ (int x, int w, int &min_x, int &max_x) |
| bool | clamp_y_ (int y, int h, int &min_y, int &max_y) |
| void | vprintf_ (int x, int y, BaseFont *font, Color color, Color background, TextAlign align, const char *format, va_list arg) |
| void | do_update_ () |
| void | clear_clipping_ () |
| void ESPHOME_ALWAYS_INLINE | feed_wdt_per_pixel_ () |
| Watchdog feed for per pixel loops. | |
| void | feed_wdt_pixel_slow_ () |
| virtual int | get_height_internal ()=0 |
| virtual int | get_width_internal ()=0 |
| void | filled_flat_side_triangle_ (int x1, int y1, int x2, int y2, int x3, int y3, Color color) |
| This method fills a triangle using only integer variables by using a modified bresenham algorithm. | |
| void | sort_triangle_points_by_y_ (int *x1, int *y1, int *x2, int *y2, int *x3, int *y3) |
Protected Member Functions inherited from esphome::Component | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | set_component_source_ (uint8_t index) |
| Set where this component was loaded from for some debug messages. | |
| void | call_dump_config_ () |
| void | enable_loop_slow_path_ () |
| void | set_component_state_ (uint8_t state) |
| Helper to set component state (clears state bits and sets new state) | |
| bool | set_status_flag_ (uint8_t flag) |
| Helper to set a status LED flag on both this component and the app. | |
| bool | set_error_flag_ (const LogString *message) |
| Set the error flag and log it; true when it was not set before. | |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a const char* name. | |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a numeric ID (zero heap allocation). | |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| bool | cancel_interval (const char *name) |
| Cancel an interval function. | |
| bool | cancel_interval (uint32_t id) |
| bool | cancel_interval (InternalSchedulerID id) |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a const char* name. | |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a numeric ID (zero heap allocation). | |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| bool | cancel_timeout (const char *name) |
| Cancel a timeout function. | |
| bool | cancel_timeout (uint32_t id) |
| bool | cancel_timeout (InternalSchedulerID id) |
| void | defer (const char *name, std::function< void()> &&f) |
| Defer a callback to the next loop() call with a const char* name. | |
| void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. | |
| void | defer (uint32_t id, std::function< void()> &&f) |
| Defer a callback with a numeric ID (zero heap allocation) | |
| bool | cancel_defer (const char *name) |
| Cancel a defer callback using the specified name, name must not be empty. | |
| bool | cancel_defer (uint32_t id) |
| void | status_clear_warning_slow_path_ () |
| void | status_clear_error_slow_path_ () |
Protected Attributes | |
| DisplayRotation | rotation_ {DISPLAY_ROTATION_0_DEGREES} |
| display_writer_t | writer_ {} |
| DisplayPage * | page_ {nullptr} |
| StaticCallbackManager< DISPLAY_PAGE_CHANGE_CALLBACK_COUNT, void(DisplayPage *, DisplayPage *)> | page_change_callback_ |
| bool | auto_clear_enabled_ {true} |
| std::vector< Rect > | clipping_rectangle_ |
| uint8_t | wdt_pixel_counter_ {0} |
| bool | show_test_card_ {false} |
Protected Attributes inherited from esphome::PollingComponent | |
| uint32_t | update_interval_ |
Protected Attributes inherited from esphome::Component | |
| uint8_t | component_source_index_ {0} |
| Index into component source PROGMEM lookup table (0 = not set) | |
| uint8_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_CS} |
| Warn threshold in centiseconds (max 2550ms) | |
| uint8_t | component_state_ {0x00} |
| State of this component - each bit has a purpose: Bits 0-2: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED, 0x04=LOOP_DONE) Bit 3: STATUS_LED_WARNING Bit 4: STATUS_LED_ERROR Bit 5: Has overridden loop() (set at registration time) Bits 6-7: Unused - reserved for future expansion. | |
| volatile bool | pending_enable_loop_ {false} |
| ISR-safe flag for enable_loop_soon_any_context. | |
| ComponentRuntimeStats | runtime_stats_ |
|
inline |
| void HOT esphome::display::Display::circle | ( | int | center_x, |
| int | center_xy, | ||
| int | radius, | ||
| Color | color = COLOR_ON ) |
Draw the outline of a circle centered around [center_x,center_y] with the radius radius with the given color.
Definition at line 180 of file display.cpp.
|
protected |
Definition at line 846 of file display.cpp.
|
protected |
Definition at line 862 of file display.cpp.
|
virtual |
Clear the entire screen by filling it with OFF pixels.
Reimplemented in esphome::epaper_spi::EPaper4bpp, esphome::epaper_spi::EPaperBase, esphome::epaper_spi::EPaperInkplate2, esphome::epaper_spi::EPaperWeAct3C, and esphome::it8951::IT8951Display.
Definition at line 17 of file display.cpp.
|
protected |
Definition at line 834 of file display.cpp.
| bool esphome::display::Display::clip | ( | int | x, |
| int | y ) |
Check if pixel is within region of display.
Definition at line 838 of file display.cpp.
|
protected |
Definition at line 756 of file display.cpp.
|
inline |
|
pure virtual |
Set a single pixel at the specified coordinates to the given color.
Implemented in esphome::display::DisplayBuffer, esphome::epaper_spi::EPaper4bpp, esphome::epaper_spi::EPaperBase, esphome::epaper_spi::EPaperInkplate2, esphome::epaper_spi::EPaperJD79660, esphome::epaper_spi::EPaperSSD1677Gray4, esphome::epaper_spi::EPaperT133A01, esphome::epaper_spi::EPaperWaveshareBWR, esphome::epaper_spi::EPaperWeAct3C, esphome::hub75::HUB75Display, esphome::it8951::IT8951Display, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >, esphome::pixoo::Pixoo, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, and esphome::st7701s::ST7701S.
|
inline |
|
inline |
Given an array of pixels encoded in the nominated format, draw these into the display's buffer.
The parameters describe a rectangular block of pixels, potentially within a larger buffer.
| x_start | The starting destination x position |
| y_start | The starting destination y position |
| w | the width of the pixel block |
| h | the height of the pixel block |
| ptr | A pointer to the start of the data to be copied |
| bitness | Defines the number of bits and their format for each pixel. Red is always in the most significant bits. |
| big_endian | True if 16 bit values are stored big-endian. Ignored for 888, which is always b,g,r in memory, as LVGL and ESPHome images store it. |
| x_offset | The initial x-offset into the source buffer. |
| y_offset | The initial y-offset into the source buffer. |
| x_pad | How many pixels are in each line after the end of the pixels to be copied. |
The length of each source buffer line (stride) will be x_offset + w + x_pad. The block must lie on the screen. A driver that can copy blocks itself overrides draw_pixels_internal().
|
protectedvirtual |
Draws a block for draw_pixels_at(); the parameters are the same.
The base version draws it per pixel through draw_pixel_at(), so it works on any display.
A driver can override it to copy blocks that are already laid out the way its own draw_pixel_at() writes, and must send any other format, byte order, a software rotation or an active clipping rectangle through Display::draw_pixels_internal(), which draws per pixel. Do not also override the deprecated draw_pixels_at() with a color order: Display::draw_pixels_internal() calls it.
Reimplemented in esphome::epaper_spi::EPaperBase, esphome::hub75::HUB75Display, esphome::ili9xxx::ILI9XXXDisplay, esphome::it8951::IT8951Display, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >, esphome::pixoo::Pixoo, esphome::qspi_dbi::QspiDbi, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, esphome::snapshot::SnapshotDisplay, and esphome::st7701s::ST7701S.
Definition at line 119 of file display.cpp.
| void esphome::display::Display::end_clipping | ( | ) |
Reset the invalidation region.
Definition at line 802 of file display.cpp.
| esphome::display::Display::ESPDEPRECATED | ( | "Pixels are always | RGB, |
| drop the ColorOrder argument. Removed in 2027.5.0" | , | ||
| "2026.11.0" | ) |
| esphome::display::Display::ESPDEPRECATED | ( | "Pixels are always RGB: call draw_pixels_at() without the | ColorOrder, |
| and override draw_pixels_internal() " "to copy blocks. Removed in 2027.5.0" | , | ||
| "2026.11.0" | ) |
The block form above with a color order.
The base version draws per pixel and honors the order; a driver that still overrides this one keeps receiving every block, since draw_pixels_internal() calls it. Such a driver needs using display::Display::draw_pixels_at; so the forms above stay visible through it, and its fallback must call Display::draw_pixels_at() with the order: Display::draw_pixels_internal() would call the override again.
|
inline |
| void esphome::display::Display::extend_clipping | ( | Rect | rect | ) |
Add a rectangular region to the invalidation region.
| [in] | rect | Rectangle to add to the invalidation region |
Definition at line 810 of file display.cpp.
|
inlineprotected |
Watchdog feed for per pixel loops.
App.feed_wdt() is already rate limited, but every call reads the clock; only every 256th pixel makes that call, so the real feeds are unchanged and a pixel costs a counter. At 20 us per pixel on the slowest e-paper path that is about 5 ms between clock reads.
|
protected |
Definition at line 836 of file display.cpp.
|
virtual |
Fill the entire screen with the given color.
Reimplemented in esphome::epaper_spi::EPaper4bpp, esphome::epaper_spi::EPaperBase, esphome::epaper_spi::EPaperInkplate2, esphome::epaper_spi::EPaperJD79660, esphome::epaper_spi::EPaperSSD1677Gray4, esphome::epaper_spi::EPaperT133A01, esphome::epaper_spi::EPaperWaveshareBWR, esphome::epaper_spi::EPaperWeAct3C, esphome::hub75::HUB75Display, esphome::ili9xxx::ILI9XXXDisplay, esphome::inkplate::Inkplate, esphome::it8951::IT8951Display, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >, esphome::pcd8544::PCD8544, esphome::pixoo::Pixoo, esphome::sh1122_base::SH1122, esphome::ssd1306_base::SSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1351_base::SSD1351, esphome::st7305::ST7305, esphome::st7567_base::ST7567, esphome::st7920::ST7920, esphome::waveshare_epaper::WaveshareEPaper7C, esphome::waveshare_epaper::WaveshareEPaper, and esphome::waveshare_epaper::WaveshareEPaperBWR.
Definition at line 16 of file display.cpp.
| void esphome::display::Display::filled_circle | ( | int | center_x, |
| int | center_y, | ||
| int | radius, | ||
| Color | color = COLOR_ON ) |
Fill a circle centered around [center_x,center_y] with the radius radius with the given color.
Definition at line 204 of file display.cpp.
|
protected |
This method fills a triangle using only integer variables by using a modified bresenham algorithm.
It is mandatory that [x2,y2] and [x3,y3] lie on the same horizontal line, so y2 must be equal to y3.
Definition at line 403 of file display.cpp.
| void esphome::display::Display::filled_gauge | ( | int | center_x, |
| int | center_y, | ||
| int | radius1, | ||
| int | radius2, | ||
| int | progress, | ||
| Color | color = COLOR_ON ) |
Fill a half-ring "gauge" centered around [center_x,center_y] between two circles with the radius1 and radius2 with he given color and filled up to 'progress' percent.
Definition at line 288 of file display.cpp.
| void esphome::display::Display::filled_rectangle | ( | int | x1, |
| int | y1, | ||
| int | width, | ||
| int | height, | ||
| Color | color = COLOR_ON ) |
Fill a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height].
Definition at line 173 of file display.cpp.
| void esphome::display::Display::filled_regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| Color | color ) |
Definition at line 568 of file display.cpp.
| void esphome::display::Display::filled_regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| RegularPolygonVariation | variation, | ||
| Color | color ) |
Definition at line 563 of file display.cpp.
| void esphome::display::Display::filled_regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| RegularPolygonVariation | variation = VARIATION_POINTY_TOP, | ||
| float | rotation_degrees = ROTATION_0_DEGREES, | ||
| Color | color = COLOR_ON ) |
Fill a regular polygon inscribed in the circle centered on [x,y] with the given radius and color.
Use the edges constants (e.g.: EDGES_HEXAGON) or any integer to specify the number of edges of the polygon. Use the variation to switch between the flat-topped or the pointy-topped variation of the polygon. Use the rotation in degrees to rotate the shape clockwise.
Definition at line 558 of file display.cpp.
| void esphome::display::Display::filled_ring | ( | int | center_x, |
| int | center_y, | ||
| int | radius1, | ||
| int | radius2, | ||
| Color | color = COLOR_ON ) |
Fill a ring centered around [center_x,center_y] between two circles with the radius1 and radius2 with the given color.
Definition at line 231 of file display.cpp.
| void esphome::display::Display::filled_triangle | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| int | x3, | ||
| int | y3, | ||
| Color | color = COLOR_ON ) |
Fill a triangle contained between the points [x1,y1], [x2,y2] and [x3,y3] with the given color.
Definition at line 486 of file display.cpp.
|
inline |
| Rect esphome::display::Display::get_clipping | ( | ) | const |
Get the current the clipping rectangle.
return rect for active clipping region
Definition at line 826 of file display.cpp.
|
pure virtual |
Get the type of display that the buffer corresponds to.
In case of dynamically configurable displays, returns the type the display is currently configured to.
Implemented in esphome::addressable_light::AddressableLightDisplay, esphome::epaper_spi::EPaperBase, esphome::hub75::HUB75Display, esphome::ili9xxx::ILI9XXXDisplay, esphome::inkplate::Inkplate, esphome::it8951::IT8951Display, esphome::max7219digit::MAX7219Component, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::pcd8544::PCD8544, esphome::pixoo::Pixoo, esphome::qspi_dbi::QspiDbi, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, esphome::sh1122_base::SH1122, esphome::snapshot::SnapshotDisplay, esphome::ssd1306_base::SSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1351_base::SSD1351, esphome::st7305::ST7305, esphome::st7567_base::ST7567, esphome::st7701s::ST7701S, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::waveshare_epaper::WaveshareEPaper7C, esphome::waveshare_epaper::WaveshareEPaper, and esphome::waveshare_epaper::WaveshareEPaperBWR.
|
inlinevirtual |
Get the calculated height of the display in pixels with rotation applied.
Reimplemented in esphome::display::DisplayBuffer, esphome::epaper_spi::EPaperBase, esphome::it8951::IT8951Display, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, and esphome::st7701s::ST7701S.
|
protectedpure virtual |
Implemented in esphome::addressable_light::AddressableLightDisplay, esphome::epaper_spi::EPaperBase, esphome::hub75::HUB75Display, esphome::ili9xxx::ILI9XXXDisplay, esphome::inkplate::Inkplate, esphome::it8951::IT8951Display, esphome::max7219digit::MAX7219Component, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::pcd8544::PCD8544, esphome::pixoo::Pixoo, esphome::qspi_dbi::QspiDbi, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, esphome::sh1122_base::SH1122, esphome::snapshot::SnapshotDisplay, esphome::ssd1306_base::SSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1351_base::SSD1351, esphome::st7305::ST7305, esphome::st7567_base::ST7567, esphome::st7701s::ST7701S, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::waveshare_epaper::GDEW0154M09, esphome::waveshare_epaper::GDEW029T5, esphome::waveshare_epaper::GDEY029T94, esphome::waveshare_epaper::GDEY042T81, esphome::waveshare_epaper::GDEY0583T81, esphome::waveshare_epaper::WaveshareEPaper13P3InK, esphome::waveshare_epaper::WaveshareEPaper1P54InBV2, esphome::waveshare_epaper::WaveshareEPaper2P13InDKE, esphome::waveshare_epaper::WaveshareEPaper2P13InV3, esphome::waveshare_epaper::WaveshareEPaper2P7In, esphome::waveshare_epaper::WaveshareEPaper2P7InB, esphome::waveshare_epaper::WaveshareEPaper2P7InBV2, esphome::waveshare_epaper::WaveshareEPaper2P7InV2, esphome::waveshare_epaper::WaveshareEPaper2P9InB, esphome::waveshare_epaper::WaveshareEPaper2P9InBV3, esphome::waveshare_epaper::WaveshareEPaper2P9InD, esphome::waveshare_epaper::WaveshareEPaper2P9InDKE, esphome::waveshare_epaper::WaveshareEPaper2P9InV2R2, esphome::waveshare_epaper::WaveshareEPaper4P2In, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2BWR, esphome::waveshare_epaper::WaveshareEPaper5P65InF, esphome::waveshare_epaper::WaveshareEPaper5P8In, esphome::waveshare_epaper::WaveshareEPaper5P8InV2, esphome::waveshare_epaper::WaveshareEPaper7P3InF, esphome::waveshare_epaper::WaveshareEPaper7P5In, esphome::waveshare_epaper::WaveshareEPaper7P5InBC, esphome::waveshare_epaper::WaveshareEPaper7P5InBV2, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3BWR, esphome::waveshare_epaper::WaveshareEPaper7P5InHDB, esphome::waveshare_epaper::WaveshareEPaper7P5InV2, esphome::waveshare_epaper::WaveshareEPaper7P5InV2P, and esphome::waveshare_epaper::WaveshareEPaperTypeA.
|
inline |
|
inline |
| void HOT esphome::display::Display::get_regular_polygon_vertex | ( | int | vertex_id, |
| int * | vertex_x, | ||
| int * | vertex_y, | ||
| int | center_x, | ||
| int | center_y, | ||
| int | radius, | ||
| int | edges, | ||
| RegularPolygonVariation | variation = VARIATION_POINTY_TOP, | ||
| float | rotation_degrees = ROTATION_0_DEGREES ) |
Get the specified vertex (x,y) coordinates for the regular polygon inscribed in the circle centered on [center_x,center_y] with the given radius.
Vertex id are 0-indexed and rotate clockwise. In a pointy-topped variation of a polygon with a 0° rotation, the vertex #0 is located at the top of the polygon. In a flat-topped variation of a polygon with a 0° rotation, the vertex #0 is located on the left-side of the horizontal top edge, and the vertex #1 is located on the right-side of the horizontal top edge. Use the edges constants (e.g.: EDGES_HEXAGON) or any integer to specify the number of edges of the polygon. Use the variation to switch between the flat-topped or the pointy-topped variation of the polygon. Use the rotation in degrees to rotate the shape clockwise.
Definition at line 504 of file display.cpp.
|
inlinevirtual |
Reimplemented in esphome::hub75::HUB75Display.
| void esphome::display::Display::get_text_bounds | ( | int | x, |
| int | y, | ||
| const char * | text, | ||
| BaseFont * | font, | ||
| TextAlign | align, | ||
| int * | x1, | ||
| int * | y1, | ||
| int * | width, | ||
| int * | height ) |
Get the text bounds of the given string.
| x | The x coordinate to place the string at, can be 0 if only interested in dimensions. |
| y | The y coordinate to place the string at, can be 0 if only interested in dimensions. |
| text | The text to measure. |
| font | The font to measure the text bounds with. |
| align | The alignment of the text. Set to TextAlign::TOP_LEFT if only interested in dimensions. |
| x1 | A pointer to store the returned x coordinate of the upper left corner in. |
| y1 | A pointer to store the returned y coordinate of the upper left corner in. |
| width | A pointer to store the returned text width in. |
| height | A pointer to store the returned text height in. |
Definition at line 640 of file display.cpp.
|
inlinevirtual |
Get the calculated width of the display in pixels with rotation applied.
Reimplemented in esphome::display::DisplayBuffer, esphome::epaper_spi::EPaperBase, esphome::it8951::IT8951Display, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, and esphome::st7701s::ST7701S.
|
protectedpure virtual |
Implemented in esphome::addressable_light::AddressableLightDisplay, esphome::epaper_spi::EPaperBase, esphome::hub75::HUB75Display, esphome::ili9xxx::ILI9XXXDisplay, esphome::inkplate::Inkplate, esphome::it8951::IT8951Display, esphome::max7219digit::MAX7219Component, esphome::mipi_dsi::MipiDsi, esphome::mipi_rgb::MipiRgb, esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >, esphome::pcd8544::PCD8544, esphome::pixoo::Pixoo, esphome::qspi_dbi::QspiDbi, esphome::rpi_dpi_rgb::RpiDpiRgb, esphome::sdl::Sdl, esphome::sh1122_base::SH1122, esphome::snapshot::SnapshotDisplay, esphome::ssd1306_base::SSD1306, esphome::ssd1322_base::SSD1322, esphome::ssd1325_base::SSD1325, esphome::ssd1327_base::SSD1327, esphome::ssd1331_base::SSD1331, esphome::ssd1351_base::SSD1351, esphome::st7305::ST7305, esphome::st7567_base::ST7567, esphome::st7701s::ST7701S, esphome::st7735::ST7735, esphome::st7789v::ST7789V, esphome::st7920::ST7920, esphome::waveshare_epaper::GDEW0154M09, esphome::waveshare_epaper::GDEW029T5, esphome::waveshare_epaper::GDEY029T94, esphome::waveshare_epaper::GDEY042T81, esphome::waveshare_epaper::GDEY0583T81, esphome::waveshare_epaper::WaveshareEPaper13P3InK, esphome::waveshare_epaper::WaveshareEPaper1P54InBV2, esphome::waveshare_epaper::WaveshareEPaper2P13InDKE, esphome::waveshare_epaper::WaveshareEPaper2P13InV3, esphome::waveshare_epaper::WaveshareEPaper2P7In, esphome::waveshare_epaper::WaveshareEPaper2P7InB, esphome::waveshare_epaper::WaveshareEPaper2P7InBV2, esphome::waveshare_epaper::WaveshareEPaper2P7InV2, esphome::waveshare_epaper::WaveshareEPaper2P9InB, esphome::waveshare_epaper::WaveshareEPaper2P9InBV3, esphome::waveshare_epaper::WaveshareEPaper2P9InD, esphome::waveshare_epaper::WaveshareEPaper2P9InDKE, esphome::waveshare_epaper::WaveshareEPaper2P9InV2R2, esphome::waveshare_epaper::WaveshareEPaper4P2In, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2, esphome::waveshare_epaper::WaveshareEPaper4P2InBV2BWR, esphome::waveshare_epaper::WaveshareEPaper5P65InF, esphome::waveshare_epaper::WaveshareEPaper5P8In, esphome::waveshare_epaper::WaveshareEPaper5P8InV2, esphome::waveshare_epaper::WaveshareEPaper7P3InF, esphome::waveshare_epaper::WaveshareEPaper7P5In, esphome::waveshare_epaper::WaveshareEPaper7P5InBC, esphome::waveshare_epaper::WaveshareEPaper7P5InBV2, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3, esphome::waveshare_epaper::WaveshareEPaper7P5InBV3BWR, esphome::waveshare_epaper::WaveshareEPaper7P5InHDB, esphome::waveshare_epaper::WaveshareEPaper7P5InV2, esphome::waveshare_epaper::WaveshareEPaper7P5InV2P, and esphome::waveshare_epaper::WaveshareEPaperTypeA.
| void esphome::display::Display::graph | ( | int | x, |
| int | y, | ||
| graph::Graph * | graph, | ||
| Color | color_on = COLOR_ON ) |
Draw the graph with the top-left corner at [x,y] to the screen.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| graph | The graph id to draw |
| color_on | The color to replace in binary images for the on bits. |
Definition at line 623 of file display.cpp.
| void HOT esphome::display::Display::horizontal_line | ( | int | x, |
| int | y, | ||
| int | width, | ||
| Color | color = COLOR_ON ) |
Draw a horizontal line from the point [x,y] to [x+width,y] with the given color.
Definition at line 154 of file display.cpp.
| void esphome::display::Display::image | ( | int | x, |
| int | y, | ||
| BaseImage * | image, | ||
| Color | color_on = COLOR_ON, | ||
| Color | color_off = COLOR_OFF ) |
Draw the image with the top-left corner at [x,y] to the screen.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| image | The image to draw. |
| color_on | The color to replace in binary images for the on bits. |
| color_off | The color to replace in binary images for the off bits. |
Definition at line 587 of file display.cpp.
| void esphome::display::Display::image | ( | int | x, |
| int | y, | ||
| BaseImage * | image, | ||
| ImageAlign | align, | ||
| Color | color_on = COLOR_ON, | ||
| Color | color_off = COLOR_OFF ) |
Draw the image at [x,y] to the screen.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| image | The image to draw. |
| align | The alignment of the image. |
| color_on | The color to replace in binary images for the on bits. |
| color_off | The color to replace in binary images for the off bits. |
Definition at line 591 of file display.cpp.
|
inline |
|
inline |
Whether (x, y) falls outside the active clipping rectangle.
Tests the stack top in place: get_clipping() is out of line and returns the Rect by value, which per pixel drawing cannot afford.
| void esphome::display::Display::legend | ( | int | x, |
| int | y, | ||
| graph::Graph * | graph, | ||
| Color | color_on = COLOR_ON ) |
Draw the legend for graph with the top-left corner at [x,y] to the screen.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| graph | The graph id for which the legend applies to |
| graph | The graph id for which the legend applies to |
| graph | The graph id for which the legend applies to |
| name_font | The font used for the trace name |
| value_font | The font used for the trace value and units |
| color_on | The color of the border |
Definition at line 624 of file display.cpp.
Draw a straight line from the point [x1,y1] to [x2,y2] with the given color.
Definition at line 20 of file display.cpp.
| void esphome::display::Display::line_at_angle | ( | int | x, |
| int | y, | ||
| int | angle, | ||
| int | length, | ||
| Color | color = COLOR_ON ) |
Draw a straight line at the given angle based on the origin [x, y] for a specified length with the given color.
Definition at line 41 of file display.cpp.
| void esphome::display::Display::line_at_angle | ( | int | x, |
| int | y, | ||
| int | angle, | ||
| int | start_radius, | ||
| int | stop_radius, | ||
| Color | color = COLOR_ON ) |
Draw a straight line at the given angle based on the origin [x, y] from a specified start and stop radius with the given color.
Definition at line 45 of file display.cpp.
| void esphome::display::Display::menu | ( | int | x, |
| int | y, | ||
| graphical_display_menu::GraphicalDisplayMenu * | menu, | ||
| int | width, | ||
| int | height ) |
| x | The x coordinate of the upper left corner |
| y | The y coordinate of the upper left corner |
| menu | The GraphicalDisplayMenu to draw |
| width | Width of the menu |
| height | Height of the menu |
Definition at line 634 of file display.cpp.
|
inlinevirtual |
True when draw_pixel_at() swaps x and y before writing, so pixels that are neighbours along x land a row apart in the frame buffer.
Not the same as get_width()/get_height() swapping: a display that rotates in hardware reports swapped dimensions but writes unswapped pixels.
Reimplemented in esphome::epaper_spi::EPaperBase, esphome::it8951::IT8951Display, and esphome::mipi_spi::MipiSpiBuffer< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION, FRACTION, ROUNDING >.
| void esphome::display::Display::print | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| const char * | text, | ||
| Color | background = COLOR_OFF ) |
Print text with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| text | The text to draw. |
| background | When using multi-bit (anti-aliased) fonts, blend this background color into pixels |
Definition at line 679 of file display.cpp.
| void esphome::display::Display::print | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| TextAlign | align, | ||
| const char * | text, | ||
| Color | background = COLOR_OFF ) |
Print text with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| align | The alignment of the text. |
| text | The text to draw. |
| background | When using multi-bit (anti-aliased) fonts, blend this background color into pixels |
Definition at line 572 of file display.cpp.
| void esphome::display::Display::print | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| const char * | text ) |
Print text with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| text | The text to draw. |
Definition at line 687 of file display.cpp.
| void esphome::display::Display::print | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| TextAlign | align, | ||
| const char * | text ) |
Print text with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| align | The alignment of the text. |
| text | The text to draw. |
Definition at line 683 of file display.cpp.
| void esphome::display::Display::printf | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| Color | background, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ... ) |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| background | The background color to use for anti-aliasing |
| align | The alignment of the text. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 691 of file display.cpp.
| void esphome::display::Display::printf | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| const char * | format, | ||
| ... ) |
Evaluate the printf-format format and print the result with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 706 of file display.cpp.
| void esphome::display::Display::printf | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ... ) |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| align | The alignment of the text. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 699 of file display.cpp.
| void esphome::display::Display::printf | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| const char * | format, | ||
| ... ) |
Evaluate the printf-format format and print the result with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 720 of file display.cpp.
| void esphome::display::Display::printf | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ... ) |
Evaluate the printf-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| align | The alignment of the text. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 713 of file display.cpp.
| void esphome::display::Display::qr_code | ( | int | x, |
| int | y, | ||
| qr_code::QrCode * | qr_code, | ||
| Color | color_on = COLOR_ON, | ||
| int | scale = 1 ) |
Draw the qr_code with the top-left corner at [x,y] to the screen.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| qr_code | The qr_code to draw |
| color_on | The color to replace in binary images for the on bits. |
Definition at line 628 of file display.cpp.
| void esphome::display::Display::rectangle | ( | int | x1, |
| int | y1, | ||
| int | width, | ||
| int | height, | ||
| Color | color = COLOR_ON ) |
Draw the outline of a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,y1+height].
Definition at line 166 of file display.cpp.
| void HOT esphome::display::Display::regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| Color | color, | ||
| RegularPolygonDrawing | drawing = DRAWING_OUTLINE ) |
Definition at line 554 of file display.cpp.
| void HOT esphome::display::Display::regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| RegularPolygonVariation | variation, | ||
| Color | color, | ||
| RegularPolygonDrawing | drawing = DRAWING_OUTLINE ) |
Definition at line 549 of file display.cpp.
| void HOT esphome::display::Display::regular_polygon | ( | int | x, |
| int | y, | ||
| int | radius, | ||
| int | edges, | ||
| RegularPolygonVariation | variation = VARIATION_POINTY_TOP, | ||
| float | rotation_degrees = ROTATION_0_DEGREES, | ||
| Color | color = COLOR_ON, | ||
| RegularPolygonDrawing | drawing = DRAWING_OUTLINE ) |
Draw the outline of a regular polygon inscribed in the circle centered on [x,y] with the given radius and color.
Use the edges constants (e.g.: EDGES_HEXAGON) or any integer to specify the number of edges of the polygon. Use the variation to switch between the flat-topped or the pointy-topped variation of the polygon. Use the rotation in degrees to rotate the shape clockwise. Use the drawing to switch between outlining or filling the polygon.
Definition at line 527 of file display.cpp.
|
inline |
| void esphome::display::Display::set_pages | ( | std::vector< DisplayPage * > | pages | ) |
Definition at line 729 of file display.cpp.
|
virtual |
Internal method to set the display rotation with.
Reimplemented in esphome::epaper_spi::EPaperBase, esphome::hub75::HUB75Display, esphome::it8951::IT8951Display, and esphome::mipi_spi::MipiSpi< BUFFERTYPE, BUFFERPIXEL, IS_BIG_ENDIAN, DISPLAYPIXEL, BUS_TYPE, WIDTH, HEIGHT, OFFSET_WIDTH, OFFSET_HEIGHT, PAD_WIDTH, PAD_HEIGHT, MADCTL, HAS_HARDWARE_ROTATION >.
Definition at line 18 of file display.cpp.
| void esphome::display::Display::set_writer | ( | display_writer_t && | writer | ) |
Internal method to set the display writer lambda.
Definition at line 727 of file display.cpp.
| void esphome::display::Display::show_page | ( | DisplayPage * | page | ) |
Definition at line 745 of file display.cpp.
| void esphome::display::Display::shrink_clipping | ( | Rect | rect | ) |
substract a rectangular region to the invalidation region
| [in] | rect | Rectangle to add to the invalidation region |
Definition at line 818 of file display.cpp.
|
inline |
|
protected |
Definition at line 385 of file display.cpp.
|
inline |
| void esphome::display::Display::start_clipping | ( | Rect | rect | ) |
Set the clipping rectangle for further drawing.
| [in] | rect | Pointer to Rect for clipping (or NULL for entire screen) |
return true if success, false if error
Definition at line 794 of file display.cpp.
| void esphome::display::Display::strftime | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| Color | background, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ESPTime | time ) |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| background | The background color to draw the text with. |
| align | The alignment of the text. |
| format | The format to use. |
| ... | The arguments to use for the text formatting. |
Definition at line 770 of file display.cpp.
| void esphome::display::Display::strftime | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| const char * | format, | ||
| ESPTime | time ) |
Evaluate the strftime-format format and print the result with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| format | The strftime format to use. |
| time | The time to format. |
Definition at line 782 of file display.cpp.
| void esphome::display::Display::strftime | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| Color | color, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ESPTime | time ) |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| color | The color to draw the text with. |
| align | The alignment of the text. |
| format | The strftime format to use. |
| time | The time to format. |
Definition at line 778 of file display.cpp.
| void esphome::display::Display::strftime | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| const char * | format, | ||
| ESPTime | time ) |
Evaluate the strftime-format format and print the result with the top left at [x,y] with font.
| x | The x coordinate of the upper left corner. |
| y | The y coordinate of the upper left corner. |
| font | The font to draw the text with. |
| format | The strftime format to use. |
| time | The time to format. |
Definition at line 790 of file display.cpp.
| void esphome::display::Display::strftime | ( | int | x, |
| int | y, | ||
| BaseFont * | font, | ||
| TextAlign | align, | ||
| const char * | format, | ||
| ESPTime | time ) |
Evaluate the strftime-format format and print the result with the anchor point at [x,y] with font.
| x | The x coordinate of the text alignment anchor point. |
| y | The y coordinate of the text alignment anchor point. |
| font | The font to draw the text with. |
| align | The alignment of the text. |
| format | The strftime format to use. |
| time | The time to format. |
Definition at line 786 of file display.cpp.
| void esphome::display::Display::test_card | ( | ) |
Definition at line 882 of file display.cpp.
| void HOT esphome::display::Display::triangle | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| int | x3, | ||
| int | y3, | ||
| Color | color = COLOR_ON ) |
Draw the outline of a triangle contained between the points [x1,y1], [x2,y2] and [x3,y3] with the given color.
Definition at line 379 of file display.cpp.
| void HOT esphome::display::Display::vertical_line | ( | int | x, |
| int | y, | ||
| int | height, | ||
| Color | color = COLOR_ON ) |
Draw a vertical line from the point [x,y] to [x,y+width] with the given color.
Definition at line 160 of file display.cpp.
|
protected |
Definition at line 579 of file display.cpp.
|
protected |
| int int int const uint8_t ColorOrder ColorBitness bool esphome::display::Display::big_endian |
| int int int const uint8_t ColorOrder ColorBitness esphome::display::Display::bitness |
|
protected |
| int int int const uint8_t ColorOrder esphome::display::Display::order |
|
protected |
|
protected |
| int int int const uint8_t * esphome::display::Display::ptr |
|
protected |
|
protected |
|
protected |
|
protected |
| int int int const uint8_t ColorOrder ColorBitness bool int esphome::display::Display::x_offset |
| int int int const uint8_t ColorOrder ColorBitness bool int int int esphome::display::Display::x_pad |
| int int int const uint8_t ColorOrder ColorBitness bool int int esphome::display::Display::y_offset |