41template <
typename PixelType>
68 auto keys1 = lhs.colors_ | std::views::keys;
69 auto keys2 = rhs.colors_ | std::views::keys;
70 return std::ranges::lexicographical_compare(keys1, keys2);
82 auto keys = colors_ | std::views::keys;
109 for (
const auto &[mask, color] : colors_) {
110 result.colors_.insert_or_assign(mask.flip(h, v), color);
122 [[nodiscard]]
const std::map<ShapeMask, PixelType> &
colors()
const
137 colors_.insert_or_assign(mask, color);
141 std::map<ShapeMask, PixelType> colors_;
Represents which pixels in an 8x8 tile are non-transparent.
bool is_transparent() const
Checks if this entire ShapeMask is transparent.
An 8x8 tile backed by mask-based storage that maps shape regions to pixel values.
virtual ~ShapeTile()=default
void set(const ShapeMask &mask, const PixelType &color)
Sets or updates the pixel value for a specific shape mask.
static bool compare_shape_only(const ShapeTile &lhs, const ShapeTile &rhs)
Compares two ShapeTiles based ONLY on shape masks, ignoring pixel values.
auto operator<=>(const ShapeTile &other) const =default
bool is_transparent() const
Checks if this entire ShapeTile is transparent.
const std::map< ShapeMask, PixelType > & colors() const
Returns the internal map of shape masks to pixel values.
ShapeTile flip(bool h, bool v) const
Creates a flipped version of this ShapeTile.