37template <SupportsTransparency PixelType>
67 auto operator<=>(
const Candidate &other)
const
69 return flipped_tile <=> other.flipped_tile;
74 std::pair{
false,
false}, std::pair{
false,
true}, std::pair{
true,
false}, std::pair{
true,
true}};
76 std::vector<Candidate> candidates;
77 candidates.reserve(4);
79 for (
const auto &[h, v] : flips) {
80 candidates.push_back({tile.flip(h, v), h, v});
83 auto min_candidate = *std::min_element(candidates.begin(), candidates.end());
86 *
static_cast<PixelTile<PixelType> *
>(
this) = min_candidate.flipped_tile;
87 h_flip_ = min_candidate.h_flip;
88 v_flip_ = min_candidate.v_flip;
A PixelTile representation that stores the canonical (lexicographically minimal) orientation among al...
bool v_flip() const
Returns the vertical flip flag.
CanonicalPixelTile(const PixelTile< PixelType > &tile)
Constructs a CanonicalPixelTile by finding the canonical orientation of the input tile.
bool h_flip() const
Returns the horizontal flip flag.
auto operator<=>(const CanonicalPixelTile &other) const =default
Three-way comparison operator that compares all fields in lexicographic order.
An 8x8 tile backed by literal-array-based per-pixel storage of an arbitrary pixel type.