nvtt
Loading...
Searching...
No Matches
Public Member Functions | List of all members
nvtt::SurfaceSet Struct Reference

Surface-set struct for convenience of handling multi-level texture files such as DDS, currently only supporting reading. More...

#include <nvtt.h>

Public Member Functions

NVTT_API SurfaceSet ()
 Constructor.
 
NVTT_API ~SurfaceSet ()
 Destructor.
 
NVTT_API TextureType GetTextureType ()
 Texture type: 2D, 3D, or Cube.
 
NVTT_API int GetFaceCount ()
 Number of faces.
 
NVTT_API int GetMipmapCount ()
 Number of mip-map levels.
 
NVTT_API int GetWidth ()
 Image width (level 0)
 
NVTT_API int GetHeight ()
 Image height (level 0)
 
NVTT_API int GetDepth ()
 Image depth (level 0)
 
NVTT_API Surface GetSurface (int faceId, int mipId, bool expectSigned=false)
 Get a surface at specified face and mip level.
 
NVTT_API void GetSurface (int faceId, int mipId, Surface &surface, bool expectSigned=false)
 Get a surface at specified face and mip level.
 
NVTT_API void reset ()
 Release data.
 
NVTT_API bool loadDDS (const char *fileName, bool forcenormal=false)
 Load a surface set from a DDS file.
 
NVTT_API bool loadDDSFromMemory (const void *data, unsigned long long sizeInBytes, bool forcenormal=false)
 Load a surface set from an in-memory DDS file.
 
NVTT_API bool saveImage (const char *fileName, int faceId, int mipId)
 Save an image at specified face and mip level (for decompression)
 

Detailed Description

Surface-set struct for convenience of handling multi-level texture files such as DDS, currently only supporting reading.

Since
NVTT 3.0

Member Function Documentation

◆ loadDDS()

NVTT_API bool nvtt::SurfaceSet::loadDDS ( const char * fileName,
bool forcenormal = false )

Load a surface set from a DDS file.

Returns
true if loading succeeded and false if it failed.
Parameters
fileNamePath to the file to load. This uses the same character encoding as the filename argument of fopen().
forcenormalIf true, builds a normal map from the red and green components of BC5U data, or the alpha and green components of BC3 data.

◆ loadDDSFromMemory()

NVTT_API bool nvtt::SurfaceSet::loadDDSFromMemory ( const void * data,
unsigned long long sizeInBytes,
bool forcenormal = false )

Load a surface set from an in-memory DDS file.

Returns
true if loading succeeded and false if it failed.
Parameters
dataPointer to the start of the file's data in memory.
sizeInBytesLength of the file's data.
forcenormalIf true, builds a normal map from the red and green components of BC5U data, or the alpha and green components of BC3 data.

The documentation for this struct was generated from the following file: