Expand description
LTR binary letter-table support. LTR binary reader and writer.
LTR resources store third-order Markov probability tables used by KotOR name generation.
§Format Layout
+------------------------------+ 0x0000
| Header (9 bytes) |
+------------------------------+ 0x0009
| Singles block |
| 3 * 28 * f32 |
+------------------------------+
| Doubles blocks |
| 28 * (3 * 28 * f32) |
+------------------------------+
| Triples blocks |
| 28 * 28 * (3 * 28 * f32) |
+------------------------------+§Header (9 bytes)
0x00..0x04 magic "LTR "
0x04..0x08 version "V1.0"
0x08..0x09 letter_count (u8, KotOR expects 28)Structs§
- Ltr
- In-memory LTR container.
- LtrProbability
Block - One LTR probability block.
Enums§
- LtrBinary
Error - Errors produced while parsing or serializing LTR binary data.
Constants§
- LTR_
CHARACTER_ COUNT - Number of letters in KotOR LTR tables (
a-z,',-).
Functions§
- read_
ltr - Reads an LTR file from a reader.
- read_
ltr_ from_ bytes - Reads an LTR file directly from bytes.
- write_
ltr - Writes an LTR file to a writer.
- write_
ltr_ to_ vec - Serializes an LTR file into a byte vector.