11#include "../SIMD/module.hpp"
12#include "../utility/module.hpp"
14namespace hi {
inline namespace v1 {
24 using array_type = simd<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 left()
const noexcept
49 [[nodiscard]]
constexpr value_type& left()
noexcept
54 [[nodiscard]]
constexpr value_type bottom()
const noexcept
59 [[nodiscard]]
constexpr value_type& bottom()
noexcept
64 [[nodiscard]]
constexpr value_type right()
const noexcept
69 [[nodiscard]]
constexpr value_type& right()
noexcept
74 [[nodiscard]]
constexpr value_type 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
108 return equal(lhs._v, rhs._v);
121[[nodiscard]]
constexpr marginsi narrow_cast(
margins const& rhs)
noexcept
124 narrow_cast<int>(rhs.left()), narrow_cast<int>(rhs.bottom()), narrow_cast<int>(rhs.right()), narrow_cast<int>(rhs.top())};
128[[nodiscard]]
constexpr margins narrow_cast(marginsi
const& rhs)
noexcept
131 narrow_cast<float>(rhs.left()),
132 narrow_cast<float>(rhs.bottom()),
133 narrow_cast<float>(rhs.right()),
134 narrow_cast<float>(rhs.top())};
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
The left, bottom, right and top margins.
Definition margins.hpp:21