VTFParser
Simple and modern library for parsing the Valve Texture Format
Loading...
Searching...
No Matches
src
file-format-objects
header.hpp
1
#pragma once
2
3
#include "enums.hpp"
4
#include <array>
5
#include <cstddef>
6
#include <cstdint>
7
8
namespace
VtfParser
{
9
#pragma pack(push, 1)
10
14
struct
HeaderBase
{
18
std::array<uint8_t, 4>
signature
;
22
std::array<uint32_t, 2>
version
;
26
uint32_t
headerSize
;
27
};
28
32
struct
__attribute__((aligned(16))) HeaderFullAligned :
public
HeaderBase
{
36
uint16_t width;
40
uint16_t height;
44
TextureFlags
flags;
48
uint16_t frames;
52
uint16_t firstFrame;
56
std::array<uint8_t, 4> padding0;
60
std::array<float, 3> reflectivity;
64
std::array<uint8_t, 4> padding1;
68
float
bumpmapScale;
72
ImageFormat
highResImageFormat;
76
uint8_t mipmapCount;
80
ImageFormat
lowResImageFormat;
84
uint8_t lowResImageWidth;
88
uint8_t lowResImageHeight;
92
uint16_t depth;
96
std::array<uint8_t, 3> padding2;
100
uint32_t numResources;
101
};
102
106
struct
ResourceEntryInfo
{
110
std::array<uint8_t, 3>
tag
;
115
uint8_t
flags
;
119
uint32_t
data
;
120
};
121
125
struct
Header
:
public
HeaderFullAligned {
126
static
constexpr
size_t
MAX_RESOURCES = 32;
127
128
std::array<uint8_t, 8> padding3;
129
std::array<ResourceEntryInfo, MAX_RESOURCES> resourceInfos;
130
};
131
132
#pragma pack(pop)
133
}
VtfParser
Definition:
VTFParser.hpp:6
VtfParser::TextureFlags
TextureFlags
Definition:
enums.hpp:44
VtfParser::ImageFormat
ImageFormat
Definition:
enums.hpp:10
VtfParser::HeaderBase
Definition:
header.hpp:14
VtfParser::HeaderBase::signature
std::array< uint8_t, 4 > signature
Definition:
header.hpp:18
VtfParser::HeaderBase::version
std::array< uint32_t, 2 > version
Definition:
header.hpp:22
VtfParser::HeaderBase::headerSize
uint32_t headerSize
Definition:
header.hpp:26
VtfParser::Header
Definition:
header.hpp:125
VtfParser::ResourceEntryInfo
Definition:
header.hpp:106
VtfParser::ResourceEntryInfo::flags
uint8_t flags
Definition:
header.hpp:115
VtfParser::ResourceEntryInfo::data
uint32_t data
Definition:
header.hpp:119
VtfParser::ResourceEntryInfo::tag
std::array< uint8_t, 3 > tag
Definition:
header.hpp:110
Generated by
1.9.5