Interface ITileCodec
- Namespace
- LansMap.Core.TileCodecs
Disk-format reader for one cache blob format: recognizes its tag and, for GPU-ready payloads, extracts the mip levels an upload needs.
public interface ITileCodec
Remarks
This is a disk format, not a GPU upload. Uploading the extracted bytes to a texture array layer stays in the runtime tile streamer. Wire formats (PNG/JPEG) set RequiresDecode and never use TryBuildMips(byte[], int, int, int, int, byte[][]).
Properties
Format
The TileCacheBlob.Format tag this codec recognizes.
TileCacheBlob.Format Format { get; }
Property Value
RequiresDecode
True when the payload is still compressed (PNG/JPEG) and needs an image decode; false when it is already GPU-ready blocks.
bool RequiresDecode { get; }
Property Value
Methods
TryBuildMips(byte[], int, int, int, int, byte[][])
Extracts requiredLevels mip levels from a
GPU-ready disk payload into caller-owned buffers.
bool TryBuildMips(byte[] payload, int offset, int length, int tileSizePx, int requiredLevels, byte[][] mips)
Parameters
payloadbyte[]Disk payload bytes, not copied.
offsetintStart of this tile's payload in
payload, in bytes.lengthintReadable byte count from
offset.tileSizePxintExpected base-level edge length in texels.
requiredLevelsintMip levels to copy, 1 or more.
mipsbyte[][]Caller-owned buffers, one per level; each entry must already hold that level's block-byte count.
Returns
- bool
True when the payload parsed and the levels were copied; false (never throws) on a corrupt or foreign-written entry.
Remarks
Only meaningful when RequiresDecode is false. The
buffers in mips are reused across calls: size
them before calling, do not allocate here.