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

#include <rect.h>

Public Member Functions

 Rect ()
 
 Rect (int16_t x, int16_t y, int16_t w, int16_t h) ESPHOME_ALWAYS_INLINE
 
int16_t x2 () const
 
int16_t y2 () const
 X coordinate of corner. More...
 
bool is_set () const ESPHOME_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) const
 
bool inside (int16_t test_x, int16_t test_y, bool absolute=true) const
 
bool equal (Rect rect) const
 
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 10 of file rect.h.

Constructor & Destructor Documentation

◆ Rect() [1/2]

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

Definition at line 17 of file rect.h.

◆ Rect() [2/2]

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

Definition at line 18 of file rect.h.

Member Function Documentation

◆ equal()

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

Definition at line 63 of file rect.cpp.

◆ expand()

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

Definition at line 10 of file rect.cpp.

◆ extend()

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

Definition at line 19 of file rect.cpp.

◆ info()

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

Definition at line 89 of file rect.cpp.

◆ inside() [1/2]

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

Definition at line 78 of file rect.cpp.

◆ inside() [2/2]

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

Definition at line 67 of file rect.cpp.

◆ is_set()

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

Y coordinate of corner.

Definition at line 22 of file rect.h.

◆ shrink()

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

Definition at line 42 of file rect.cpp.

◆ x2()

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

Definition at line 19 of file rect.h.

◆ y2()

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

X coordinate of corner.

Definition at line 20 of file rect.h.

Field Documentation

◆ h

int16_t esphome::display::Rect::h

Height of region.

Definition at line 15 of file rect.h.

◆ w

int16_t esphome::display::Rect::w

Width of region.

Definition at line 14 of file rect.h.

◆ x

int16_t esphome::display::Rect::x

X coordinate of corner.

Definition at line 12 of file rect.h.

◆ y

int16_t esphome::display::Rect::y

Y coordinate of corner.

Definition at line 13 of file rect.h.


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