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

Data Structures

class  BaseFont
 
class  BaseImage
 
class  ColorUtil
 
class  Display
 
class  DisplayBuffer
 
class  DisplayIsDisplayingPageCondition
 
class  DisplayOnPageChangeTrigger
 
class  DisplayPage
 
class  DisplayPageShowAction
 
class  DisplayPageShowNextAction
 
class  DisplayPageShowPrevAction
 
class  Rect
 

Typedefs

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

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  ImageAlign {
  ImageAlign::TOP = 0x00, ImageAlign::CENTER_VERTICAL = 0x01, ImageAlign::BOTTOM = 0x02, ImageAlign::LEFT = 0x00,
  ImageAlign::CENTER_HORIZONTAL = 0x04, ImageAlign::RIGHT = 0x08, ImageAlign::TOP_LEFT = TOP | LEFT, ImageAlign::TOP_CENTER = TOP | CENTER_HORIZONTAL,
  ImageAlign::TOP_RIGHT = TOP | RIGHT, ImageAlign::CENTER_LEFT = CENTER_VERTICAL | LEFT, ImageAlign::CENTER = CENTER_VERTICAL | CENTER_HORIZONTAL, ImageAlign::CENTER_RIGHT = CENTER_VERTICAL | RIGHT,
  ImageAlign::BOTTOM_LEFT = BOTTOM | LEFT, ImageAlign::BOTTOM_CENTER = BOTTOM | CENTER_HORIZONTAL, ImageAlign::BOTTOM_RIGHT = BOTTOM | RIGHT, ImageAlign::HORIZONTAL_ALIGNMENT = LEFT | CENTER_HORIZONTAL | RIGHT,
  ImageAlign::VERTICAL_ALIGNMENT = TOP | CENTER_VERTICAL | BOTTOM
}
 ImageAlign is used to tell the display class how to position a image. More...
 
enum  DisplayType { DISPLAY_TYPE_BINARY = 1, DISPLAY_TYPE_GRAYSCALE = 2, DISPLAY_TYPE_COLOR = 3 }
 
enum  DisplayRotation { DISPLAY_ROTATION_0_DEGREES = 0, DISPLAY_ROTATION_90_DEGREES = 90, DISPLAY_ROTATION_180_DEGREES = 180, DISPLAY_ROTATION_270_DEGREES = 270 }
 
enum  RegularPolygonVariation { VARIATION_POINTY_TOP = 0, VARIATION_FLAT_TOP = 1 }
 
enum  RegularPolygonDrawing { DRAWING_OUTLINE = 0, DRAWING_FILLED = 1 }
 
enum  ColorOrder : uint8_t { COLOR_ORDER_RGB = 0, COLOR_ORDER_BGR = 1, COLOR_ORDER_GRB = 2 }
 
enum  ColorBitness : uint8_t { COLOR_BITNESS_888 = 0, COLOR_BITNESS_565 = 1, COLOR_BITNESS_332 = 2 }
 

Functions

const LogString * text_align_to_string (TextAlign textalign)
 

Variables

const Color COLOR_OFF (0, 0, 0, 0)
 Turn the pixel OFF. More...
 
const Color COLOR_ON (255, 255, 255, 255)
 Turn the pixel ON. More...
 
const uint8_t TESTCARD_FONT [3][8] PROGMEM
 
const int EDGES_TRIGON = 3
 
const int EDGES_TRIANGLE = 3
 
const int EDGES_TETRAGON = 4
 
const int EDGES_QUADRILATERAL = 4
 
const int EDGES_PENTAGON = 5
 
const int EDGES_HEXAGON = 6
 
const int EDGES_HEPTAGON = 7
 
const int EDGES_OCTAGON = 8
 
const int EDGES_NONAGON = 9
 
const int EDGES_ENNEAGON = 9
 
const int EDGES_DECAGON = 10
 
const int EDGES_HENDECAGON = 11
 
const int EDGES_DODECAGON = 12
 
const int EDGES_TRIDECAGON = 13
 
const int EDGES_TETRADECAGON = 14
 
const int EDGES_PENTADECAGON = 15
 
const int EDGES_HEXADECAGON = 16
 
const float ROTATION_0_DEGREES = 0.0
 
const float ROTATION_45_DEGREES = 45.0
 
const float ROTATION_90_DEGREES = 90.0
 
const float ROTATION_180_DEGREES = 180.0
 
const float ROTATION_270_DEGREES = 270.0
 

Typedef Documentation

◆ display_writer_t

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

Definition at line 181 of file display.h.

Enumeration Type Documentation

◆ ColorBitness

Enumerator
COLOR_BITNESS_888 
COLOR_BITNESS_565 
COLOR_BITNESS_332 

Definition at line 7 of file display_color_utils.h.

◆ ColorOrder

Enumerator
COLOR_ORDER_RGB 
COLOR_ORDER_BGR 
COLOR_ORDER_GRB 

Definition at line 6 of file display_color_utils.h.

◆ DisplayRotation

Enumerator
DISPLAY_ROTATION_0_DEGREES 
DISPLAY_ROTATION_90_DEGREES 
DISPLAY_ROTATION_180_DEGREES 
DISPLAY_ROTATION_270_DEGREES 

Definition at line 134 of file display.h.

◆ DisplayType

Enumerator
DISPLAY_TYPE_BINARY 
DISPLAY_TYPE_GRAYSCALE 
DISPLAY_TYPE_COLOR 

