VTFParser
Simple and modern library for parsing the Valve Texture Format
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
VtfParser Namespace Reference

Classes

struct  Header
 
struct  HeaderBase
 
struct  ResourceEntryInfo
 
class  Vtf
 

Enumerations

enum class  ImageFormat : int32_t {
  NONE = -1 , RGBA8888 = 0 , ABGR8888 , RGB888 ,
  BGR888 , RGB565 , I8 , IA88 ,
  P8 , A8 , RGB888_BLUESCREEN , BGR888_BLUESCREEN ,
  ARGB8888 , BGRA8888 , DXT1 , DXT3 ,
  DXT5 , BGRX8888 , BGR565 , BGRX5551 ,
  BGRA4444 , DXT1_ONEBITALPHA , BGRA5551 , UV88 ,
  UVWQ8888 , RGBA16161616F , RGBA16161616 , UVLX8888
}
 
enum class  TextureFlags : uint32_t {
  NONE = 0 , POINTSAMPLE = 0x00000001 , TRILINEAR = 0x00000002 , CLAMPS = 0x00000004 ,
  CLAMPT = 0x00000008 , ANISOTROPIC = 0x00000010 , HINT_DXT5 = 0x00000020 , PWL_CORRECTED = 0x00000040 ,
  SRGB = 0x00000040 , NORMAL = 0x00000080 , NOMIP = 0x00000100 , NOLOD = 0x00000200 ,
  ALL_MIPS = 0x00000400 , PROCEDURAL = 0x00000800 , ONEBITALPHA = 0x00001000 , EIGHTBITALPHA = 0x00002000 ,
  ENVMAP = 0x00004000 , RENDERTARGET = 0x00008000 , DEPTHRENDERTARGET = 0x00010000 , NODEBUGOVERRIDE = 0x00020000 ,
  SINGLECOPY = 0x00040000 , PRE_SRGB = 0x00080000 , UNUSED_00100000 = 0x00100000 , UNUSED_00200000 = 0x00200000 ,
  UNUSED_00400000 = 0x00400000 , NODEPTHBUFFER = 0x00800000 , UNUSED_01000000 = 0x01000000 , CLAMPU = 0x02000000 ,
  VERTEXTEXTURE = 0x04000000 , SSBUMP = 0x08000000 , UNUSED_10000000 = 0x10000000 , BORDER = 0x20000000 ,
  UNUSED_40000000 = 0x40000000 , UNUSED_80000000 = 0x80000000
}
 

Functions

TextureFlags operator& (const TextureFlags &a, const TextureFlags &b)
 
TextureFlags operator| (const TextureFlags &a, const TextureFlags &b)
 
void checkBounds (size_t offset, size_t count, size_t rangeSize, const char *errorMessage)
 

Detailed Description

Namespace containing all VtfParser classes and functions.

Enumeration Type Documentation

◆ ImageFormat

enum class VtfParser::ImageFormat : int32_t
strong

Image formats.

Remarks
Many of these have the same size and components in memory, but should be interpreted differently.

◆ TextureFlags

enum class VtfParser::TextureFlags : uint32_t
strong

Flags describing how the texture should be used (e.g. sampling mode).

Enumerator
NONE 

No flags are set

POINTSAMPLE 

Texture should be rendered without interpolation (regardless of graphics options).

TRILINEAR 

Texture should be rendered with trilinear interpolation (regardless of graphics options).

CLAMPS 

S texture coordinate should be clamped instead of wrapped.

Note
ST is equivalent to UV.
CLAMPT 

T texture coordinate should be clamped instead of wrapped.

Note
ST is equivalent to UV.
ANISOTROPIC 

Texture should be rendered with anisotropic interpolation (regardless of graphics options).

HINT_DXT5 

Exact meaning unknown.

PWL_CORRECTED 

Usage unknown. Shares the same value as SRGB.

SRGB 

Texture uses sRGB colour space.

Remarks
It's unclear whether this means the texture is stored as sRGB, or stored as linear and should be converted to sRGB.
Deprecated:
Deprecated since 7.5.
NORMAL 

Texture is a normal map.

NOMIP 

Only the largest mip level should be used.

Remarks
The other mip levels are present in the file regardless of this option.
NOLOD 

Not affected by texture resolution settings.

ALL_MIPS 

If set, use mipmaps below 32x32 pixels.

Remarks
Implies that by default only mip levels greater than 32x32 pixels in size should be used.
PROCEDURAL 

Texture is a procedural texture.

ONEBITALPHA 

One bit alpha channel is used.

EIGHTBITALPHA 

Eight bit alpha channel is used.

Note
Actually used for all formats without a binary alpha channel.
ENVMAP 

Texture is an environment map.

RENDERTARGET 

Texture is a rendertarget.

DEPTHRENDERTARGET 

Texture is a depth rendertarget.

NODEBUGOVERRIDE 

Usage unknown.

SINGLECOPY 

Usage unknown.

PRE_SRGB 

Texture has already had sRGB correction applied.

Remarks
Unclear if this means the texture data has been converted from sRGB to linear, or linear to sRGB - most likely the latter.
NODEPTHBUFFER 

Exclude from depth buffering.

Remarks
Presumably this means render above all other content on-screen.
CLAMPU 

U texture coordinate should be clamped instead of wrapped.

Attention
This is the depth to sample in a volumetric (3D) texture, not the U in UV.
VERTEXTEXTURE 

Usable as a vertex texture.

SSBUMP 

Texture is an SSBump.

BORDER 

Clamp to border colour on all texture coordinates.