ESPHome  1.15.2
Data Structures | Typedefs | Enumerations | Variables
esphome::display Namespace Reference

Data Structures

class  DisplayBuffer
 
class  DisplayPage
 
class  DisplayPageShowAction
 
class  DisplayPageShowNextAction
 
class  DisplayPageShowPrevAction
 
class  Font
 
class  Glyph
 
class  Image
 

Typedefs

using display_writer_t = std::function< void(DisplayBuffer &)>
 

Enumerations

enum  TextAlign {
  TextAlign::TOP = 0x00, TextAlign::CENTER_VERTICAL = 0x01, TextAlign::BASELINE = 0x02, TextAlign::BOTTOM = 0x04,
  TextAlign::LEFT = 0x00, TextAlign::CENTER_HORIZONTAL = 0x08, TextAlign::RIGHT = 0x10, TextAlign::TOP_LEFT = TOP | LEFT,
  TextAlign::TOP_CENTER = TOP | CENTER_HORIZONTAL, TextAlign::TOP_RIGHT = TOP | RIGHT, TextAlign::CENTER_LEFT = CENTER_VERTICAL | LEFT, TextAlign::CENTER = CENTER_VERTICAL | CENTER_HORIZONTAL,
  TextAlign::CENTER_RIGHT = CENTER_VERTICAL | RIGHT, TextAlign::BASELINE_LEFT = BASELINE | LEFT, TextAlign::BASELINE_CENTER = BASELINE | CENTER_HORIZONTAL, TextAlign::BASELINE_RIGHT = BASELINE | RIGHT,
  TextAlign::BOTTOM_LEFT = BOTTOM | LEFT, TextAlign::BOTTOM_CENTER = BOTTOM | CENTER_HORIZONTAL, TextAlign::BOTTOM_RIGHT = BOTTOM | RIGHT
}
 TextAlign is used to tell the display class how to position a piece of text. More...
 
enum  ImageType { IMAGE_TYPE_BINARY = 0, IMAGE_TYPE_GRAYSCALE = 1, IMAGE_TYPE_RGB24 = 2 }
 
enum  DisplayRotation { DISPLAY_ROTATION_0_DEGREES = 0, DISPLAY_ROTATION_90_DEGREES = 90, DISPLAY_ROTATION_180_DEGREES = 180, DISPLAY_ROTATION_270_DEGREES = 270 }
 

Variables

const Color COLOR_OFF (0, 0, 0, 0)
 Turn the pixel OFF. More...
 
const Color COLOR_ON (1, 1, 1, 1)
 Turn the pixel ON. More...
 

Typedef Documentation

◆ display_writer_t

using esphome::display::display_writer_t = typedef std::function<void(DisplayBuffer &)>

Definition at line 85 of file display_buffer.h.

Enumeration Type Documentation

◆ DisplayRotation

Enumerator
DISPLAY_ROTATION_0_DEGREES 
DISPLAY_ROTATION_90_DEGREES 
DISPLAY_ROTATION_180_DEGREES 
DISPLAY_ROTATION_270_DEGREES 

Definition at line 73 of file display_buffer.h.

◆ ImageType

Enumerator
IMAGE_TYPE_BINARY 
IMAGE_TYPE_GRAYSCALE 
IMAGE_TYPE_RGB24 

Definition at line 71 of file display_buffer.h.

◆ TextAlign

TextAlign is used to tell the display class how to position a piece of text.

By default the coordinates you enter for the print*() functions take the upper left corner of the text as the "anchor" point. You can customize this behavior to, for example, make the coordinates refer to the center of the text.

All text alignments consist of an X and Y-coordinate alignment. For the alignment along the X-axis these options are allowed:

  • LEFT (x-coordinate of anchor point is on left)
  • CENTER_HORIZONTAL (x-coordinate of anchor point is in the horizontal center of the text)
  • RIGHT (x-coordinate of anchor point is on right)

For the Y-Axis alignment these options are allowed:

  • TOP (y-coordinate of anchor is on the top of the text)
  • CENTER_VERTICAL (y-coordinate of anchor is in the vertical center of the text)
  • BASELINE (y-coordinate of anchor is on the baseline of the text)
  • BOTTOM (y-coordinate of anchor is on the bottom of the text)

These options are then combined to create combined TextAlignment options like:

  • TOP_LEFT (default)
  • CENTER (anchor point is in the middle of the text bounds)
  • ...
Enumerator
TOP 
CENTER_VERTICAL 
BASELINE 
BOTTOM 
LEFT 
CENTER_HORIZONTAL 
RIGHT 
TOP_LEFT 
TOP_CENTER 
TOP_RIGHT 
CENTER_LEFT 
CENTER 
CENTER_RIGHT 
BASELINE_LEFT 
BASELINE_CENTER 
BASELINE_RIGHT 
BOTTOM_LEFT 
BOTTOM_CENTER 
BOTTOM_RIGHT 

Definition at line 39 of file display_buffer.h.

Variable Documentation

◆ COLOR_OFF

const Color esphome::display::COLOR_OFF

Turn the pixel OFF.

Definition at line 67 of file display_buffer.h.

◆ COLOR_ON

const Color esphome::display::COLOR_ON

Turn the pixel ON.

Definition at line 69 of file display_buffer.h.