ESPHome  2023.8.3
Data Structures | Typedefs | Enumerations | 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  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 }
 

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...
 

Typedef Documentation

◆ display_writer_t

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

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

◆ DisplayType

Enumerator
DISPLAY_TYPE_BINARY 
DISPLAY_TYPE_GRAYSCALE 
DISPLAY_TYPE_COLOR 

Definition at line 122 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 97 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 47 of file display.h.

Variable Documentation

◆ COLOR_OFF

const Color esphome::display::COLOR_OFF

Turn the pixel OFF.

Definition at line 149 of file display.h.

◆ COLOR_ON

const Color esphome::display::COLOR_ON

Turn the pixel ON.

Definition at line 151 of file display.h.