11namespace hi {
inline namespace v1 {
22 using array_type = simd<value_type, 4>;
30 [[nodiscard]]
constexpr corner_radii(value_type radius) noexcept : _v(radius, radius, radius, radius) {}
31 [[nodiscard]]
constexpr corner_radii(value_type lb, value_type rb, value_type lt, value_type rt) noexcept : _v(lb, rb, lt, rt)
39 [[nodiscard]]
constexpr explicit corner_radii(array_type v) noexcept : _v(v) {}
41 [[nodiscard]]
constexpr explicit operator array_type() const noexcept
46 [[nodiscard]]
constexpr value_type left_bottom() const noexcept
51 [[nodiscard]]
constexpr value_type right_bottom() const noexcept
56 [[nodiscard]]
constexpr value_type left_top() const noexcept
61 [[nodiscard]]
constexpr value_type right_top() const noexcept
66 [[nodiscard]]
constexpr value_type& left_bottom() noexcept
71 [[nodiscard]]
constexpr value_type& right_bottom() noexcept
76 [[nodiscard]]
constexpr value_type& left_top() noexcept
81 [[nodiscard]]
constexpr value_type& right_top() noexcept
94 return get<I>(rhs._v);
112 [[nodiscard]]
constexpr friend corner_radii operator-(corner_radii
const& lhs, value_type rhs)
noexcept
114 return corner_radii{array_type{lhs} - rhs};
123using corner_radii = geo::corner_radii<float>;
124using corner_radiii = geo::corner_radii<int>;
127[[nodiscard]]
constexpr corner_radii narrow_cast(corner_radiii
const& rhs)
noexcept
130 narrow_cast<float>(rhs.left_bottom()),
131 narrow_cast<float>(rhs.right_bottom()),
132 narrow_cast<float>(rhs.left_top()),
133 narrow_cast<float>(rhs.right_top())};
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
The 4 radii of the corners of a quad or rectangle.
Definition corner_radii.hpp:19
constexpr friend float get(corner_radii const &rhs) noexcept
Get the corner radius by index.
Definition corner_radii.hpp:92
constexpr float operator[](std::size_t i) const noexcept
Get the corner radius by index.
Definition corner_radii.hpp:102
constexpr corner_radii(array_type v) noexcept
Construct a corner_radii from a simd.
Definition corner_radii.hpp:39