8 CornersMaskRef() =
default;
9 explicit CornersMaskRef(std::span<const QImage, 4> masks)
10 : p { &masks[0], &masks[1], &masks[2], &masks[3] } {}
11 explicit CornersMaskRef(std::array<const QImage, 4> masks)
12 : p { &masks[0], &masks[1], &masks[2], &masks[3] } {}
13 explicit CornersMaskRef(std::span<const QImage*, 4> masks)
14 : p { masks[0], masks[1], masks[2], masks[3] } {}
15 explicit CornersMaskRef(std::array<const QImage*, 4> masks)
16 : p { masks[0], masks[1], masks[2], masks[3] } {}
18 [[nodiscard]]
bool empty()
const {
return ! p[0] && ! p[1] && ! p[2] && ! p[3]; }
20 std::array<const QImage*, 4> p {};
22 friend inline constexpr std::strong_ordering operator<=>(CornersMaskRef a,
23 CornersMaskRef b)
noexcept {
24 for (
auto i = 0; i != 4; ++i) {
25 if (a.p[i] < b.p[i]) {
26 return std::strong_ordering::less;
27 }
else if (a.p[i] > b.p[i]) {
28 return std::strong_ordering::greater;
31 return std::strong_ordering::equal;
33 friend inline constexpr bool operator==(CornersMaskRef a, CornersMaskRef b)
noexcept =
default;