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 * This class has methods that should be called in a particular order
133 * when creating a VTF from scratch, or your output VTF may look incorrect:
134 *
135 * 0. Construct an empty VTF instance
136 * 1. Set the version (7.4 is the default) - VTF::setVersion
137 * 2. Set FLAG_SRGB (optional, read for image resizing) - VTF::setFlags
138 * 3. Set the image resize methods (optional) - VTF::setImageResizeMethods
139 * 4. Set the base image (mip 0, frame 0, face 0, slice 0) - VTF::setImage
140 * 5. Compute mips (optional) - VTF::computeMips
141 * 6. Set the output format (optional) - VTF::setFormat
142 *
143 * After these methods are called, the other writer methods in the class should work as expected.
144 */
145class VTF {
146public:
147 enum FlagsV0 : uint32_t {
148 FLAG_POINT_SAMPLE = 1 << 0,
149 FLAG_TRILINEAR = 1 << 1,
150 FLAG_CLAMP_S = 1 << 2,
151 FLAG_CLAMP_T = 1 << 3,
152 FLAG_ANISOTROPIC = 1 << 4,
153 FLAG_HINT_DXT5 = 1 << 5,
154 FLAG_NORMAL = 1 << 7,
155 FLAG_NO_MIP = 1 << 8, // Controlled by mip count
156 FLAG_NO_LOD = 1 << 9,
157 FLAG_MIN_MIP = 1 << 10,
158 FLAG_PROCEDURAL = 1 << 11,
159 FLAG_ONE_BIT_ALPHA = 1 << 12,
160 FLAG_MULTI_BIT_ALPHA = 1 << 13,
161 FLAG_ENVMAP = 1 << 14, // Controlled by face count
162 FLAG_RENDERTARGET = 1 << 15,
163 FLAG_DEPTH_RENDERTARGET = 1 << 16,
164 FLAG_NO_DEBUG_OVERRIDE = 1 << 17,
165 FLAG_SINGLE_COPY = 1 << 18,
166 };
167 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;
168
169 enum FlagsV2 : uint32_t {
170 FLAG_V2_NO_DEPTH_BUFFER = 1 << 23,
171 FLAG_V2_CLAMP_U = 1 << 25,
172 };
173 static constexpr uint32_t FLAGS_MASK_V2 = FLAG_V2_NO_DEPTH_BUFFER | FLAG_V2_CLAMP_U;
174
175 enum FlagsV3 : uint32_t {
176 FLAG_V3_LOAD_ALL_MIPS = 1 << 10,
177 FLAG_V3_VERTEX_TEXTURE = 1 << 26,
178 FLAG_V3_SSBUMP = 1 << 27,
179 FLAG_V3_BORDER = 1 << 29,
180 };
181 static constexpr uint32_t FLAGS_MASK_V3 = FLAG_V3_LOAD_ALL_MIPS | FLAG_V3_VERTEX_TEXTURE | FLAG_V3_SSBUMP | FLAG_V3_BORDER;
182
183 enum FlagsV4 : uint32_t {
184 FLAG_V4_SRGB = 1 << 6,
185 };
186 static constexpr uint32_t FLAGS_MASK_V4 = FLAG_V4_SRGB;
187
188 enum FlagsV4_TF2 : uint32_t {
189 FLAG_V4_TF2_STAGING_MEMORY = 1 << 19,
190 FLAG_V4_TF2_IMMEDIATE_CLEANUP = 1 << 20,
191 FLAG_V4_TF2_IGNORE_PICMIP = 1 << 21,
192 FLAG_V4_TF2_STREAMABLE_COARSE = 1 << 30,
193 FLAG_V4_TF2_STREAMABLE_FINE = static_cast<uint32_t>(1 << 31),
194 };
195 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;
196
197 enum FlagsV5 : uint32_t {
198 FLAG_V5_PWL_CORRECTED = 1 << 6,
199 FLAG_V5_SRGB = 1 << 19,
200 FLAG_V5_DEFAULT_POOL = 1 << 20,
201 FLAG_V5_LOAD_MOST_MIPS = 1 << 28,
202 };
203 static constexpr uint32_t FLAGS_MASK_V5 = FLAG_V5_PWL_CORRECTED | FLAG_V5_SRGB | FLAG_V5_DEFAULT_POOL | FLAG_V5_LOAD_MOST_MIPS;
204
205 enum FlagsV5_CSGO : uint32_t {
206 FLAG_V5_CSGO_COMBINED = 1 << 21,
207 FLAG_V5_CSGO_ASYNC_DOWNLOAD = 1 << 22,
208 FLAG_V5_CSGO_SKIP_INITIAL_DOWNLOAD = 1 << 24,
209 FLAG_V5_CSGO_YCOCG = 1 << 30,
210 FLAG_V5_CSGO_ASYNC_SKIP_INITIAL_LOW_RES = static_cast<uint32_t>(1 << 31),
211 };
212 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;
213
214 static constexpr uint32_t FLAGS_MASK_INTERNAL = FLAG_NO_MIP | FLAG_ENVMAP;
215
216 enum Platform : uint32_t {
217 PLATFORM_UNKNOWN = 0x000,
218 PLATFORM_PC = 0x001,
219 PLATFORM_X360 = 0x360,
220 PLATFORM_PS3_ORANGEBOX = 0x333,
221 PLATFORM_PS3_PORTAL2 = 0x003,
222 };
223
225 uint32_t version = 4;
226 ImageFormat outputFormat = FORMAT_DEFAULT;
227 ImageConversion::ResizeMethod widthResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
228 ImageConversion::ResizeMethod heightResizeMethod = ImageConversion::ResizeMethod::POWER_OF_TWO_BIGGER;
229 ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT;
230 uint32_t flags = 0;
231 uint16_t initialFrameCount = 1;
232 uint16_t startFrame = 0;
233 bool isCubeMap = false;
234 uint16_t initialSliceCount = 1;
235 bool computeTransparencyFlags = true;
236 bool computeMips = true;
237 bool computeThumbnail = true;
238 bool computeReflectivity = true;
239 Platform platform = PLATFORM_PC;
240 int16_t compressionLevel = -1;
241 CompressionMethod compressionMethod = CompressionMethod::ZSTD;
242 float bumpMapScale = 1.f;
243 float gammaCorrection = 1.f;
244 bool invertGreenChannel = false;
245 };
246
248 static constexpr auto FORMAT_UNCHANGED = static_cast<ImageFormat>(-2);
249
251 static constexpr auto FORMAT_DEFAULT = static_cast<ImageFormat>(-1);
252
253 VTF();
254
255 explicit VTF(std::vector<std::byte>&& vtfData, bool parseHeaderOnly = false);
256
257 explicit VTF(std::span<const std::byte> vtfData, bool parseHeaderOnly = false);
258
259 explicit VTF(const std::string& vtfPath, bool parseHeaderOnly = false);
260
261 VTF(const VTF& other);
262
263 VTF& operator=(const VTF& other);
264
265 VTF(VTF&&) noexcept = default;
266
267 VTF& operator=(VTF&&) noexcept = default;
268
269 [[nodiscard]] explicit operator bool() const;
270
271 static bool create(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t height, const std::string& vtfPath, CreationOptions options);
272
273 static bool create(ImageFormat format, uint16_t width, uint16_t height, const std::string& vtfPath, CreationOptions options);
274
275 [[nodiscard]] static VTF create(std::span<const std::byte> imageData, ImageFormat format, uint16_t width, uint16_t height, CreationOptions options);
276
277 [[nodiscard]] static VTF create(ImageFormat format, uint16_t width, uint16_t height, CreationOptions options);
278
279 static bool create(const std::string& imagePath, const std::string& vtfPath, CreationOptions options);
280
281 [[nodiscard]] static VTF create(const std::string& imagePath, CreationOptions options);
282
283 [[nodiscard]] Platform getPlatform() const;
284
285 void setPlatform(Platform newPlatform);
286
287 [[nodiscard]] uint32_t getVersion() const;
288
289 void setVersion(uint32_t newVersion);
290
291 [[nodiscard]] ImageConversion::ResizeMethod getImageWidthResizeMethod() const;
292
293 [[nodiscard]] ImageConversion::ResizeMethod getImageHeightResizeMethod() const;
294
295 void setImageResizeMethods(ImageConversion::ResizeMethod imageWidthResizeMethod_, ImageConversion::ResizeMethod imageHeightResizeMethod_);
296
297 void setImageWidthResizeMethod(ImageConversion::ResizeMethod imageWidthResizeMethod_);
298
299 void setImageHeightResizeMethod(ImageConversion::ResizeMethod imageHeightResizeMethod_);
300
301 [[nodiscard]] uint16_t getWidth(uint8_t mip = 0) const;
302
303 [[nodiscard]] uint16_t getHeight(uint8_t mip = 0) const;
304
305 void setSize(uint16_t newWidth, uint16_t newHeight, ImageConversion::ResizeFilter filter);
306
307 [[nodiscard]] uint32_t getFlags() const;
308
309 void setFlags(uint32_t flags_);
310
311 void addFlags(uint32_t flags_);
312
313 void removeFlags(uint32_t flags_);
314
315 [[nodiscard]] bool isSRGB() const;
316
317 void setSRGB(bool srgb);
318
319 void computeTransparencyFlags();
320
321 [[nodiscard]] static ImageFormat getDefaultCompressedFormat(ImageFormat inputFormat, uint32_t version, bool isCubeMap);
322
323 [[nodiscard]] ImageFormat getFormat() const;
324
325 void setFormat(ImageFormat newFormat, ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT);
326
327 [[nodiscard]] uint8_t getMipCount() const;
328
329 bool setMipCount(uint8_t newMipCount);
330
331 bool setRecommendedMipCount();
332
333 void computeMips(ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT);
334
335 [[nodiscard]] uint16_t getFrameCount() const;
336
337 bool setFrameCount(uint16_t newFrameCount);
338
339 [[nodiscard]] uint8_t getFaceCount() const;
340
341 bool setFaceCount(bool isCubeMap);
342
343 [[nodiscard]] uint16_t getSliceCount() const;
344
345 bool setSliceCount(uint16_t newSliceCount);
346
347 bool setFrameFaceAndSliceCount(uint16_t newFrameCount, bool isCubeMap, uint16_t newSliceCount = 1);
348
349 [[nodiscard]] uint16_t getStartFrame() const;
350
351 void setStartFrame(uint16_t newStartFrame);
352
353 [[nodiscard]] sourcepp::math::Vec3f getReflectivity() const;
354
355 void setReflectivity(sourcepp::math::Vec3f newReflectivity);
356
357 void computeReflectivity();
358
359 [[nodiscard]] float getBumpMapScale() const;
360
361 void setBumpMapScale(float newBumpMapScale);
362
363 [[nodiscard]] ImageFormat getThumbnailFormat() const;
364
365 [[nodiscard]] uint8_t getThumbnailWidth() const;
366
367 [[nodiscard]] uint8_t getThumbnailHeight() const;
368
369 [[nodiscard]] const std::vector<Resource>& getResources() const;
370
371 [[nodiscard]] const Resource* getResource(Resource::Type type) const;
372
374 [[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;
375
377 [[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;
378
380 [[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;
381
382 void setParticleSheetResource(const SHT& value);
383
384 void removeParticleSheetResource();
385
386 void setCRCResource(uint32_t value);
387
388 void removeCRCResource();
389
390 void setLODResource(uint8_t u, uint8_t v, uint8_t u360 = 0, uint8_t v360 = 0);
391
392 void removeLODResource();
393
394 void setExtendedFlagsResource(uint32_t value);
395
396 void removeExtendedFlagsResource();
397
398 void setKeyValuesDataResource(const std::string& value);
399
400 void removeKeyValuesDataResource();
401
402 void setHotspotDataResource(const HOT& value);
403
404 void removeHotspotDataResource();
405
406 [[nodiscard]] int16_t getCompressionLevel() const;
407
408 void setCompressionLevel(int16_t newCompressionLevel);
409
410 [[nodiscard]] CompressionMethod getCompressionMethod() const;
411
412 void setCompressionMethod(CompressionMethod newCompressionMethod);
413
414 [[nodiscard]] bool hasImageData() const;
415
416 [[nodiscard]] std::span<const std::byte> getImageDataRaw(uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
417
418 [[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;
419
420 [[nodiscard]] std::vector<std::byte> getImageDataAsRGBA8888(uint8_t mip = 0, uint16_t frame = 0, uint8_t face = 0, uint16_t slice = 0) const;
421
422 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);
423
424 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);
425
426 [[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;
427
428 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)
429
430 [[nodiscard]] bool hasThumbnailData() const;
431
432 [[nodiscard]] std::span<const std::byte> getThumbnailDataRaw() const;
433
434 [[nodiscard]] std::vector<std::byte> getThumbnailDataAs(ImageFormat newFormat) const;
435
436 [[nodiscard]] std::vector<std::byte> getThumbnailDataAsRGBA8888() const;
437
438 void setThumbnail(std::span<const std::byte> imageData_, ImageFormat format_, uint16_t width_, uint16_t height_);
439
440 void computeThumbnail(ImageConversion::ResizeFilter filter = ImageConversion::ResizeFilter::DEFAULT);
441
442 void removeThumbnail();
443
444 [[nodiscard]] std::vector<std::byte> saveThumbnailToFile(ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const;
445
446 bool saveThumbnailToFile(const std::string& imagePath, ImageConversion::FileFormat fileFormat = ImageConversion::FileFormat::DEFAULT) const; // NOLINT(*-use-nodiscard)
447
448 [[nodiscard]] std::vector<std::byte> bake() const;
449
450 bool bake(const std::string& vtfPath) const; // NOLINT(*-use-nodiscard)
451
452protected:
453 static bool createInternal(VTF& writer, CreationOptions options);
454
455 [[nodiscard]] Resource* getResourceInternal(Resource::Type type);
456
457 void setResourceInternal(Resource::Type type, std::span<const std::byte> data_);
458
459 void removeResourceInternal(Resource::Type type);
460
461 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);
462
463 bool opened = false;
464
465 std::vector<std::byte> data;
466
467 //uint32_t signature;
468 uint32_t version{};
469 //uint32_t headerSize;
470
471 uint16_t width{};
472 uint16_t height{};
473 uint32_t flags{};
474
475 uint16_t frameCount = 1;
476 uint16_t startFrame{};
477
478 //uint8_t _padding0[4];
479 sourcepp::math::Vec3f reflectivity{};
480 //uint8_t _padding1[4];
481
482 float bumpMapScale{};
484 uint8_t mipCount = 1;
485
487 uint8_t thumbnailWidth{};
488 uint8_t thumbnailHeight{};
489
490 // 1 for v7.1 and lower
491 uint16_t sliceCount = 1;
492 //uint8_t _padding2[3];
493
494 // Technically added in v7.3, but we use it to store image and thumbnail data in v7.2 and lower anyway
495 //uint32_t resourceCount;
496 std::vector<Resource> resources;
497 //uint8_t _padding3[4];
498
499 // These aren't in the header
500 Platform platform = PLATFORM_PC;
501 int16_t compressionLevel = 0;
505};
513
514} // 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:216
FlagsV2
Definition: VTF.h:169
FlagsV0
Definition: VTF.h:147
VTF(VTF &&) noexcept=default
FlagsV4_TF2
Definition: VTF.h:188
FlagsV4
Definition: VTF.h:183
FlagsV5
Definition: VTF.h:197
FlagsV5_CSGO
Definition: VTF.h:205
FlagsV3
Definition: VTF.h:175
std::vector< Resource > resources
Definition: VTF.h:496
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:116
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