Represents a tile in a multi-resolution grid with spatial coordinates and a resolution layer.
More...
#include <Tile.h>
|
| static int32_t | Encode (int32_t x, int32_t y, int32_t layer) |
| | Encodes tile coordinates and layer into a 32-bit integer.
|
| |
| static Tile | Decode (int32_t encoded_value) |
| | Decodes a 32-bit integer into a Tile object.
|
| |
| static int32_t | LayerToMip (int32_t layer, int32_t image_width, int32_t image_height, int32_t tile_width, int32_t tile_height) |
| | Converts a layer index to the corresponding mipmap size.
|
| |
Represents a tile in a multi-resolution grid with spatial coordinates and a resolution layer.
The Tile struct contains 2D spatial coordinates (x, y) and a resolution layer. It provides methods to encode/decode tile information into/from a 32-bit integer, and convert between resolution layers and mipmap levels.
◆ Decode()
| static Tile carta::Tile::Decode |
( |
int32_t |
encoded_value | ) |
|
|
inlinestatic |
Decodes a 32-bit integer into a Tile object.
- Parameters
-
| encoded_value | The encoded 32-bit integer. |
- Returns
- A Tile object with decoded x, y, and layer values.
◆ Encode()
| static int32_t carta::Tile::Encode |
( |
int32_t |
x, |
|
|
int32_t |
y, |
|
|
int32_t |
layer |
|
) |
| |
|
inlinestatic |
Encodes tile coordinates and layer into a 32-bit integer.
- Parameters
-
| x | The X coordinate (must be greater than or equal to 0 and less than 2 to the power of the layer). |
| y | The Y coordinate (must be greater than or equal to 0 and less than 2 to the power of the layer). |
| layer | The layer index (must be between 0 and 12). |
- Returns
- Encoded 32-bit integer value, or -1 if input is invalid.
◆ LayerToMip()
| static int32_t carta::Tile::LayerToMip |
( |
int32_t |
layer, |
|
|
int32_t |
image_width, |
|
|
int32_t |
image_height, |
|
|
int32_t |
tile_width, |
|
|
int32_t |
tile_height |
|
) |
| |
|
inlinestatic |
Converts a layer index to the corresponding mipmap size.
- Parameters
-
| layer | The layer index to convert. |
| image_width | The width of the full-resolution image. |
| image_height | The height of the full-resolution image. |
| tile_width | The width of a tile in pixels. |
| tile_height | The height of a tile in pixels. |
- Returns
- The mip size corresponding to the given layer.
◆ layer
| int32_t carta::Tile::layer |
The resolution layer of the tile.
The X coordinate of the tile.
The Y coordinate of the tile.
The documentation for this struct was generated from the following file: