molecular
Classes | Public Member Functions | List of all members
molecular::util::DdsFile Class Reference

Interface to DirectDrawSurface files. More...

#include <DdsFile.h>

Inheritance diagram for molecular::util::DdsFile:
molecular::util::NonCopyable

Classes

struct  Header
 DDS file header. More...
 
struct  PixelFormatHeader
 Part of the file header for pixel format information. More...
 

Public Member Functions

 DdsFile (const void *pointer, size_t size)
 Construct from memory block. More...
 
 ~DdsFile ()
 
bool IsDataCompressed ()
 
PixelFormat GetFormat ()
 
unsigned int GetNumFaces () const
 
unsigned int GetNumMipmapLevels () const
 Returns number of mipmap levels. More...
 
const void * GetSingleImage (unsigned int face, unsigned int mipmapLevel, unsigned int &outWidth, unsigned int &outHeight, size_t &outSize) const
 Returns data pointer and sizes of a single image inside the file. More...
 

Detailed Description

Interface to DirectDrawSurface files.

Todo:
Linear non-compressed formats.

Constructor & Destructor Documentation

molecular::util::DdsFile::DdsFile ( const void *  pointer,
size_t  size 
)

Construct from memory block.

The memory must remain valid for calls to GetSingleImage. Useful for mmapped files.

molecular::util::DdsFile::~DdsFile ( )

Member Function Documentation

PixelFormat molecular::util::DdsFile::GetFormat ( )
unsigned int molecular::util::DdsFile::GetNumFaces ( ) const
inline

e.g. 1 for regular images, 6 for cube maps.

unsigned int molecular::util::DdsFile::GetNumMipmapLevels ( ) const
inline

Returns number of mipmap levels.

Returns
Number of mipmaps, or 1 for no mipmapping.
const void * molecular::util::DdsFile::GetSingleImage ( unsigned int  face,
unsigned int  mipmapLevel,
unsigned int &  outWidth,
unsigned int &  outHeight,
size_t &  outSize 
) const

Returns data pointer and sizes of a single image inside the file.

bool molecular::util::DdsFile::IsDataCompressed ( )

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