Skip to main content

Module textures

Module textures 

Source
Expand description

NTF/DXT, GTT and TCT storage and native RGBA texture encoding.

Structs§

TerrainColors
Square terrain colour-map collection in X-major/Z-minor order.
Texture
Editable NTF storage, preserving the original encoded pixel payload.
TextureLevel
A primary, fallback or legacy compatibility mip level.

Constants§

DXT1
DXT1/BC1 fourCC in little-endian order.
DXT3
DXT3/BC2 fourCC in little-endian order.
DXT5
DXT5/BC3 fourCC in little-endian order.

Functions§

append_texture
Append a validated texture to a surrounding binary record.
create_texture
Create a new NTF, including the engine’s primary and fallback level chains.
decode_level
Decode a primary/fallback mip into top-row-first RGBA, rejecting opaque legacy pixels.
encode_level
Encode RGBA with a vetted native BC compressor or explicit linear packing.
mip_size
Compute a level’s encoded size with format and dimension validation.
parse_gtt
Parse sequential GTT records from their sizes rather than pixel signature scans.
parse_tct
Parse a square TCT terrain colour-map collection.
parse_texture
Parse a named DXT file and preserve its unexplained suffix.
read_texture
Read a self-delimiting texture embedded inside another record.
write_gtt
Write a collection of unambiguously framed NTF textures.
write_tct
Write a square TCT terrain colour-map collection.
write_texture
Serialize a new or edited DXT without recompressing original payloads.