LLPngWrapper Class Reference

#include <llpngwrapper.h>

Collaboration diagram for LLPngWrapper:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLPngWrapper ()
virtual ~LLPngWrapper ()
BOOL isValidPng (U8 *src)
BOOL readPng (U8 *src, LLImageRaw *rawImage, ImageInfo *infop=NULL)
BOOL writePng (const LLImageRaw *rawImage, U8 *dst)
U32 getFinalSize ()
LLString getErrorMessage ()

Protected Member Functions

void normalizeImage ()
void updateMetaData ()

Private Member Functions

void releaseResources ()

Static Private Member Functions

static void writeFlush (png_structp png_ptr)
static void errorHandler (png_structp png_ptr, png_const_charp msg)
static void readDataCallback (png_structp png_ptr, png_bytep dest, png_size_t length)
static void writeDataCallback (png_structp png_ptr, png_bytep src, png_size_t length)

Private Attributes

png_structp mReadPngPtr
png_infop mReadInfoPtr
png_structp mWritePngPtr
png_infop mWriteInfoPtr
U8 ** mRowPointers
png_uint_32 mWidth
png_uint_32 mHeight
S32 mBitDepth
S32 mColorType
S32 mChannels
S32 mInterlaceType
S32 mCompressionType
S32 mFilterMethod
U32 mFinalSize
BOOL mHasBKGD
png_color_16p mBackgroundColor
F64 mGamma
LLString mErrorMessage

Classes

struct  ImageInfo
struct  PngDataInfo

Detailed Description

Definition at line 37 of file llpngwrapper.h.


Constructor & Destructor Documentation

LLPngWrapper::LLPngWrapper (  ) 

Definition at line 43 of file llpngwrapper.cpp.

LLPngWrapper::~LLPngWrapper (  )  [virtual]

Definition at line 59 of file llpngwrapper.cpp.

References releaseResources().


Member Function Documentation

void LLPngWrapper::errorHandler ( png_structp  png_ptr,
png_const_charp  msg 
) [static, private]

Definition at line 82 of file llpngwrapper.cpp.

Referenced by readPng(), and writePng().

LLString LLPngWrapper::getErrorMessage (  ) 

Definition at line 387 of file llpngwrapper.cpp.

References mErrorMessage.

Referenced by LLImagePNG::decode(), LLImagePNG::encode(), and LLImagePNG::updateData().

U32 LLPngWrapper::getFinalSize (  ) 

Definition at line 381 of file llpngwrapper.cpp.

References mFinalSize.

Referenced by LLImagePNG::encode().

BOOL LLPngWrapper::isValidPng ( U8 src  ) 

Definition at line 65 of file llpngwrapper.cpp.

References FALSE, mErrorMessage, and TRUE.

void LLPngWrapper::normalizeImage (  )  [protected]

Definition at line 198 of file llpngwrapper.cpp.

References mBackgroundColor, mBitDepth, mColorType, mGamma, mHasBKGD, mReadInfoPtr, and mReadPngPtr.

Referenced by readPng().

void LLPngWrapper::readDataCallback ( png_structp  png_ptr,
png_bytep  dest,
png_size_t  length 
) [static, private]

Definition at line 89 of file llpngwrapper.cpp.

References LLPngWrapper::PngDataInfo::mData, and LLPngWrapper::PngDataInfo::mOffset.

Referenced by readPng().

BOOL LLPngWrapper::readPng ( U8 src,
LLImageRaw rawImage,
ImageInfo infop = NULL 
)

Definition at line 119 of file llpngwrapper.cpp.

References errorHandler(), FALSE, LLImageBase::getData(), i, mBitDepth, mChannels, mColorType, LLPngWrapper::ImageInfo::mComponents, mCompressionType, LLPngWrapper::PngDataInfo::mData, mErrorMessage, mFilterMethod, mFinalSize, LLPngWrapper::ImageInfo::mHeight, mHeight, mInterlaceType, LLPngWrapper::PngDataInfo::mOffset, mReadInfoPtr, mReadPngPtr, mRowPointers, LLPngWrapper::ImageInfo::mWidth, mWidth, normalizeImage(), NULL, readDataCallback(), releaseResources(), LLImageRaw::resize(), TRUE, and updateMetaData().

Referenced by LLImagePNG::decode(), and LLImagePNG::updateData().

void LLPngWrapper::releaseResources (  )  [private]

Definition at line 357 of file llpngwrapper.cpp.

References mReadInfoPtr, mReadPngPtr, mRowPointers, mWriteInfoPtr, mWritePngPtr, and NULL.

Referenced by readPng(), writePng(), and ~LLPngWrapper().

