"""Add native raster/annotation sections to the pinned SDK POI fixture.""" from pathlib import Path import struct import subprocess import sys sdk, target = map(Path, sys.argv[1:3]) subprocess.run([sys.executable, str(Path(__file__).with_name("make_linux_search_fixture.py")), str(sdk), str(target), *sys.argv[3:]], check=True) sys.path[:0] = [str(sdk / "tools"), str(sdk / "tests")] from make_legacy_administration import page, seal from tmap_pack import crc32c source = target.read_bytes() sections = {} for index in range(struct.unpack_from("> bit) & 1) << (bit * 2) | ((y >> bit) & 1) << (bit * 2 + 1) for bit in range(29)) layers = bytearray() for layer, semantic, codec in [(1, 1, 1), (2, 2, 1), (3, 3, 2), (4, 104, 2), (5, 114, 2)]: locations = [(x, y) for x in range(131070, 131075) for y in range(131070, 131073)] if layer == 1 else [(131072, 131072)] locations.sort(key=lambda xy: tile_key(18, *xy)) table = page(3, len(locations), 32, 4096) pixels = bytearray() for row, (x, y) in enumerate(locations): if codec == 1: # Distinct solid native-endian-independent wire pixels. color = 0xF800 if layer == 1 else 0x07E0 payload = struct.pack("