CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::Tile Struct Reference

Represents a tile in a multi-resolution grid with spatial coordinates and a resolution layer. More...

#include <Tile.h>

Collaboration diagram for carta::Tile:
[legend]

Static Public Member Functions

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.
 

Public Attributes

int32_t x
 
int32_t y
 
int32_t layer
 

Detailed Description

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.

Member Function Documentation

◆ Decode()

static Tile carta::Tile::Decode ( int32_t  encoded_value)
inlinestatic

Decodes a 32-bit integer into a Tile object.

Parameters
encoded_valueThe encoded 32-bit integer.
Returns
A Tile object with decoded x, y, and layer values.
Here is the caller graph for this function:

◆ 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
xThe X coordinate (must be greater than or equal to 0 and less than 2 to the power of the layer).
yThe Y coordinate (must be greater than or equal to 0 and less than 2 to the power of the layer).
layerThe 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
layerThe layer index to convert.
image_widthThe width of the full-resolution image.
image_heightThe height of the full-resolution image.
tile_widthThe width of a tile in pixels.
tile_heightThe height of a tile in pixels.
Returns
The mip size corresponding to the given layer.
Here is the caller graph for this function:

Member Data Documentation

◆ layer

int32_t carta::Tile::layer

The resolution layer of the tile.

◆ x

int32_t carta::Tile::x

The X coordinate of the tile.

◆ y

int32_t carta::Tile::y

The Y coordinate of the tile.


The documentation for this struct was generated from the following file: