73 void set(
int row,
int col);
85 void unset(
int row,
int col);
98 [[nodiscard]]
bool get(
int row,
int col)
const;
118 [[nodiscard]]
const std::array<uint8_t, 8> &
rows()
const
124 std::array<uint8_t, tile::side_length_pix> rows_{};
142 for (
const uint8_t
byte : tm.rows()) {
Represents which pixels in an 8x8 tile are non-transparent.
void unset(int row, int col)
Sets the bit at the specified row and column to 0.
const std::array< uint8_t, 8 > & rows() const
Returns the raw row data.
auto operator<=>(const ShapeMask &) const =default
ShapeMask flip(bool h, bool v) const
Returns a flipped version of this mask.
bool get(int row, int col) const
Gets the bit value at the specified row and column.
void set(int row, int col)
Sets the bit at the specified row and column to 1.
bool is_transparent() const
Checks if this entire ShapeMask is transparent.
ShapeMask(const std::array< uint8_t, tile::side_length_pix > &rows)
Constructs a ShapeMask from an array of row data.
size_t operator()(const porytiles2::ShapeMask &tm) const noexcept