Merge pull request #205 from protomaps/avif

python and C++ AVIF enums [#116]
This commit is contained in:
Brandon Liu
2023-06-23 11:39:39 +08:00
committed by GitHub
3 changed files with 4 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ const uint8_t TILETYPE_MVT = 0x1;
const uint8_t TILETYPE_PNG = 0x2; const uint8_t TILETYPE_PNG = 0x2;
const uint8_t TILETYPE_JPEG = 0x3; const uint8_t TILETYPE_JPEG = 0x3;
const uint8_t TILETYPE_WEBP = 0x4; const uint8_t TILETYPE_WEBP = 0x4;
const uint8_t TILETYPE_AVIF = 0x5;
const uint8_t COMPRESSION_UNKNOWN = 0x0; const uint8_t COMPRESSION_UNKNOWN = 0x0;
const uint8_t COMPRESSION_NONE = 0x1; const uint8_t COMPRESSION_NONE = 0x1;

View File

@@ -35,6 +35,8 @@ def mbtiles_to_header_json(mbtiles_metadata):
header["tile_type"] = TileType.JPEG header["tile_type"] = TileType.JPEG
elif tile_format == "webp": elif tile_format == "webp":
header["tile_type"] = TileType.WEBP header["tile_type"] = TileType.WEBP
elif tile_format == "avif":
header["tile_type"] = TileType.AVIF
else: else:
header["tile_type"] = TileType.UNKNOWN header["tile_type"] = TileType.UNKNOWN

View File

@@ -142,6 +142,7 @@ class TileType(Enum):
PNG = 2 PNG = 2
JPEG = 3 JPEG = 3
WEBP = 4 WEBP = 4
AVIF = 5
def deserialize_directory(buf): def deserialize_directory(buf):