SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Toggle main menu visibility
Loading...
Searching...
No Matches
TTX.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
VTF.h
"
4
5
namespace
vtfpp
{
6
7
constexpr
uint32_t
TTH_SIGNATURE
=
sourcepp::parser::binary::makeFourCC
(
"TTH\0"
);
8
9
class
TTX
{
10
public
:
11
explicit
TTX
(
VTF
&& vtf_);
12
13
explicit
TTX
(std::span<const std::byte> tthData, std::span<const std::byte> ttzData = {});
14
15
explicit
TTX
(
const
std::filesystem::path& tthPath,
const
std::filesystem::path& ttzPath = {});
16
17
[[nodiscard]]
explicit
operator
bool()
const
;
18
19
[[nodiscard]] uint8_t
getMajorVersion
()
const
;
20
21
[[nodiscard]] uint8_t
getMinorVersion
()
const
;
22
23
void
setVersion
(uint8_t newMajorVersion, uint8_t newMinorVersion);
24
25
void
setMajorVersion
(uint8_t newMajorVersion);
26
27
void
setMinorVersion
(uint8_t newMinorVersion);
28
29
[[nodiscard]] uint8_t
getAspectRatioType
()
const
;
30
31
void
setAspectRatioType
(uint8_t newAspectRatioType);
32
33
[[nodiscard]]
const
std::vector<uint64_t>&
getMipFlags
()
const
;
34
35
[[nodiscard]] std::vector<uint64_t>&
getMipFlags
();
36
37
[[nodiscard]]
const
VTF
&
getVTF
()
const
;
38
39
[[nodiscard]]
VTF
&
getVTF
();
40
41
[[nodiscard]] int16_t
getCompressionLevel
()
const
;
42
43
void
setCompressionLevel
(int16_t newCompressionLevel);
44
45
[[nodiscard]] std::pair<std::vector<std::byte>, std::vector<std::byte>>
bake
()
const
;
46
47
bool
bake
(
const
std::filesystem::path& tthPath,
const
std::filesystem::path& ttzPath)
const
;
// NOLINT(*-use-nodiscard)
48
49
protected
:
50
bool
opened
=
false
;
51
int16_t
compressionLevel
= -1;
52
53
VTF
vtf
;
54
55
uint8_t
majorVersion
= 1;
56
uint8_t
minorVersion
= 0;
57
uint8_t
aspectRatioType
{};
58
std::vector<uint64_t>
mipFlags
;
59
};
60
61
}
// namespace vtfpp
VTF.h
vtfpp::TTX::getVTF
const VTF & getVTF() const
Definition
TTX.cpp:105
vtfpp::TTX::getMipFlags
const std::vector< uint64_t > & getMipFlags() const
Definition
TTX.cpp:97
vtfpp::TTX::getMinorVersion
uint8_t getMinorVersion() const
Definition
TTX.cpp:72
vtfpp::TTX::mipFlags
std::vector< uint64_t > mipFlags
Definition
TTX.h:58
vtfpp::TTX::aspectRatioType
uint8_t aspectRatioType
Definition
TTX.h:57
vtfpp::TTX::vtf
VTF vtf
Definition
TTX.h:53
vtfpp::TTX::opened
bool opened
Definition
TTX.h:50
vtfpp::TTX::minorVersion
uint8_t minorVersion
Definition
TTX.h:56
vtfpp::TTX::getMajorVersion
uint8_t getMajorVersion() const
Definition
TTX.cpp:68
vtfpp::TTX::getAspectRatioType
uint8_t getAspectRatioType() const
Definition
TTX.cpp:89
vtfpp::TTX::setVersion
void setVersion(uint8_t newMajorVersion, uint8_t newMinorVersion)
Definition
TTX.cpp:76
vtfpp::TTX::setMinorVersion
void setMinorVersion(uint8_t newMinorVersion)
Definition
TTX.cpp:85
vtfpp::TTX::getCompressionLevel
int16_t getCompressionLevel() const
Definition
TTX.cpp:113
vtfpp::TTX::setAspectRatioType
void setAspectRatioType(uint8_t newAspectRatioType)
Definition
TTX.cpp:93
vtfpp::TTX::bake
std::pair< std::vector< std::byte >, std::vector< std::byte > > bake() const
Definition
TTX.cpp:121
vtfpp::TTX::setCompressionLevel
void setCompressionLevel(int16_t newCompressionLevel)
Definition
TTX.cpp:117
vtfpp::TTX::TTX
TTX(VTF &&vtf_)
Definition
TTX.cpp:10
vtfpp::TTX::compressionLevel
int16_t compressionLevel
Definition
TTX.h:51
vtfpp::TTX::setMajorVersion
void setMajorVersion(uint8_t newMajorVersion)
Definition
TTX.cpp:81
vtfpp::TTX::majorVersion
uint8_t majorVersion
Definition
TTX.h:55
vtfpp::VTF
Definition
VTF.h:113
sourcepp::parser::binary::makeFourCC
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
Definition
Binary.h:20
vtfpp
Definition
DistanceMapping.h:8
vtfpp::TTH_SIGNATURE
constexpr uint32_t TTH_SIGNATURE
Definition
TTX.h:7
include
vtfpp
TTX.h
Generated on
for SourcePP by
1.17.0