22 const auto&
get_tl() const noexcept {
return m_top_left; }
23 const auto&
get_br() const noexcept {
return m_bottom_right; }
141std::ostream& operator<<(std::ostream& os, const
screen_rect& r) noexcept;
The coordinate on a screen.
Definition screen_coordinate.h:12
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
const auto & get_tl() const noexcept
Definition screen_rect.h:22
const auto & get_br() const noexcept
Definition screen_rect.h:23
screen_rect get_lhs_half(const screen_rect &r) noexcept
Get the left-hand side half (i.e. 50% of the rect)
Definition screen_rect.cpp:152
screen_rect get_lower_fourth(const screen_rect &r) noexcept
Get the lower fourth (i.e. 25% of the rect, half of the lower half)
Definition screen_rect.cpp:171
screen_rect create_centered_rect(const screen_coordinate c, const int w, const int h) noexcept
Create a rectangle that is centered around a point, with a custom height and width.
Definition screen_rect.cpp:117
screen_rect create_rect_inside(const screen_rect &r) noexcept
Create a rectangle that is exactly one pixel inside the given one.
Definition screen_rect.cpp:81
screen_rect create_partial_rect_from_side(const side s, const screen_rect &r, const double f)
Create a partial rectangle from a certain side.
Definition screen_rect.cpp:71
screen_rect get_bottom_left_corner(const screen_rect &r) noexcept
Get the bottom-left corner (i.e. 25% of the rect)
Definition screen_rect.cpp:88
screen_rect get_rhs_half(const screen_rect &r) noexcept
Get the right-hand side half (i.e. 50% of the rect)
Definition screen_rect.cpp:190
screen_rect get_upper_half(const screen_rect &r) noexcept
Get the upper half (i.e. 50% of the rect)
Definition screen_rect.cpp:231
screen_rect get_bottom_right_corner(const screen_rect &r) noexcept
Get the bottom-right corner (i.e. 25% of the rect)
Definition screen_rect.cpp:102
screen_rect create_partial_rect_from_rhs(const screen_rect &r, const double f)
Create a partial rectangle, from the right hand side.
Definition screen_rect.cpp:45
screen_rect get_lower_half(const screen_rect &r) noexcept
Get the lower half (i.e. 50% of the rect)
Definition screen_rect.cpp:176
screen_rect get_lower_eighth(const screen_rect &r) noexcept
Get the lower eighth (i.e.
Definition screen_rect.cpp:166
screen_coordinate get_center(const screen_rect &r) noexcept
Definition screen_rect.cpp:132
screen_rect get_top_right_corner(const screen_rect &r) noexcept
Get the top-right corner (i.e. 25% of the rect)
Definition screen_rect.cpp:217
void test_screen_rect()
Test this class and its free functions.
Definition screen_rect.cpp:259
screen_rect create_partial_rect_from_lhs(const screen_rect &r, const double f)
Create a partial rectangle, from the left hand side.
Definition screen_rect.cpp:28
int get_height(const screen_rect &r) noexcept
Definition screen_rect.cpp:147
screen_rect get_top_left_corner(const screen_rect &r) noexcept
Get the top-left corner (i.e. 25% of the rect)
Definition screen_rect.cpp:203
int get_width(const screen_rect &r) noexcept
Definition screen_rect.cpp:245
screen_rect get_default_screen_rect() noexcept
Get the default screen rectangle.
Definition screen_rect.cpp:140
bool is_in(const screen_coordinate &pos, const screen_rect &r) noexcept
Is the coordinat in the rectangle?
Definition screen_rect.cpp:250
side
The side the player/piece is on.
Definition side.h:11