void LLPngWrapper::updateMetaData (  )  [protected]

Definition at line 256 of file llpngwrapper.cpp.

References mBackgroundColor, mBitDepth, mChannels, mColorType, mHasBKGD, mHeight, mReadInfoPtr, mReadPngPtr, and mWidth.

Referenced by readPng().

void LLPngWrapper::writeDataCallback ( png_structp  png_ptr,
png_bytep  src,
png_size_t  length 
) [static, private]

Definition at line 99 of file llpngwrapper.cpp.

References LLPngWrapper::PngDataInfo::mData, and LLPngWrapper::PngDataInfo::mOffset.

Referenced by writePng().

void LLPngWrapper::writeFlush ( png_structp  png_ptr  )  [static, private]

Definition at line 108 of file llpngwrapper.cpp.

Referenced by writePng().

BOOL LLPngWrapper::writePng ( const LLImageRaw rawImage,
U8 dst 
)

Definition at line 269 of file llpngwrapper.cpp.

References errorHandler(), FALSE, LLImageBase::getComponents(), LLImageBase::getData(), LLImageBase::getHeight(), LLImageBase::getWidth(), i, mBitDepth, mChannels, mColorType, mCompressionType, LLPngWrapper::PngDataInfo::mData, mErrorMessage, mFilterMethod, mFinalSize, mHeight, mInterlaceType, LLPngWrapper::PngDataInfo::mOffset, mWidth, mWriteInfoPtr, mWritePngPtr, NULL, releaseResources(), TRUE, writeDataCallback(), and writeFlush().

Referenced by LLImagePNG::encode().


Member Data Documentation

png_color_16p LLPngWrapper::mBackgroundColor [private]

Definition at line 97 of file llpngwrapper.h.

Referenced by normalizeImage(), and updateMetaData().

S32 LLPngWrapper::mBitDepth [private]

Definition at line 87 of file llpngwrapper.h.

Referenced by normalizeImage(), readPng(), updateMetaData(), and writePng().

S32 LLPngWrapper::mChannels [private]

Definition at line 89 of file llpngwrapper.h.

Referenced by readPng(), updateMetaData(), and writePng().

S32 LLPngWrapper::mColorType [private]

Definition at line 88 of file llpngwrapper.h.

Referenced by normalizeImage(), readPng(), updateMetaData(), and writePng().

S32 LLPngWrapper::mCompressionType [private]

Definition at line 91 of file llpngwrapper.h.

Referenced by readPng(), and writePng().

LLString LLPngWrapper::mErrorMessage [private]

Definition at line 101 of file llpngwrapper.h.

Referenced by getErrorMessage(), isValidPng(), readPng(), and writePng().

S32 LLPngWrapper::mFilterMethod [private]

Definition at line 92 of file llpngwrapper.h.

Referenced by readPng(), and writePng().

U32 LLPngWrapper::mFinalSize [private]

Definition at line 94 of file llpngwrapper.h.

Referenced by getFinalSize(), readPng(), and writePng().

F64 LLPngWrapper::mGamma [private]

Definition at line 99 of file llpngwrapper.h.

Referenced by normalizeImage().

BOOL LLPngWrapper::mHasBKGD [private]

Definition at line 96 of file llpngwrapper.h.

Referenced by normalizeImage(), and updateMetaData().

png_uint_32 LLPngWrapper::mHeight [private]

Definition at line 86 of file llpngwrapper.h.

Referenced by readPng(), updateMetaData(), and writePng().

S32 LLPngWrapper::mInterlaceType [private]

Definition at line 90 of file llpngwrapper.h.

Referenced by readPng(), and writePng().

png_infop LLPngWrapper::mReadInfoPtr [private]

Definition at line 79 of file llpngwrapper.h.

Referenced by normalizeImage(), readPng(), releaseResources(), and updateMetaData().

png_structp LLPngWrapper::mReadPngPtr [private]

Definition at line 78 of file llpngwrapper.h.

Referenced by normalizeImage(), readPng(), releaseResources(), and updateMetaData().

U8** LLPngWrapper::mRowPointers [private]

Definition at line 83 of file llpngwrapper.h.

Referenced by readPng(), and releaseResources().

png_uint_32 LLPngWrapper::mWidth [private]

Definition at line 85 of file llpngwrapper.h.

Referenced by readPng(), updateMetaData(), and writePng().

png_infop LLPngWrapper::mWriteInfoPtr [private]

Definition at line 81 of file llpngwrapper.h.

Referenced by releaseResources(), and writePng().

png_structp LLPngWrapper::mWritePngPtr [private]

Definition at line 80 of file llpngwrapper.h.

Referenced by releaseResources(), and writePng().


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