LLImageDXT Class Reference

#include <llimagedxt.h>

Inheritance diagram for LLImageDXT:

Inheritance graph
[legend]
Collaboration diagram for LLImageDXT:

Collaboration graph
[legend]

List of all members.

Public Types

enum  EFileFormat {
  FORMAT_UNKNOWN = 0, FORMAT_I8 = 1, FORMAT_A8, FORMAT_RGB8,
  FORMAT_RGBA8, FORMAT_DXT1, FORMAT_DXT2, FORMAT_DXT3,
  FORMAT_DXT4, FORMAT_DXT5, FORMAT_DXR1, FORMAT_DXR2,
  FORMAT_DXR3, FORMAT_DXR4, FORMAT_DXR5, FORMAT_NOFILE = 0xff
}

Public Member Functions

 LLImageDXT ()
BOOL updateData ()
BOOL decode (LLImageRaw *raw_image, F32 decode_time)
BOOL encode (const LLImageRaw *raw_image, F32 encode_time)
S32 calcHeaderSize ()
S32 calcDataSize (S32 discard_level=0)
BOOL getMipData (LLPointer< LLImageRaw > &raw, S32 discard=-1)
void setFormat ()
S32 getMipOffset (S32 discard)
EFileFormat getFileFormat ()
bool isCompressed ()
bool convertToDXR ()

Static Public Member Functions

static void checkMinWidthHeight (EFileFormat format, S32 &width, S32 &height)
static S32 formatBits (EFileFormat format)
static S32 formatBytes (EFileFormat format, S32 width, S32 height)
static S32 formatOffset (EFileFormat format, S32 width, S32 height, S32 max_width, S32 max_height)
static S32 formatComponents (EFileFormat format)
static EFileFormat getFormat (S32 fourcc)
static S32 getFourCC (EFileFormat format)
static void calcDiscardWidthHeight (S32 discard_level, EFileFormat format, S32 &width, S32 &height)
static S32 calcNumMips (S32 width, S32 height)

Protected Member Functions

 ~LLImageDXT ()

Private Member Functions

BOOL encodeDXT (const LLImageRaw *raw_image, F32 decode_time, bool explicit_mips)

Static Private Member Functions

static void extractMip (const U8 *indata, U8 *mipdata, int width, int height, int mip_width, int mip_height, EFileFormat format)

Private Attributes

EFileFormat mFileFormat
S32 mHeaderSize

Classes

struct  dxtfile_header_old_t
struct  dxtfile_header_t


Detailed Description

Definition at line 38 of file llimagedxt.h.


Member Enumeration Documentation

Enumerator:
FORMAT_UNKNOWN 
FORMAT_I8 
FORMAT_A8 
FORMAT_RGB8 
FORMAT_RGBA8 
FORMAT_DXT1 
FORMAT_DXT2 
FORMAT_DXT3 
FORMAT_DXT4 
FORMAT_DXT5 
FORMAT_DXR1 
FORMAT_DXR2 
FORMAT_DXR3 
FORMAT_DXR4 
FORMAT_DXR5 
FORMAT_NOFILE 

Definition at line 41 of file llimagedxt.h.


Constructor & Destructor Documentation

LLImageDXT::~LLImageDXT (  )  [protected]

Definition at line 174 of file llimagedxt.cpp.

LLImageDXT::LLImageDXT (  ) 

Definition at line 167 of file llimagedxt.cpp.


Member Function Documentation

BOOL LLImageDXT::encodeDXT ( const LLImageRaw raw_image,
F32  decode_time,
bool  explicit_mips 
) [private]

BOOL LLImageDXT::updateData (  )  [virtual]

BOOL LLImageDXT::decode ( LLImageRaw raw_image,
F32  decode_time 
) [virtual]

BOOL LLImageDXT::encode ( const LLImageRaw raw_image,
F32  encode_time 
) [virtual]

Implements LLImageFormatted.

Definition at line 397 of file llimagedxt.cpp.

References encodeDXT().

Here is the call graph for this function:

S32 LLImageDXT::calcHeaderSize (  )  [virtual]

Reimplemented from LLImageFormatted.

Definition at line 454 of file llimagedxt.cpp.

References llmax().

Referenced by setFormat().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLImageDXT::calcDataSize ( S32  discard_level = 0  )  [virtual]

Reimplemented from LLImageFormatted.

Definition at line 460 of file llimagedxt.cpp.

References FORMAT_UNKNOWN, formatBytes(), LLImageBase::getHeight(), getMipOffset(), LLImageBase::getWidth(), llendl, llerrs, LLImageFormatted::mDiscardLevel, mFileFormat, and S32.

Here is the call graph for this function:

BOOL LLImageDXT::getMipData ( LLPointer< LLImageRaw > &  raw,
S32  discard = -1 
)

Definition at line 291 of file llimagedxt.cpp.

References calcDiscardWidthHeight(), LLImageBase::getComponents(), LLImageBase::getData(), getMipOffset(), llendl, llerrs, LLImageFormatted::mDiscardLevel, mFileFormat, S32, and TRUE.

Referenced by LLImageWorker::requestDecodedData().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLImageDXT::setFormat (  ) 

Definition at line 251 of file llimagedxt.cpp.

