From 3d1517a73addcb9719b0c8c09d55c438ca8a36e6 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Fri, 23 Jun 2023 11:07:18 +0800 Subject: [PATCH] python and C++ AVIF enums [#116] --- cpp/pmtiles.hpp | 1 + python/pmtiles/convert.py | 2 ++ python/pmtiles/tile.py | 1 + 3 files changed, 4 insertions(+) diff --git a/cpp/pmtiles.hpp b/cpp/pmtiles.hpp index f1685e1..0b6bd91 100644 --- a/cpp/pmtiles.hpp +++ b/cpp/pmtiles.hpp @@ -16,6 +16,7 @@ const uint8_t TILETYPE_MVT = 0x1; const uint8_t TILETYPE_PNG = 0x2; const uint8_t TILETYPE_JPEG = 0x3; const uint8_t TILETYPE_WEBP = 0x4; +const uint8_t TILETYPE_AVIF = 0x5; const uint8_t COMPRESSION_UNKNOWN = 0x0; const uint8_t COMPRESSION_NONE = 0x1; diff --git a/python/pmtiles/convert.py b/python/pmtiles/convert.py index bc7c82a..08b0827 100644 --- a/python/pmtiles/convert.py +++ b/python/pmtiles/convert.py @@ -35,6 +35,8 @@ def mbtiles_to_header_json(mbtiles_metadata): header["tile_type"] = TileType.JPEG elif tile_format == "webp": header["tile_type"] = TileType.WEBP + elif tile_format == "avif": + header["tile_type"] = TileType.AVIF else: header["tile_type"] = TileType.UNKNOWN diff --git a/python/pmtiles/tile.py b/python/pmtiles/tile.py index b50729a..980f041 100644 --- a/python/pmtiles/tile.py +++ b/python/pmtiles/tile.py @@ -142,6 +142,7 @@ class TileType(Enum): PNG = 2 JPEG = 3 WEBP = 4 + AVIF = 5 def deserialize_directory(buf):