43template <
typename PixelType>
72 auto keys1 = lhs.colors_ | std::views::keys;
73 auto keys2 = rhs.colors_ | std::views::keys;
74 return std::ranges::lexicographical_compare(keys1, keys2);
88 auto keys = colors_ | std::views::keys;
117 for (
const auto &[mask, color] : colors_) {
118 result.colors_.insert_or_assign(mask.flip(h, v), color);
132 [[nodiscard]]
const std::map<ShapeMask, PixelType> &
colors()
const
149 colors_.insert_or_assign(mask, color);
153 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.
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.
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.
virtual ~ShapeTile()=default
void set(const ShapeMask &mask, const PixelType &color)
Sets or updates the pixel value for a specific shape mask.