References calcHeaderSize(), FORMAT_DXR1, FORMAT_DXR3, LLImageBase::getComponents(), llendl, llerrs, mFileFormat, mHeaderSize, and S32.

Here is the call graph for this function:

S32 LLImageDXT::getMipOffset ( S32  discard  ) 

Definition at line 227 of file llimagedxt.cpp.

References calcNumMips(), FORMAT_DXT1, FORMAT_DXT5, formatBytes(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert, llclamp(), llendl, llerrs, mFileFormat, mHeaderSize, and S32.

Referenced by calcDataSize(), convertToDXR(), decode(), encodeDXT(), and getMipData().

Here is the call graph for this function:

Here is the caller graph for this function:

EFileFormat LLImageDXT::getFileFormat (  )  [inline]

Definition at line 118 of file llimagedxt.h.

References mFileFormat.

bool LLImageDXT::isCompressed (  )  [inline]

Definition at line 119 of file llimagedxt.h.

References FORMAT_DXR5, FORMAT_DXT1, and mFileFormat.

bool LLImageDXT::convertToDXR (  ) 

void LLImageDXT::checkMinWidthHeight ( EFileFormat  format,
S32 width,
S32 height 
) [static]

Definition at line 36 of file llimagedxt.cpp.

References FORMAT_DXR5, FORMAT_DXT1, llmax(), and S32.

Referenced by calcDiscardWidthHeight(), encodeDXT(), and formatBytes().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLImageDXT::formatBits ( EFileFormat  format  )  [static]

Definition at line 44 of file llimagedxt.cpp.

References FORMAT_A8, FORMAT_DXR1, FORMAT_DXR3, FORMAT_DXR5, FORMAT_DXT1, FORMAT_DXT3, FORMAT_DXT5, FORMAT_I8, FORMAT_RGB8, FORMAT_RGBA8, llendl, and llerrs.

Referenced by formatBytes().

Here is the caller graph for this function:

S32 LLImageDXT::formatBytes ( EFileFormat  format,
S32  width,
S32  height 
) [static]

Definition at line 65 of file llimagedxt.cpp.

References checkMinWidthHeight(), formatBits(), and S32.

Referenced by calcDataSize(), convertToDXR(), decode(), encodeDXT(), extractMip(), and getMipOffset().

Here is the call graph for this function:

Here is the caller graph for this function:

static S32 LLImageDXT::formatOffset ( EFileFormat  format,
S32  width,
S32  height,
S32  max_width,
S32  max_height 
) [static]

S32 LLImageDXT::formatComponents ( EFileFormat  format  )  [static]

Definition at line 74 of file llimagedxt.cpp.

References FORMAT_A8, FORMAT_DXR1, FORMAT_DXR3, FORMAT_DXR5, FORMAT_DXT1, FORMAT_DXT3, FORMAT_DXT5, FORMAT_I8, FORMAT_RGB8, FORMAT_RGBA8, llendl, and llerrs.

Referenced by updateData().

Here is the caller graph for this function:

LLImageDXT::EFileFormat LLImageDXT::getFormat ( S32  fourcc  )  [static]

Definition at line 95 of file llimagedxt.cpp.

References FORMAT_A8, FORMAT_DXR1, FORMAT_DXR2, FORMAT_DXR3, FORMAT_DXR4, FORMAT_DXR5, FORMAT_DXT1, FORMAT_DXT2, FORMAT_DXT3, FORMAT_DXT4, FORMAT_DXT5, FORMAT_I8, FORMAT_RGB8, FORMAT_RGBA8, and FORMAT_UNKNOWN.

Referenced by updateData().

Here is the caller graph for this function:

S32 LLImageDXT::getFourCC ( EFileFormat  format  )  [static]

Definition at line 118 of file llimagedxt.cpp.

References FORMAT_A8, FORMAT_DXR1, FORMAT_DXR2, FORMAT_DXR3, FORMAT_DXR4, FORMAT_DXR5, FORMAT_DXT1, FORMAT_DXT2, FORMAT_DXT3, FORMAT_DXT4, FORMAT_DXT5, FORMAT_I8, FORMAT_RGB8, and FORMAT_RGBA8.

Referenced by convertToDXR(), and encodeDXT().

Here is the caller graph for this function:

void LLImageDXT::calcDiscardWidthHeight ( S32  discard_level,
EFileFormat  format,
S32 width,
S32 height 
) [static]

Definition at line 141 of file llimagedxt.cpp.

References checkMinWidthHeight().

Referenced by getMipData().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLImageDXT::calcNumMips ( S32  width,
S32  height 
) [static]

Definition at line 153 of file llimagedxt.cpp.

References S32.

Referenced by convertToDXR(), encodeDXT(), and getMipOffset().

Here is the caller graph for this function:

void LLImageDXT::extractMip ( const U8 indata,
U8 mipdata,
int  width,
int  height,
int  mip_width,
int  mip_height,
EFileFormat  format 
) [static, private]

Definition at line 481 of file llimagedxt.cpp.

References formatBytes().

Referenced by encodeDXT().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 141 of file llimagedxt.h.

Referenced by convertToDXR(), encodeDXT(), getMipOffset(), setFormat(), and updateData().


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

Generated on Fri May 16 08:49:32 2008 for SecondLife by  doxygen 1.5.5