LLImageTGA Class Reference

#include <llimagetga.h>

Inheritance diagram for LLImageTGA:

Inheritance graph
[legend]
Collaboration diagram for LLImageTGA:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLImageTGA ()
 LLImageTGA (const LLString &file_name)
BOOL updateData ()
BOOL decode (LLImageRaw *raw_image, F32 decode_time=0.0)
BOOL encode (const LLImageRaw *raw_image, F32 encode_time=0.0)
BOOL decodeAndProcess (LLImageRaw *raw_image, F32 domain, F32 weight)

Protected Member Functions

virtual ~LLImageTGA ()

Private Member Functions

BOOL decodeTruecolor (LLImageRaw *raw_image, BOOL rle, BOOL flipped)
BOOL decodeTruecolorRle8 (LLImageRaw *raw_image)
BOOL decodeTruecolorRle15 (LLImageRaw *raw_image)
BOOL decodeTruecolorRle24 (LLImageRaw *raw_image)
BOOL decodeTruecolorRle32 (LLImageRaw *raw_image, BOOL &alpha_opaque)
void decodeTruecolorPixel15 (U8 *dst, const U8 *src)
BOOL decodeTruecolorNonRle (LLImageRaw *raw_image, BOOL &alpha_opaque)
BOOL decodeColorMap (LLImageRaw *raw_image, BOOL rle, BOOL flipped)
void decodeColorMapPixel8 (U8 *dst, const U8 *src)
void decodeColorMapPixel15 (U8 *dst, const U8 *src)
void decodeColorMapPixel24 (U8 *dst, const U8 *src)
void decodeColorMapPixel32 (U8 *dst, const U8 *src)
bool loadFile (const LLString &file_name)

Private Attributes

U32 mDataOffset
U8 mIDLength
U8 mColorMapType
U8 mImageType
U8 mColorMapIndexLo
U8 mColorMapIndexHi
U8 mColorMapLengthLo
U8 mColorMapLengthHi
U8 mColorMapDepth
U8 mXOffsetLo
U8 mXOffsetHi
U8 mYOffsetLo
U8 mYOffsetHi
U8 mWidthLo
U8 mWidthHi
U8 mHeightLo
U8 mHeightHi
U8 mPixelSize
U8 mAttributeBits
U8 mOriginRightBit
U8 mOriginTopBit
U8 mInterleave
U8mColorMap
S32 mColorMapStart
S32 mColorMapLength
S32 mColorMapBytesPerEntry
BOOL mIs15Bit

Static Private Attributes

static const U8 s5to8bits [32]

Detailed Description

Definition at line 39 of file llimagetga.h.


Constructor & Destructor Documentation

LLImageTGA::~LLImageTGA (  )  [protected, virtual]

Definition at line 81 of file llimagetga.cpp.

References mColorMap.

LLImageTGA::LLImageTGA (  ) 

Definition at line 60 of file llimagetga.cpp.

LLImageTGA::LLImageTGA ( const LLString file_name  ) 

Definition at line 70 of file llimagetga.cpp.

References loadFile().


Member Function Documentation

BOOL LLImageTGA::decode ( LLImageRaw raw_image,
F32  decode_time = 0.0 
) [virtual]

Implements LLImageFormatted.

Definition at line 305 of file llimagetga.cpp.

References decodeColorMap(), decodeTruecolor(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert_always, mColorMap, mImageType, mOriginRightBit, mOriginTopBit, LLImageRaw::resize(), and LLImageBase::setLastError().

BOOL LLImageTGA::decodeAndProcess ( LLImageRaw raw_image,
F32  domain,
F32  weight 
)

Definition at line 996 of file llimagetga.cpp.

References bias(), f, FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), i, llassert_always, llclampb(), llclampf(), llendl, llerrs, mDataOffset, mImageType, mOriginRightBit, mOriginTopBit, LLImageRaw::resize(), S32, LLImageBase::setLastError(), and TRUE.

BOOL LLImageTGA::decodeColorMap ( LLImageRaw raw_image,
BOOL  rle,
BOOL  flipped 
) [private]

Definition at line 499 of file llimagetga.cpp.

