Cafu Engine
HL2mdl::vtfFileT Class Reference

This class represents a VTF image file as documented at https://developer.valvesoftware.com/wiki/VTF. More...

#include "Loader_mdl_hl2_vtf.hpp"

Public Member Functions

 vtfFileT (const std::string &FileName)
 
const vtfHeaderTGetHeader () const
 
uint8_t * GetData (uint32_t Frame, uint32_t Face, uint32_t Slice, uint32_t MipmapLevel) const
 Returns a pointer to the image data for a given frame, face, z-slice and MIP level. More...
 

Detailed Description

This class represents a VTF image file as documented at https://developer.valvesoftware.com/wiki/VTF.

In summary, the disk file format for VTF files is:

  • VTF header (80 bytes)
  • low-res image data
  • image data

The image data is stored as follows:

  • for each mipmap level (starting with the smallest and getting larger)
    • for each frame
      • for each face (for cubemaps)
        • for each z-slice
          • image data

Member Function Documentation

uint8_t * vtfFileT::GetData ( uint32_t  Frame,
uint32_t  Face,
uint32_t  Slice,
uint32_t  MipmapLevel 
) const

Returns a pointer to the image data for a given frame, face, z-slice and MIP level.

Frames start at index 0 for the first frame. Faces start at index 0 for the first face. Cubemaps have 6 faces, others only 1. MIP levels start at index 0 for the largest image moving down in size.


The documentation for this class was generated from the following files: