11#include "../rapid/numeric_array.hpp"
14namespace hi {
inline namespace v1 {
24 using array_type = numeric_array<T, 4>;
31 [[nodiscard]]
constexpr margins() noexcept : _v() {}
32 [[nodiscard]]
constexpr margins(value_type margin) noexcept : _v(margin, margin, margin, margin) {}
33 [[nodiscard]]
constexpr margins(value_type left, value_type bottom, value_type right, value_type top) noexcept :
34 _v(left, bottom, right, top)
37 [[nodiscard]]
constexpr explicit margins(array_type v) noexcept : _v(v) {}
39 [[nodiscard]]
constexpr explicit operator array_type()
const noexcept
44 [[nodiscard]]
constexpr value_type
const& left()
const noexcept
49 [[nodiscard]]
constexpr value_type& left()
noexcept
54 [[nodiscard]]
constexpr value_type
const& bottom()
const noexcept
59 [[nodiscard]]
constexpr value_type& bottom()
noexcept
64 [[nodiscard]]
constexpr value_type
const& right()
const noexcept
69 [[nodiscard]]
constexpr value_type& right()
noexcept
74 [[nodiscard]]
constexpr value_type
const& top()
const noexcept
79 [[nodiscard]]
constexpr value_type& top()
noexcept
85 [[nodiscard]]
constexpr friend value_type get(
margins const& rhs)
noexcept
87 return get<I>(rhs._v);
90 [[nodiscard]]
constexpr value_type operator[](
std::size_t i)
const noexcept
103 return margins{max(lhs._v, rhs._v)};
106 [[nodiscard]]
constexpr friend bool operator==(
margins const& lhs,
margins const& rhs)
noexcept =
default;
118[[nodiscard]]
constexpr marginsi narrow_cast(
margins const& rhs)
noexcept
121 narrow_cast<int>(rhs.left()), narrow_cast<int>(rhs.bottom()), narrow_cast<int>(rhs.right()), narrow_cast<int>(rhs.top())};
125[[nodiscard]]
constexpr margins narrow_cast(marginsi
const& rhs)
noexcept
128 narrow_cast<float>(rhs.left()),
129 narrow_cast<float>(rhs.bottom()),
130 narrow_cast<float>(rhs.right()),
131 narrow_cast<float>(rhs.top())};
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
The left, bottom, right and top margins.
Definition margins.hpp:21