Terminal++ 3.1.0.4
A C++ library for interacting with ANSI terminal windows
Loading...
Searching...
No Matches
rectangle.hpp
1#pragma once
2
3#include "terminalpp/detail/export.hpp"
4#include "terminalpp/extent.hpp"
5#include "terminalpp/point.hpp"
6
7#include <iosfwd>
8
9namespace terminalpp {
10
11//* =========================================================================
13//* =========================================================================
15{
16 //* =====================================================================
20 //* =====================================================================
21 constexpr rectangle() noexcept = default;
22
23 //* =====================================================================
27 //* =====================================================================
29 terminalpp::point origin, terminalpp::extent size) noexcept
30 : origin_(origin), size_(size)
31 {
32 }
33
34 //* =====================================================================
36 //* =====================================================================
37 [[nodiscard]] constexpr friend auto operator<=>(
38 rectangle const &lhs, rectangle const &rhs) noexcept = default;
39
42
46};
47
48//* =====================================================================
51//* =====================================================================
53std::ostream &operator<<(std::ostream &out, rectangle const &rect);
54
55} // namespace terminalpp
A structure representing an ANSI graphics effect (e.g. intensity, underlining)
Definition effect.hpp:27
constexpr effect() noexcept
Initialises the intensity to the default (normal) value.
Definition effect.hpp:31
A class that represents a direction with distance in space (a vector).
Definition extent.hpp:18
A class that represents a position in space.
Definition point.hpp:17
A class that represents a rectangle in space.
Definition rectangle.hpp:15
constexpr friend auto operator<=>(rectangle const &lhs, rectangle const &rhs) noexcept=default
Relational operators for rectangles.
terminalpp::extent size_
The size (amount the rectangle extends right and down) of the rectangle.
Definition rectangle.hpp:45
constexpr rectangle() noexcept=default
Default Constructor.
terminalpp::point origin_
The origin (top-left point) of the rectangle.
Definition rectangle.hpp:41