|
Porytiles
|
Functions | |
| constexpr std::pair< std::size_t, std::size_t > | index_to_row_col (std::size_t index) |
| Converts a linear index to row and column coordinates. | |
| constexpr std::size_t | row_col_to_index (std::size_t row, std::size_t col) |
| Converts row and column coordinates to a linear index. | |
Variables | |
| constexpr std::size_t | side_length_pix = 8 |
| constexpr std::size_t | size_pix = side_length_pix * side_length_pix |
|
constexpr |
Converts a linear index to row and column coordinates.
Takes a linear index in the range [0, size_pix) and returns the corresponding row and column coordinates in an 8x8 tile grid. The row is the first element of the returned pair, and the column is the second element.
| index | The linear index to convert |
Definition at line 27 of file pixel_tile.hpp.
|
constexpr |
Converts row and column coordinates to a linear index.
Takes row and column coordinates in an 8x8 tile grid and returns the corresponding linear index in the range [0, size_pix).
| row | The row coordinate |
| col | The column coordinate |
Definition at line 43 of file pixel_tile.hpp.
|
inlineconstexpr |
Definition at line 14 of file pixel_tile.hpp.
|
inlineconstexpr |
Definition at line 15 of file pixel_tile.hpp.