43template <
typename PixelType>
74 bool operator<(
const Candidate &other)
const
81 std::pair{
false,
false}, std::pair{
false,
true}, std::pair{
true,
false}, std::pair{
true,
true}};
83 std::vector<Candidate> candidates;
84 candidates.reserve(4);
86 for (
const auto &[h, v] : flips) {
87 candidates.push_back({tile.flip(h, v), h, v});
90 auto min_candidate = *std::min_element(candidates.begin(), candidates.end());
93 *
static_cast<ShapeTile<PixelType> *
>(
this) = min_candidate.flipped_tile;
94 h_flip_ = min_candidate.h_flip;
95 v_flip_ = min_candidate.v_flip;
A ShapeTile representation that stores the canonical (lexicographically minimal) orientation among al...
bool h_flip() const
Returns the horizontal flip flag.
auto operator<=>(const CanonicalShapeTile &other) const =default
Three-way comparison operator that compares all fields.
CanonicalShapeTile(const ShapeTile< PixelType > &tile)
Constructs a CanonicalShapeTile by finding the canonical orientation of the input tile.
bool v_flip() const
Returns the vertical flip flag.
An 8x8 tile backed by mask-based storage that maps shape regions to pixel values.