8static const int16_t VALUE_NO_SET = 32766;
17 Rect() :
x(VALUE_NO_SET),
y(VALUE_NO_SET),
w(VALUE_NO_SET),
h(VALUE_NO_SET) {}
18 inline Rect(int16_t
x, int16_t
y, int16_t
w, int16_t
h) ESPHOME_ALWAYS_INLINE :
x(
x),
y(
y),
w(
w),
h(
h) {}
19 inline int16_t
x2()
const {
return this->x + this->
w; };
20 inline int16_t
y2()
const {
return this->y + this->
h; };
22 inline bool is_set() const ESPHOME_ALWAYS_INLINE {
return (this->h != VALUE_NO_SET) && (this->w != VALUE_NO_SET); }
24 void expand(int16_t horizontal, int16_t vertical);
30 bool inside(int16_t test_x, int16_t test_y,
bool absolute =
true)
const;
32 void info(
const std::string &prefix =
"rect info:");
int16_t x
X coordinate of corner.
int16_t h
Height of region.
int16_t y
Y coordinate of corner.
void info(const std::string &prefix="rect info:")
void expand(int16_t horizontal, int16_t vertical)
bool inside(Rect rect) const
Rect(int16_t x, int16_t y, int16_t w, int16_t h) ESPHOME_ALWAYS_INLINE
bool is_set() const ESPHOME_ALWAYS_INLINE
Y coordinate of corner.
bool equal(Rect rect) const
int16_t y2() const
X coordinate of corner.
int16_t w
Width of region.
Providing packet encoding functions for exchanging data with a remote host.