Skip to main content

Module txi

Module txi 

Source
Expand description

TXI ASCII texture-info support. TXI ASCII reader and writer.

TXI (texture info) resources are line-based text sidecars for texture resources. Each directive is a command followed by optional arguments.

§Shape of the file

One directive per line, a command token followed by its arguments. No header, no terminator, no required order. The only structure beyond a flat list is upperleftcoords and lowerrightcoords, which declare a count and are followed by that many coordinate triples.

Empty lines are ignored and command matching is case-insensitive. Two write modes exist because both are legitimate: policy-normalised regularises command spelling, source-preserving keeps whatever the input used so someone else’s file round-trips without being editorialised.

Text is decoded and encoded as Windows-1252. The grammar and the engine’s parse behaviour, including how unrecognised directives and malformed boolean arguments fail silently, are in docs/src/formats/textures/txi.md.

Structs§

Txi
In-memory TXI container.
TxiCoordinate
One TXI UV coordinate entry.
TxiCoordinateBlock
One TXI coordinate block command.
TxiDirective
One TXI command with optional argument payload.
TxiReadOptions
Reader options for TXI parsing.
TxiWriteOptions
Writer options for TXI serialization.

Enums§

TxiEntry
One ordered TXI entry.
TxiError
Errors produced while parsing or serializing TXI text data.

Functions§

read_txi
Reads TXI data from a reader.
read_txi_from_bytes
Reads TXI data from bytes.
read_txi_from_bytes_with_options
Reads TXI data from bytes with explicit parse options.
read_txi_with_options
Reads TXI data from a reader with explicit parse options.
write_txi
Writes TXI data to a writer.
write_txi_to_vec
Serializes TXI data to bytes.
write_txi_to_vec_with_options
Serializes TXI data to bytes with explicit serialization options.
write_txi_with_options
Writes TXI data to a writer with explicit serialization options.