ESPHome  2023.5.5
Public Member Functions | Data Fields
esphome::display::Rect Class Reference

#include <display_buffer.h>

Public Member Functions

 Rect ()
 
 Rect (int16_t x, int16_t y, int16_t w, int16_t h) ALWAYS_INLINE
 
int16_t x2 ()
 
int16_t y2 ()
 X coordinate of corner. More...
 
bool is_set () ALWAYS_INLINE
 Y coordinate of corner. More...
 
void expand (int16_t horizontal, int16_t vertical)
 
void extend (Rect rect)
 
void shrink (Rect rect)
 
bool inside (Rect rect, bool absolute=true)
 
bool inside (int16_t test_x, int16_t test_y, bool absolute=true)
 
bool equal (Rect rect)
 
void info (const std::string &prefix="rect info:")
 

Data Fields

int16_t x
 X coordinate of corner. More...
 
int16_t y
 Y coordinate of corner. More...
 
int16_t w
 Width of region. More...
 
int16_t h
 Height of region. More...
 

Detailed Description

Definition at line 104 of file display_buffer.h.

Constructor & Destructor Documentation

◆ Rect() [1/2]

esphome::display::Rect::Rect ( )
inline

Definition at line 111 of file display_buffer.h.

◆ Rect() [2/2]

esphome::display::Rect::Rect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h 
)
inline

Definition at line 112 of file display_buffer.h.

Member Function Documentation

◆ equal()

bool esphome::display::Rect::equal ( Rect  rect)

Definition at line 71 of file display_buffer.cpp.

◆ expand()

void esphome::display::Rect::expand ( int16_t  horizontal,
int16_t  vertical 
)

Definition at line 18 of file display_buffer.cpp.

◆ extend()

void esphome::display::Rect::extend ( Rect  rect)

Definition at line 27 of file display_buffer.cpp.

◆ info()

void esphome::display::Rect::info ( const std::string &  prefix = "rect info:")

Definition at line 97 of file display_buffer.cpp.

◆ inside() [1/2]

bool esphome::display::Rect::inside ( Rect  rect,
bool  absolute = true 
)

Definition at line 86 of file display_buffer.cpp.

◆ inside() [2/2]

bool esphome::display::Rect::inside ( int16_t  test_x,
int16_t  test_y,
bool  absolute = true 
)

Definition at line 75 of file display_buffer.cpp.

◆ is_set()

bool esphome::display::Rect::is_set ( )
inline

Y coordinate of corner.

Definition at line 116 of file display_buffer.h.

◆ shrink()

void esphome::display::Rect::shrink ( Rect  rect)

Definition at line 50 of file display_buffer.cpp.

◆ x2()

int16_t esphome::display::Rect::x2 ( )
inline

Definition at line 113 of file display_buffer.h.

◆ y2()

int16_t esphome::display::Rect::y2 ( )
inline

X coordinate of corner.

Definition at line 114 of file display_buffer.h.

Field Documentation

◆ h

int16_t esphome::display::Rect::h

Height of region.

Definition at line 109 of file display_buffer.h.

◆ w

int16_t esphome::display::Rect::w

Width of region.

Definition at line 108 of file display_buffer.h.

◆ x

int16_t esphome::display::Rect::x

X coordinate of corner.

Definition at line 106 of file display_buffer.h.

◆ y

int16_t esphome::display::Rect::y

Y coordinate of corner.

Definition at line 107 of file display_buffer.h.


The documentation for this class was generated from the following files: