113 constexpr Point(int16_t px, int16_t py) :
x(px),
y(py) {}
134 constexpr Rect(int16_t rx, int16_t ry, int16_t rw, int16_t rh)
135 :
x(rx),
y(ry),
w(rw),
h(rh) {}
138 constexpr bool isEmpty()
const {
return w <= 0 ||
h <= 0; }
140 constexpr bool contains(int16_t px, int16_t py)
const {
141 return px >=
x && px < (
x +
w) && py >=
y && py < (
y +
h);
Result(ErrorCode code, const char *msg="")
Definition types.h:90
Result()
Definition types.h:86
bool isOk() const
Definition types.h:93
bool isError() const
Definition types.h:95
const Error & error() const
Definition types.h:97
Result(const Error &err)
Definition types.h:88
T & value()
Definition types.h:71
bool isOk() const
Definition types.h:64
Result(const Error &err)
Definition types.h:59
const T & value() const
Definition types.h:69
Result(T &&val)
Definition types.h:57
Result(const T &val)
Definition types.h:55
Result(ErrorCode code, const char *msg="")
Definition types.h:61
bool isError() const
Definition types.h:66
const Error & error() const
Definition types.h:74
T value_
Definition types.h:77
Error error_
Definition types.h:78
Definition application.h:10
ErrorCode
Definition types.h:13
constexpr bool isError() const
Definition types.h:40
constexpr bool isOk() const
Definition types.h:38
ErrorCode code
Definition types.h:28
constexpr Error(ErrorCode c, const char *msg="")
Definition types.h:35
const char * message
Definition types.h:30
constexpr Error()=default
int16_t y
Definition types.h:108
int16_t x
Definition types.h:106
constexpr Point()=default
constexpr Point(int16_t px, int16_t py)
Definition types.h:113
int16_t y
Definition types.h:125
constexpr bool contains(int16_t px, int16_t py) const
Definition types.h:140
int16_t h
Definition types.h:129
int16_t x
Definition types.h:123
int16_t w
Definition types.h:127
constexpr Rect(int16_t rx, int16_t ry, int16_t rw, int16_t rh)
Definition types.h:134
constexpr bool isEmpty() const
Definition types.h:138