Definition at line 128 of file display.h.

◆ ImageAlign

ImageAlign is used to tell the display class how to position a image.

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

All image 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 image)
  • 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 image)
  • CENTER_VERTICAL (y-coordinate of anchor is in the vertical center of the image)
  • BOTTOM (y-coordinate of anchor is on the bottom of the image)

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

  • TOP_LEFT (default)
  • CENTER (anchor point is in the middle of the image bounds)
  • ...
Enumerator
TOP 
CENTER_VERTICAL 
BOTTOM 
LEFT 
CENTER_HORIZONTAL 
RIGHT 
TOP_LEFT 
TOP_CENTER 
TOP_RIGHT 
CENTER_LEFT 
CENTER 
CENTER_RIGHT 
BOTTOM_LEFT 
BOTTOM_CENTER 
BOTTOM_RIGHT 
HORIZONTAL_ALIGNMENT 
VERTICAL_ALIGNMENT 

Definition at line 103 of file display.h.

◆ RegularPolygonDrawing

Enumerator
DRAWING_OUTLINE 
DRAWING_FILLED 

Definition at line 172 of file display.h.

◆ RegularPolygonVariation

Enumerator
VARIATION_POINTY_TOP 
VARIATION_FLAT_TOP 

Definition at line 167 of file display.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 53 of file display.h.

Function Documentation

◆ text_align_to_string()

const LogString * esphome::display::text_align_to_string ( TextAlign  textalign)

Definition at line 678 of file display.cpp.

Variable Documentation

◆ COLOR_OFF

const Color esphome::display::COLOR_OFF

Turn the pixel OFF.

Definition at line 191 of file display.h.

◆ COLOR_ON

const Color esphome::display::COLOR_ON

Turn the pixel ON.

Definition at line 193 of file display.h.

◆ EDGES_DECAGON

const int esphome::display::EDGES_DECAGON = 10

Definition at line 153 of file display.h.

◆ EDGES_DODECAGON

const int esphome::display::EDGES_DODECAGON = 12

Definition at line 155 of file display.h.

◆ EDGES_ENNEAGON

const int esphome::display::EDGES_ENNEAGON = 9

Definition at line 152 of file display.h.

◆ EDGES_HENDECAGON

const int esphome::display::EDGES_HENDECAGON = 11

Definition at line 154 of file display.h.

◆ EDGES_HEPTAGON

const int esphome::display::EDGES_HEPTAGON = 7

Definition at line 149 of file display.h.

◆ EDGES_HEXADECAGON

const int esphome::display::EDGES_HEXADECAGON = 16

Definition at line 159 of file display.h.

◆ EDGES_HEXAGON

const int esphome::display::EDGES_HEXAGON = 6

Definition at line 148 of file display.h.

◆ EDGES_NONAGON

const int esphome::display::EDGES_NONAGON = 9

Definition at line 151 of file display.h.

◆ EDGES_OCTAGON

const int esphome::display::EDGES_OCTAGON = 8

Definition at line 150 of file display.h.

◆ EDGES_PENTADECAGON

const int esphome::display::EDGES_PENTADECAGON = 15

Definition at line 158 of file display.h.

◆ EDGES_PENTAGON

const int esphome::display::EDGES_PENTAGON = 5

Definition at line 147 of file display.h.

◆ EDGES_QUADRILATERAL

const int esphome::display::EDGES_QUADRILATERAL = 4

Definition at line 146 of file display.h.

◆ EDGES_TETRADECAGON

const int esphome::display::EDGES_TETRADECAGON = 14

Definition at line 157 of file display.h.

◆ EDGES_TETRAGON

const int esphome::display::EDGES_TETRAGON = 4

Definition at line 145 of file display.h.

◆ EDGES_TRIANGLE

const int esphome::display::EDGES_TRIANGLE = 3

Definition at line 144 of file display.h.

◆ EDGES_TRIDECAGON

const int esphome::display::EDGES_TRIDECAGON = 13

Definition at line 156 of file display.h.

◆ EDGES_TRIGON

const int esphome::display::EDGES_TRIGON = 3

Definition at line 143 of file display.h.

◆ PROGMEM

const uint8_t TESTCARD_FONT [3][8] esphome::display::PROGMEM
Initial value:
= {{0x41, 0x7F, 0x7F, 0x09, 0x19, 0x7F, 0x66, 0x00},
{0x1C, 0x3E, 0x63, 0x41, 0x51, 0x73, 0x72, 0x00},
{0x41, 0x7F, 0x7F, 0x49, 0x49, 0x7F, 0x36, 0x00}}

Definition at line 613 of file display.cpp.

◆ ROTATION_0_DEGREES

const float esphome::display::ROTATION_0_DEGREES = 0.0

Definition at line 161 of file display.h.

◆ ROTATION_180_DEGREES

const float esphome::display::ROTATION_180_DEGREES = 180.0

Definition at line 164 of file display.h.

◆ ROTATION_270_DEGREES

const float esphome::display::ROTATION_270_DEGREES = 270.0

Definition at line 165 of file display.h.

◆ ROTATION_45_DEGREES

const float esphome::display::ROTATION_45_DEGREES = 45.0

Definition at line 162 of file display.h.

◆ ROTATION_90_DEGREES

const float esphome::display::ROTATION_90_DEGREES = 90.0

Definition at line 163 of file display.h.