SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
VTF.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5#include <span>
6#include <string>
7#include <tuple>
8#include <utility>
9#include <variant>
10#include <vector>
11
13#include <sourcepp/Macros.h>
14
15#include "HOT.h"
16#include "ImageConversion.h"
17#include "SHT.h"
18
19namespace vtfpp {
20
24
25enum class CompressionMethod : int16_t {
26 // Strata Source v7.6 defines
27 DEFLATE = 8,
28 ZSTD = 93,
29
30 // Signify the image resource should be compressed with LZMA on console
31 CONSOLE_LZMA = 0x360,
32};
33
34struct Resource {
35 enum Type : uint32_t {
36 TYPE_UNKNOWN = 0, // Unknown
46 };
47 static consteval std::array<Type, 9> getOrder() {
48 return {
58 };
59 }
60
61 enum Flags : uint8_t {
64 };
65
68 std::span<std::byte> data;
69
70 using ConvertedData = std::variant<
71 std::monostate, // Anything that would be equivalent to just returning data directly, or used as an error
72 SHT, // Particle Sheet
73 uint32_t, // CRC, TS0
74 std::tuple<uint8_t, uint8_t, uint8_t, uint8_t>, // LOD
75 std::string, // KVD
76 HOT, // Hotspot data
77 std::span<uint32_t> // AXC
78 >;
79 [[nodiscard]] ConvertedData convertData() const;
80
81 [[nodiscard]] SHT getDataAsParticleSheet() const {
82 return std::get<SHT>(this->convertData());
83 }
84
85 [[nodiscard]] uint32_t getDataAsCRC() const {
86 return std::get<uint32_t>(this->convertData());
87 }
88
89 [[nodiscard]] uint32_t getDataAsExtendedFlags() const {
90 return std::get<uint32_t>(this->convertData());
91 }
92
93 [[nodiscard]] std::tuple<uint8_t, uint8_t, uint8_t, uint8_t> getDataAsLODControlInfo() const {
94 return std::get<std::tuple<uint8_t, uint8_t, uint8_t, uint8_t>>(this->convertData());
95 }
96
97 [[nodiscard]] std::string getDataAsKeyValuesData() const {
98 return std::get<std::string>(this->convertData());
99 }
100
101 [[nodiscard]] HOT getDataAsHotspotData() const {
102 return std::get<HOT>(this->convertData());
103 }
104
105 [[nodiscard]] int16_t getDataAsAuxCompressionLevel() const {
106 return static_cast<int16_t>(std::get<std::span<uint32_t>>(this->convertData())[1] & 0xffff);
107 }
108
110 auto method = static_cast<int16_t>((std::get<std::span<uint32_t>>(this->convertData())[1] & 0xffff0000) >> 16);
111 if (method <= 0) {
113 }
114 return static_cast<CompressionMethod>(method);
115 }
116
117 [[nodiscard]] uint32_t getDataAsAuxCompressionLength(uint8_t mip, uint8_t mipCount, uint16_t frame, uint16_t frameCount, uint16_t face, uint16_t faceCount) const {
118 return std::get<std::span<uint32_t>>(this->convertData())[((mipCount - 1 - mip) * frameCount * faceCount + frame * faceCount + face) + 2];
119 }
120};
122
123/*
124 * === EASY DIFFICULTY WRITER API ===
125 *
126 * Use a static helper function to create a VTF in one function call - VTF::create
127 *
128 * === MEDIUM DIFFICULTY WRITER API ===
129 *
130 * Constructing a VTF instance from existing VTF data will let you modify that data.
131 *
132 * When constructing a VTF instance from scratch, this class has methods that should be
133 * called in a particular order. If they aren't your output VTF will look incorrect or
134 * have heavy artifacting. Some of these steps are optional, but the steps actually taken
135 * should be done in this order. Reference VTF::create and VTF::createInternal to see the
136 * intended "order of operations".
137 */
138class VTF {
139public:
140 enum FlagsV0 : uint32_t {
141 FLAG_POINT_SAMPLE = 1 << 0,
142 FLAG_TRILINEAR = 1 << 1,
143 FLAG_CLAMP_S = 1 << 2,
144 FLAG_CLAMP_T = 1 << 3,
145 FLAG_ANISOTROPIC = 1 << 4,
146 FLAG_HINT_DXT5 = 1 << 5,
147 FLAG_NORMAL = 1 << 7,
148 FLAG_NO_MIP = 1 << 8, // Controlled by mip count
149 FLAG_NO_LOD = 1 << 9,
150 FLAG_MIN_MIP = 1 << 10,
151 FLAG_PROCEDURAL = 1 << 11,
152 FLAG_ONE_BIT_ALPHA = 1 << 12,
153 FLAG_MULTI_BIT_ALPHA = 1 << 13,
154 FLAG_ENVMAP = 1 << 14, // Controlled by face count
155 FLAG_RENDERTARGET = 1 << 15,
156 FLAG_DEPTH_RENDERTARGET = 1 << 16,
157 FLAG_NO_DEBUG_OVERRIDE = 1 << 17,
158 FLAG_SINGLE_COPY = 1 << 18,
159 };
160 static constexpr uint32_t FLAGS_MASK_V0 = FLAG_POINT_SAMPLE | FLAG_TRILINEAR | FLAG_CLAMP_S | FLAG_CLAMP_T | FLAG_ANISOTROPIC | FLAG_HINT_DXT5 | FLAG_NORMAL | FLAG_NO_MIP | FLAG_NO_LOD | FLAG_MIN_MIP | FLAG_PROCEDURAL | FLAG_ONE_BIT_ALPHA | FLAG_MULTI_BIT_ALPHA | FLAG_ENVMAP | FLAG_RENDERTARGET | FLAG_DEPTH_RENDERTARGET | FLAG_NO_DEBUG_OVERRIDE | FLAG_SINGLE_COPY;
161
162 enum FlagsV2 : uint32_t {
163 FLAG_V2_NO_DEPTH_BUFFER = 1 << 23,
164 FLAG_V2_CLAMP_U = 1 << 25,
165 };
166 static constexpr uint32_t FLAGS_MASK_V2 = FLAG_V2_NO_DEPTH_BUFFER | FLAG_V2_CLAMP_U;
167
168 enum FlagsV3 : uint32_t {
169 FLAG_V3_LOAD_ALL_MIPS = 1 << 10,
170 FLAG_V3_VERTEX_TEXTURE = 1 << 26,
171 FLAG_V3_SSBUMP = 1 << 27,
172 FLAG_V3_BORDER = 1 << 29,
173 };
174 static constexpr uint32_t FLAGS_MASK_V3 = FLAG_V3_LOAD_ALL_MIPS | FLAG_V3_VERTEX_TEXTURE | FLAG_V3_SSBUMP | FLAG_V3_BORDER;
175
176 enum FlagsV4 : uint32_t {
177 FLAG_V4_SRGB = 1 << 6,
178 };
179 static constexpr uint32_t FLAGS_MASK_V4 = FLAG_V4_SRGB;
180
181 enum FlagsV4_TF2 : uint32_t {
182 FLAG_V4_TF2_STAGING_MEMORY = 1 << 19,
183 FLAG_V4_TF2_IMMEDIATE_CLEANUP = 1 << 20,
184 FLAG_V4_TF2_IGNORE_PICMIP = 1 << 21,
185 FLAG_V4_TF2_STREAMABLE_COARSE = 1 << 30,
186 FLAG_V4_TF2_STREAMABLE_FINE = static_cast<uint32_t>(1 << 31),
187 };
188 static constexpr uint32_t FLAGS_MASK_V4_TF2 = FLAG_V4_TF2_STAGING_MEMORY | FLAG_V4_TF2_IMMEDIATE_CLEANUP | FLAG_V4_TF2_IGNORE_PICMIP | FLAG_V4_TF2_STREAMABLE_COARSE | FLAG_V4_TF2_STREAMABLE_FINE;
189
190 enum FlagsV5 : uint32_t {
191 FLAG_V5_PWL_CORRECTED = 1 << 6,
192 FLAG_V5_SRGB = 1 << 19,
193 FLAG_V5_DEFAULT_POOL = 1 << 20,
194 FLAG_V5_LOAD_MOST_MIPS = 1 << 28,
195 };
196 static constexpr uint32_t FLAGS_MASK_V5 = FLAG_V5_PWL_CORRECTED | FLAG_V5_SRGB | FLAG_V5_DEFAULT_POOL | FLAG_V5_LOAD_MOST_MIPS;
197
198 enum FlagsV5_CSGO : uint32_t {
199 FLAG_V5_CSGO_COMBINED = 1 << 21,
200 FLAG_V5_CSGO_ASYNC_DOWNLOAD = 1 << 22,
201 FLAG_V5_CSGO_SKIP_INITIAL_DOWNLOAD = 1 << 24,
202 FLAG_V5_CSGO_YCOCG = 1 << 30,
203 FLAG_V5_CSGO_ASYNC_SKIP_INITIAL_LOW_RES = static_cast<uint32_t>(1 << 31),
204 };
205 static constexpr uint32_t FLAGS_MASK_V5_CSGO = FLAG_V5_CSGO_COMBINED | FLAG_V5_CSGO_ASYNC_DOWNLOAD | FLAG_V5_CSGO_SKIP_INITIAL_DOWNLOAD | FLAG_V5_CSGO_YCOCG | FLAG_V5_CSGO_ASYNC_SKIP_INITIAL_LOW_RES;
206
207 static constexpr uint32_t FLAGS_MASK_INTERNAL = FLAG_NO_MIP | FLAG_ENVMAP;
208
209 enum Platform : uint32_t {
210 PLATFORM_UNKNOWN = 0x000,
211 PLATFORM_PC = 0x007,
212 PLATFORM_X360 = 0x360,
213 PLATFORM_PS3_ORANGEBOX = 0x333,
214 PLATFORM_PS3_PORTAL2 = 0x334,
215 };
216
218 uint32_t version = 4;
219 ImageFormat outputFormat = FORMAT_DEFAULT;
220 float compressedFormatQuality = ImageConversion::DEFAULT_COMPRESSED_QUALITY;
221 ImageConversion::ResizeMethod widthResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
222 ImageConversion::ResizeMethod heightResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
223 ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT;
224 uint32_t flags = 0;
225 uint16_t initialFrameCount = 1;
226 uint16_t startFrame = 0;
227 bool isCubeMap = false;
228 uint16_t initialSliceCount = 1;
229 bool computeTransparencyFlags = true;
230 bool computeMips = true;
231 bool computeThumbnail = true;
232 bool computeReflectivity = true;
233 Platform platform = PLATFORM_PC;
234 int16_t compressionLevel = -1;
235 CompressionMethod compressionMethod = CompressionMethod::ZSTD;
236 float bumpMapScale = 1.f;
237 float gammaCorrection = 1.f;
238 bool invertGreenChannel = false;
239 };
240
242 static constexpr auto FORMAT_UNCHANGED = static_cast<ImageFormat>(-2);
243
245 static constexpr auto FORMAT_DEFAULT = static_cast<ImageFormat>(-1);
246
247 VTF();
248
249 explicit VTF(std::vector<std::byte>&& vtfData, bool parseHeaderOnly = false);
250
251 explicit VTF(std::span<const std::byte> vtfData, bool parseHeaderOnly = false);
252
253 explicit VTF(const std::string& vtfPath, bool parseHeaderOnly = false);
254
255 VTF(const VTF& other);
256
257 VTF& operator=(const VTF& other);
258
259 VTF(VTF&&) noexcept = default;
260
261 VTF& operator=(VTF&&) noexcept = default;
262
263 [[nodiscard]] explicit operator bool() const;
264
265 static bool create(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t height, const std::string& vtfPath, const CreationOptions& options);
266
267 static bool create(ImageFormat format, uint16_t width, uint16_t height, const std::string& vtfPath, const CreationOptions& options);
268
269 [[nodiscard]] static VTF create(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t height, const CreationOptions& options);
270
271 [[nodiscard]] static VTF create(ImageFormat format, uint16_t width, uint16_t height, const CreationOptions& options);
272
273 static bool create(const std::string& imagePath, const std::string& vtfPath, const CreationOptions& options);
274
275 [[nodiscard]] static VTF create(const std::string& imagePath, const CreationOptions& options);
276
277 [[nodiscard]] Platform getPlatform() const;
278
279 void setPlatform(Platform newPlatform);
280
281 [[nodiscard]] uint32_t getVersion() const;
282
283 void setVersion(uint32_t newVersion);
284
285 [[nodiscard]] ImageConversion::ResizeMethod getImageWidthResizeMethod() const;
286
287 [[nodiscard]] ImageConversion::ResizeMethod getImageHeightResizeMethod() const;
288
289 void setImageResizeMethods(ImageConversion::ResizeMethod imageWidthResizeMethod_, ImageConversion::ResizeMethod imageHeightResizeMethod_);
290
291 void setImageWidthResizeMethod(ImageConversion::ResizeMethod imageWidthResizeMethod_);
292
293 void setImageHeightResizeMethod(ImageConversion::ResizeMethod imageHeightResizeMethod_);
294
295 [[nodiscard]] uint16_t getWidth(uint8_t mip = 0) const;
296
297 [[nodiscard]] uint16_t getHeight(uint8_t mip = 0) const;
298
299 void setSize(uint16_t newWidth, uint16_t newHeight, ImageConversion::ResizeFilter filter);
300
301 [[nodiscard]] uint32_t getFlags() const;
302
303 void setFlags(uint32_t flags_);
304
305 void addFlags(uint32_t flags_);
306
307 void removeFlags(uint32_t flags_);
308
309 [[nodiscard]] bool isSRGB() const;
310
311 void setSRGB(bool srgb);
312
313 void computeTransparencyFlags();
314
315 [[nodiscard]] static ImageFormat getDefaultCompressedFormat(ImageFormat inputFormat, uint32_t version, bool isCubeMap);
316
317 [[nodiscard]] ImageFormat getFormat() const;
318
319 void setFormat(ImageFormat newFormat, ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
320
321 [[nodiscard]] uint8_t getMipCount() const;
322
323 bool setMipCount(uint8_t newMipCount);
324
325 bool setRecommendedMipCount();
326
327 void computeMips(ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT);
328
329 [[nodiscard]] uint16_t getFrameCount() const;
330
331 bool setFrameCount(uint16_t newFrameCount);
332
333 [[nodiscard]] uint8_t getFaceCount() const;
334
335 bool setFaceCount(bool isCubeMap);
336
337 [[nodiscard]] uint16_t getSliceCount() const;
338
339 bool setSliceCount(uint16_t newSliceCount);
340
341 bool setFrameFaceAndSliceCount(uint16_t newFrameCount, bool isCubeMap, uint16_t newSliceCount = 1);
342
343 [[nodiscard]] uint16_t getStartFrame() const;
344
345 void setStartFrame(uint16_t newStartFrame);
346
347 [[nodiscard]] sourcepp::math::Vec3f getReflectivity() const;
348
349 void setReflectivity(sourcepp::math::Vec3f newReflectivity);
350
351 void computeReflectivity();
352
353 [[nodiscard]] float getBumpMapScale() const;
354
355 void setBumpMapScale(float newBumpMapScale);
356
357 [[nodiscard]] ImageFormat getThumbnailFormat() const;
358
359 [[nodiscard]] uint8_t getThumbnailWidth() const;
360
361 [[nodiscard]] uint8_t getThumbnailHeight() const;
362
363 [[nodiscard]] const std::vector<Resource>& getResources() const;
364
365 [[nodiscard]] const Resource* getResource(Resource::Type type) const;
366
368 [[nodiscard]] std::vector<std::byte> getParticleSheetFrameDataRaw(uint16_t& spriteWidth, uint16_t& spriteHeight, uint32_t shtSequenceID, uint32_t shtFrame, uint8_t shtBounds = 0, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
369
371 [[nodiscard]] std::vector<std::byte> getParticleSheetFrameDataAs(ImageFormat newFormat, uint16_t& spriteWidth, uint16_t& spriteHeight, uint32_t shtSequenceID, uint32_t shtFrame, uint8_t shtBounds = 0, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
372
374 [[nodiscard]] std::vector<std::byte> getParticleSheetFrameDataAsRGBA8888(uint16_t& spriteWidth, uint16_t& spriteHeight, uint32_t shtSequenceID, uint32_t shtFrame, uint8_t shtBounds = 0, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
375
376 void setParticleSheetResource(const SHT& value);
377
378 void removeParticleSheetResource();
379
380 void setCRCResource(uint32_t value);
381
382 void removeCRCResource();
383
384 void setLODResource(uint8_t u, uint8_t v, uint8_t u360 = 0, uint8_t v360 = 0);
385
386 void removeLODResource();
387
388 void setExtendedFlagsResource(uint32_t value);
389
390 void removeExtendedFlagsResource();
391
392 void setKeyValuesDataResource(const std::string& value);
393
394 void removeKeyValuesDataResource();
395
396 void setHotspotDataResource(const HOT& value);
397
398 void removeHotspotDataResource();
399
400 [[nodiscard]] int16_t getCompressionLevel() const;
401
402 void setCompressionLevel(int16_t newCompressionLevel);
403
404 [[nodiscard]] CompressionMethod getCompressionMethod() const;
405
406 void setCompressionMethod(CompressionMethod newCompressionMethod);
407
408 [[nodiscard]] bool hasImageData() const;
409
410 [[nodiscard]] std::span<const std::byte> getImageDataRaw(uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
411
412 [[nodiscard]] std::vector<std::byte> getImageDataAs(ImageFormat newFormat, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
413
414 [[nodiscard]] std::vector<std::byte> getImageDataAsRGBA8888(uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
415
416 bool setImage(std::span<const std::byte> imageData_, ImageFormat format_, uint16_t width_, uint16_t height_, ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
417
418 bool setImage(const std::string& imagePath, ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
419
420 [[nodiscard]] std::vector<std::byte> saveImageToFile(uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0, ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const;
421
422 bool saveImageToFile(const std::string& imagePath, uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0, ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const; // NOLINT(*-use-nodiscard)
423
424 [[nodiscard]] bool hasThumbnailData() const;
425
426 [[nodiscard]] std::span<const std::byte> getThumbnailDataRaw() const;
427
428 [[nodiscard]] std::vector<std::byte> getThumbnailDataAs(ImageFormat newFormat) const;
429
430 [[nodiscard]] std::vector<std::byte> getThumbnailDataAsRGBA8888() const;
431
432 void setThumbnail(std::span<const std::byte> imageData_, ImageFormat format_, uint16_t width_, uint16_t height_, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
433
434 void computeThumbnail(ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
435
436 void removeThumbnail();
437
438 [[nodiscard]] std::vector<std::byte> saveThumbnailToFile(ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const;
439
440 bool saveThumbnailToFile(const std::string& imagePath, ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const; // NOLINT(*-use-nodiscard)
441
442 [[nodiscard]] std::vector<std::byte> bake() const;
443
444 bool bake(const std::string& vtfPath) const; // NOLINT(*-use-nodiscard)
445
446protected:
447 static bool createInternal(VTF& writer, CreationOptions options);
448
449 [[nodiscard]] Resource* getResourceInternal(Resource::Type type);
450
451 void setResourceInternal(Resource::Type type, std::span<const std::byte> data_);
452
453 void removeResourceInternal(Resource::Type type);
454
455 void regenerateImageData(ImageFormat newFormat, uint16_t newWidth, uint16_t newHeight, uint8_t newMipCount, uint16_t newFrameCount, uint8_t newFaceCount, uint16_t newSliceCount, ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT, float quality = ImageConversion::DEFAULT_COMPRESSED_QUALITY);
456
457 bool opened = false;
458
459 std::vector<std::byte> data;
460
461 //uint32_t signature;
462 uint32_t version{};
463 //uint32_t headerSize;
464
465 uint16_t width{};
466 uint16_t height{};
467 uint32_t flags{};
468
469 uint16_t frameCount = 1;
470 uint16_t startFrame{};
471
472 //uint8_t _padding0[4];
473 sourcepp::math::Vec3f reflectivity{};
474 //uint8_t _padding1[4];
475
476 float bumpMapScale{};
478 uint8_t mipCount = 1;
479
481 uint8_t thumbnailWidth{};
482 uint8_t thumbnailHeight{};
483
484 // 1 for v7.1 and lower
485 uint16_t sliceCount = 1;
486 //uint8_t _padding2[3];
487
488 // Technically added in v7.3, but we use it to store image and thumbnail data in v7.2 and lower anyway
489 //uint32_t resourceCount;
490 std::vector<Resource> resources;
491 //uint8_t _padding3[4];
492
493 // These aren't in the header
494 Platform platform = PLATFORM_PC;
495 int16_t compressionLevel = 0;
499};
507
508} // namespace vtfpp
#define SOURCEPP_BITFLAGS_ENUM(Enum)
Defines bitwise operators for an enum or enum class.
Definition: Macros.h:26
Definition: HOT.h:13
Definition: SHT.h:13
Platform
Definition: VTF.h:209
FlagsV2
Definition: VTF.h:162
FlagsV0
Definition: VTF.h:140
VTF(VTF &&) noexcept=default
FlagsV4_TF2
Definition: VTF.h:181
FlagsV4
Definition: VTF.h:176
FlagsV5
Definition: VTF.h:190
FlagsV5_CSGO
Definition: VTF.h:198
FlagsV3
Definition: VTF.h:168
std::vector< Resource > resources
Definition: VTF.h:490
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
Definition: Binary.h:18
Definition: LZMA.h:11
Definition: HOT.h:11
constexpr uint32_t VTF_SIGNATURE
Definition: VTF.h:21
constexpr uint32_t VTFX_SIGNATURE
Definition: VTF.h:22
constexpr uint32_t VTF3_SIGNATURE
Definition: VTF.h:23
CompressionMethod
Definition: VTF.h:25
ImageFormat
Definition: ImageFormats.h:7
SHT getDataAsParticleSheet() const
Definition: VTF.h:81
static consteval std::array< Type, 9 > getOrder()
Definition: VTF.h:47
CompressionMethod getDataAsAuxCompressionMethod() const
Definition: VTF.h:109
uint32_t getDataAsAuxCompressionLength(uint8_t mip, uint8_t mipCount, uint16_t frame, uint16_t frameCount, uint16_t face, uint16_t faceCount) const
Definition: VTF.h:117
Type type
Definition: VTF.h:66
ConvertedData convertData() const
Definition: VTF.cpp:177
std::tuple< uint8_t, uint8_t, uint8_t, uint8_t > getDataAsLODControlInfo() const
Definition: VTF.h:93
std::string getDataAsKeyValuesData() const
Definition: VTF.h:97
uint32_t getDataAsCRC() const
Definition: VTF.h:85
std::variant< std::monostate, SHT, uint32_t, std::tuple< uint8_t, uint8_t, uint8_t, uint8_t >, std::string, HOT, std::span< uint32_t > > ConvertedData
Definition: VTF.h:78
uint32_t getDataAsExtendedFlags() const
Definition: VTF.h:89
@ FLAG_LOCAL_DATA
Definition: VTF.h:63
@ FLAG_NONE
Definition: VTF.h:62
int16_t getDataAsAuxCompressionLevel() const
Definition: VTF.h:105
HOT getDataAsHotspotData() const
Definition: VTF.h:101
@ TYPE_KEYVALUES_DATA
Definition: VTF.h:45
@ TYPE_CRC
Definition: VTF.h:42
@ TYPE_PARTICLE_SHEET_DATA
Definition: VTF.h:38
@ TYPE_EXTENDED_FLAGS
Definition: VTF.h:41
@ TYPE_UNKNOWN
Definition: VTF.h:36
@ TYPE_IMAGE_DATA
Definition: VTF.h:40
@ TYPE_AUX_COMPRESSION
Definition: VTF.h:43
@ TYPE_LOD_CONTROL_INFO
Definition: VTF.h:44
@ TYPE_THUMBNAIL_DATA
Definition: VTF.h:37
@ TYPE_HOTSPOT_DATA
Definition: VTF.h:39
Flags flags
Definition: VTF.h:67
std::span< std::byte > data
Definition: VTF.h:68