References decodeColorMapPixel15(), decodeColorMapPixel24(), decodeColorMapPixel32(), decodeColorMapPixel8(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getHeight(), LLImageBase::getWidth(), i, j, llassert, mColorMapBytesPerEntry, mDataOffset, mPixelSize, S32, TRUE, LLImageRaw::verticalFlip(), and void.

Referenced by decode().

void LLImageTGA::decodeColorMapPixel15 ( U8 dst,
const U8 src 
) [private]

Definition at line 475 of file llimagetga.cpp.

References decodeTruecolorPixel15(), llclamp(), mColorMap, mColorMapLength, mColorMapStart, and S32.

Referenced by decodeColorMap().

void LLImageTGA::decodeColorMapPixel24 ( U8 dst,
const U8 src 
) [private]

Definition at line 481 of file llimagetga.cpp.

References llclamp(), mColorMap, mColorMapLength, mColorMapStart, and S32.

Referenced by decodeColorMap().

void LLImageTGA::decodeColorMapPixel32 ( U8 dst,
const U8 src 
) [private]

Definition at line 489 of file llimagetga.cpp.

References llclamp(), mColorMap, mColorMapLength, mColorMapStart, and S32.

Referenced by decodeColorMap().

void LLImageTGA::decodeColorMapPixel8 ( U8 dst,
const U8 src 
) [private]

Definition at line 469 of file llimagetga.cpp.

References llclamp(), mColorMap, mColorMapLength, mColorMapStart, and S32.

Referenced by decodeColorMap().

BOOL LLImageTGA::decodeTruecolor ( LLImageRaw raw_image,
BOOL  rle,
BOOL  flipped 
) [private]

Definition at line 348 of file llimagetga.cpp.

References LLImageRaw::copy(), decodeTruecolorNonRle(), decodeTruecolorRle15(), decodeTruecolorRle24(), decodeTruecolorRle32(), decodeTruecolorRle8(), FALSE, LLImageBase::getComponents(), LLImageBase::getHeight(), LLImageBase::getWidth(), mIs15Bit, LLImageRaw::resize(), and LLImageRaw::verticalFlip().

Referenced by decode().

BOOL LLImageTGA::decodeTruecolorNonRle ( LLImageRaw raw_image,
BOOL alpha_opaque 
) [private]

Definition at line 412 of file llimagetga.cpp.

References decodeTruecolorPixel15(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getHeight(), LLImageBase::getWidth(), mDataOffset, mIs15Bit, pixels, S32, and TRUE.

Referenced by decodeTruecolor().

void LLImageTGA::decodeTruecolorPixel15 ( U8 dst,
const U8 src 
) [inline, private]

Definition at line 47 of file llimagetga.cpp.

References s5to8bits, and t.

Referenced by decodeColorMapPixel15(), decodeTruecolorNonRle(), and decodeTruecolorRle15().

BOOL LLImageTGA::decodeTruecolorRle15 ( LLImageRaw raw_image  )  [private]

Definition at line 823 of file llimagetga.cpp.

References decodeTruecolorPixel15(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert, mDataOffset, mIs15Bit, and TRUE.

Referenced by decodeTruecolor().

BOOL LLImageTGA::decodeTruecolorRle24 ( LLImageRaw raw_image  )  [private]

Definition at line 882 of file llimagetga.cpp.

References FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert, mDataOffset, and TRUE.

Referenced by decodeTruecolor().

BOOL LLImageTGA::decodeTruecolorRle32 ( LLImageRaw raw_image,
BOOL alpha_opaque 
) [private]

Definition at line 744 of file llimagetga.cpp.

References FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert, mDataOffset, and TRUE.

Referenced by decodeTruecolor().

BOOL LLImageTGA::decodeTruecolorRle8 ( LLImageRaw raw_image  )  [private]

Definition at line 942 of file llimagetga.cpp.

References FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getDataSize(), LLImageBase::getHeight(), LLImageBase::getWidth(), llassert, mDataOffset, and TRUE.

Referenced by decodeTruecolor().

BOOL LLImageTGA::encode ( const LLImageRaw raw_image,
F32  encode_time = 0.0 
) [virtual]

Implements LLImageFormatted.

Definition at line 594 of file llimagetga.cpp.

References LLImageFormatted::allocateData(), LLImageFormatted::deleteData(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getHeight(), LLImageBase::getWidth(), i, j, llassert, llassert_always, mAttributeBits, mColorMapDepth, mColorMapIndexHi, mColorMapIndexLo, mColorMapLengthHi, mColorMapLengthLo, mColorMapType, mDataOffset, mHeightHi, mHeightLo, mIDLength, mImageType, mInterleave, mOriginRightBit, mOriginTopBit, mPixelSize, mWidthHi, mWidthLo, mXOffsetHi, mXOffsetLo, mYOffsetHi, mYOffsetLo, pixels, S32, LLImageBase::setSize(), and TRUE.

Referenced by LLVOVolume::writeCAL3D().

bool LLImageTGA::loadFile ( const LLString file_name  )  [private]

Definition at line 1116 of file llimagetga.cpp.

References LLImageFormatted::allocateData(), LLImageFormatted::deleteData(), LLFile::fopen(), llendl, llwarns, S32, LLStringBase< char >::toLower(), and updateData().

Referenced by LLImageTGA().

BOOL LLImageTGA::updateData (  )  [virtual]

Implements LLImageFormatted.

Definition at line 86 of file llimagetga.cpp.

References FALSE, LLImageBase::getData(), LLImageBase::getDataSize(), height, llendl, llerrs, mAttributeBits, mColorMap, mColorMapBytesPerEntry, mColorMapDepth, mColorMapIndexHi, mColorMapIndexLo, mColorMapLength, mColorMapLengthHi, mColorMapLengthLo, mColorMapStart, mColorMapType, mDataOffset, mHeightHi, mHeightLo, mIDLength, mImageType, mInterleave, mIs15Bit, mOriginRightBit, mOriginTopBit, mPixelSize, mWidthHi, mWidthLo, mXOffsetHi, mXOffsetLo, mYOffsetHi, mYOffsetLo, LLImageBase::resetLastError(), S32, LLImageBase::setLastError(), LLImageBase::setSize(), TRUE, and width.

Referenced by loadFile().


Member Data Documentation

U8 LLImageTGA::mAttributeBits [private]

Definition at line 97 of file llimagetga.h.

Referenced by encode(), and updateData().

U8* LLImageTGA::mColorMap [private]

Definition at line 102 of file llimagetga.h.

Referenced by decode(), decodeColorMapPixel15(), decodeColorMapPixel24(), decodeColorMapPixel32(), decodeColorMapPixel8(), updateData(), and ~LLImageTGA().

S32 LLImageTGA::mColorMapBytesPerEntry [private]

Definition at line 105 of file llimagetga.h.

Referenced by decodeColorMap(), and updateData().

U8 LLImageTGA::mColorMapDepth [private]

Definition at line 87 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mColorMapIndexHi [private]

Definition at line 84 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mColorMapIndexLo [private]

Definition at line 83 of file llimagetga.h.

Referenced by encode(), and updateData().

S32 LLImageTGA::mColorMapLength [private]

Definition at line 104 of file llimagetga.h.

Referenced by decodeColorMapPixel15(), decodeColorMapPixel24(), decodeColorMapPixel32(), decodeColorMapPixel8(), and updateData().

U8 LLImageTGA::mColorMapLengthHi [private]

Definition at line 86 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mColorMapLengthLo [private]

Definition at line 85 of file llimagetga.h.

Referenced by encode(), and updateData().

S32 LLImageTGA::mColorMapStart [private]

Definition at line 103 of file llimagetga.h.

Referenced by decodeColorMapPixel15(), decodeColorMapPixel24(), decodeColorMapPixel32(), decodeColorMapPixel8(), and updateData().

U8 LLImageTGA::mColorMapType [private]

Definition at line 81 of file llimagetga.h.

Referenced by encode(), and updateData().

U32 LLImageTGA::mDataOffset [private]

Definition at line 77 of file llimagetga.h.

Referenced by decodeAndProcess(), decodeColorMap(), decodeTruecolorNonRle(), decodeTruecolorRle15(), decodeTruecolorRle24(), decodeTruecolorRle32(), decodeTruecolorRle8(), encode(), and updateData().

U8 LLImageTGA::mHeightHi [private]

Definition at line 95 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mHeightLo [private]

Definition at line 94 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mIDLength [private]

Definition at line 80 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mImageType [private]

Definition at line 82 of file llimagetga.h.

Referenced by decode(), decodeAndProcess(), encode(), and updateData().

U8 LLImageTGA::mInterleave [private]

Definition at line 100 of file llimagetga.h.

Referenced by encode(), and updateData().

BOOL LLImageTGA::mIs15Bit [private]

Definition at line 107 of file llimagetga.h.

Referenced by decodeTruecolor(), decodeTruecolorNonRle(), decodeTruecolorRle15(), and updateData().

U8 LLImageTGA::mOriginRightBit [private]

Definition at line 98 of file llimagetga.h.

Referenced by decode(), decodeAndProcess(), encode(), and updateData().

U8 LLImageTGA::mOriginTopBit [private]

Definition at line 99 of file llimagetga.h.

Referenced by decode(), decodeAndProcess(), encode(), and updateData().

U8 LLImageTGA::mPixelSize [private]

Definition at line 96 of file llimagetga.h.

Referenced by decodeColorMap(), encode(), and updateData().

U8 LLImageTGA::mWidthHi [private]

Definition at line 93 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mWidthLo [private]

Definition at line 92 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mXOffsetHi [private]

Definition at line 89 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mXOffsetLo [private]

Definition at line 88 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mYOffsetHi [private]

Definition at line 91 of file llimagetga.h.

Referenced by encode(), and updateData().

U8 LLImageTGA::mYOffsetLo [private]

Definition at line 90 of file llimagetga.h.

Referenced by encode(), and updateData().

const U8 LLImageTGA::s5to8bits [static, private]

Initial value:

 
        {
                0,   8,  16,  25,  33,  41,  49,  58,
           66,  74,  82,  90,  99, 107, 115, 123,
          132, 140, 148, 156, 165, 173, 181, 189,
          197, 206, 214, 222, 230, 239, 247, 255
        }

Definition at line 109 of file llimagetga.h.

Referenced by decodeTruecolorPixel15().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:25 2010 for Second Life Viewer by  doxygen 1.4.7