1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2026 Fernando Sahmkow
/**
* @file tex.h
* @brief Main header for the TEX (Diablo III / IV SNO texture) library
*
* This is the primary include file for the TEX library. Include this single
* header to access all TEX functionality including parsing, writing, and type
* definitions.
*
* The TEX format is used by both Diablo III and Diablo IV. D3 TEX files
* are monolithic (metadata + pixel data in one file). D4 TEX files separate
* the SNO metadata from the pixel payload, so parsing requires two inputs.
*
* @example Basic Usage
* @code
* #include <whiteout/textures/tex/tex.h>
*
* // Parse a D3 TEX file
* tex::Parser parser;
* tex::TexInfo info;
* auto texture = parser.parse(file_bytes, &info);
*
* // Parse a D4 TEX file (metadata + payload)
* tex::D4TexInfo d4info;
* auto d4texture = parser.parse(tex_bytes, payload_bytes, &d4info);
*
* // Re-encode as D3 TEX
* tex::Writer writer;
* auto output = writer.write(*texture, {
* .snoId = info.snoId,
* .flags = info.flags,
* });
* @endcode
*/
namespace whiteout::textures::tex // namespace whiteout::textures::tex
namespace whiteout