21 return w > 0 && h > 0;
32 auto newtlx = std::max(x, rect.x);
33 auto newtly = std::max(y, rect.y);
34 auto newbrx = std::min(x + w, rect.x + rect.w);
35 auto newbry = std::min(y + h, rect.y + rect.h);
37 if (newbrx < newtlx || newbry < newtly)
40 return pixel_rect{newtlx, newtly, newbrx - newtlx, newbry - newtly};
43 bool operator==(
const pixel_rect& cmp)
const noexcept
45 return w == cmp.w && h == cmp.h && x == cmp.x && y == cmp.y;
47 bool operator!=(
const pixel_rect& cmp)
const noexcept
49 return !(*
this == cmp);
52 pixel_rect(int32_t _x, int32_t _y, int32_t _w, int32_t _h)