#include <llimage.h>
Public Types | |
enum | { TYPE_NORMAL = 0, TYPE_AVATAR_BAKE = 1 } |
Public Member Functions | |
LLImageBase () | |
virtual void | deleteData () |
virtual U8 * | allocateData (S32 size=-1) |
virtual U8 * | reallocateData (S32 size=-1) |
virtual void | dump () |
virtual void | sanityCheck () |
U16 | getWidth () const |
U16 | getHeight () const |
S8 | getComponents () const |
S32 | getDataSize () const |
const U8 * | getData () const |
U8 * | getData () |
BOOL | isBufferInvalid () |
void | setSize (S32 width, S32 height, S32 ncomponents) |
U8 * | allocateDataSize (S32 width, S32 height, S32 ncomponents, S32 size=-1) |
Static Public Member Functions | |
static const LLString & | getLastError () |
static void | resetLastError () |
static BOOL | setLastError (const LLString &message, const LLString &filename=LLString()) |
static void | generateMip (const U8 *indata, U8 *mipdata, int width, int height, S32 nchannels) |
static F32 | calc_download_priority (F32 virtual_size, F32 visible_area, S32 bytes_sent) |
static void | setSizeOverride (BOOL enabled) |
static EImageCodec | getCodecFromExtension (const LLString &exten) |
Public Attributes | |
S16 | mMemType |
Static Public Attributes | |
static LLString | sLastErrorMessage |
static BOOL | sSizeOverride = FALSE |
Protected Member Functions | |
virtual | ~LLImageBase () |
void | setDataAndSize (U8 *data, S32 size) |
Private Attributes | |
U8 * | mData |
S32 | mDataSize |
U16 | mWidth |
U16 | mHeight |
S8 | mComponents |
BOOL | mBadBufferAllocation |
Definition at line 78 of file llimage.h.
LLImageBase::~LLImageBase | ( | ) | [protected, virtual] |
Definition at line 65 of file llimage.cpp.
References deleteData().
LLImageBase::LLImageBase | ( | ) |
void LLImageBase::deleteData | ( | ) | [virtual] |
Reimplemented in LLImageRaw, and LLImageFormatted.
Definition at line 116 of file llimage.cpp.
References mData, mDataSize, and NULL.
Referenced by allocateData(), LLImageFormatted::deleteData(), LLImageRaw::deleteData(), and ~LLImageBase().
Reimplemented in LLImageRaw, and LLImageFormatted.
Definition at line 124 of file llimage.cpp.
References deleteData(), FALSE, llendl, llerrs, llformat(), llwarns, mBadBufferAllocation, mComponents, mData, mDataSize, mHeight, mMemType, mWidth, resetLastError(), sSizeOverride, and TRUE.
Referenced by LLImageFormatted::allocateData(), LLImageRaw::allocateData(), and allocateDataSize().
Reimplemented in LLImageRaw, and LLImageFormatted.
Definition at line 163 of file llimage.cpp.
References llendl, llmin(), llwarns, mData, mDataSize, mMemType, and S32.
Referenced by LLImageFormatted::reallocateData(), and LLImageRaw::reallocateData().
void LLImageBase::dump | ( | ) | [virtual] |
Reimplemented in LLImageFormatted.
Definition at line 71 of file llimage.cpp.
References llendl, llinfos, mComponents, mData, mDataSize, mHeight, and mWidth.
Referenced by LLImageFormatted::dump().
void LLImageBase::sanityCheck | ( | ) | [virtual] |
Reimplemented in LLImageFormatted.
Definition at line 82 of file llimage.cpp.
References llendl, llerrs, MAX_IMAGE_COMPONENTS, MAX_IMAGE_DATA_SIZE, MAX_IMAGE_SIZE, mComponents, mData, mDataSize, mHeight, mWidth, and S32.
Referenced by LLImageFormatted::sanityCheck().
U16 LLImageBase::getWidth | ( | ) | const [inline] |
Definition at line 99 of file llimage.h.
References mWidth.
Referenced by LLImageRaw::biasedScaleToPowerOfTwo(), LLImageJ2C::calcDataSize(), LLImageDXT::calcDataSize(), LLImageFormatted::calcDataSize(), LLImageRaw::clear(), LLImageRaw::composite(), LLImageRaw::compositeScaled4onto3(), LLImageRaw::compositeUnscaled4onto3(), LLImageRaw::contractToPowerOfTwo(), LLImageDXT::convertToDXR(), LLImageRaw::copy(), LLImageRaw::copyScaled(), LLImageRaw::copyScaled3onto4(), LLImageRaw::copyScaled4onto3(), LLImageRaw::copyUnscaled(), LLImageRaw::copyUnscaled3onto4(), LLImageRaw::copyUnscaled4onto3(), LLImageGL::createGLTexture(), LLImageTGA::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageBMP::decode(), LLImageTGA::decodeAndProcess(), LLImageTGA::decodeColorMap(), LLImageBMP::decodeColorMask16(), LLImageBMP::decodeColorMask32(), LLImageBMP::decodeColorTable8(), LLImageTGA::decodeTruecolor(), LLImageBMP::decodeTruecolor24(), LLImageTGA::decodeTruecolorNonRle(), LLImageTGA::decodeTruecolorRle15(), LLImageTGA::decodeTruecolorRle24(), LLImageTGA::decodeTruecolorRle32(), LLImageTGA::decodeTruecolorRle8(), LLImageTGA::encode(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageDXT::encodeDXT(), LLImageJ2COJ::encodeImpl(), LLImageRaw::expandToPowerOfTwo(), LLImageRaw::fill(), LLImageDXT::getMipOffset(), LLImageRaw::getSubImage(), LLVOAvatar::onBakedTextureMasksLoaded(), LLBumpImageList::onSourceLoaded(), LLViewerWindow::rawSnapshot(), LLImageRaw::resize(), LLImageRaw::scale(), LLImageGL::setImage(), LLImagePreviewSculpted::setPreviewTarget(), LLImageGL::setSubImage(), LLImageRaw::setSubImage(), LLImageRaw::verticalFlip(), and LLPngWrapper::writePng().
U16 LLImageBase::getHeight | ( | ) | const [inline] |
Definition at line 100 of file llimage.h.
References mHeight.
Referenced by LLImageRaw::biasedScaleToPowerOfTwo(), LLImageJ2C::calcDataSize(), LLImageDXT::calcDataSize(), LLImageFormatted::calcDataSize(), LLImageRaw::clear(), LLImageRaw::composite(), LLImageRaw::compositeScaled4onto3(), LLImageRaw::compositeUnscaled4onto3(), LLImageRaw::contractToPowerOfTwo(), LLImageDXT::convertToDXR(), LLImageRaw::copy(), LLImageRaw::copyScaled(), LLImageRaw::copyScaled3onto4(), LLImageRaw::copyScaled4onto3(), LLImageRaw::copyUnscaled(), LLImageRaw::copyUnscaled3onto4(), LLImageRaw::copyUnscaled4onto3(), LLImageGL::createGLTexture(), LLImageTGA::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageBMP::decode(), LLImageTGA::decodeAndProcess(), LLImageTGA::decodeColorMap(), LLImageBMP::decodeColorMask16(), LLImageBMP::decodeColorMask32(), LLImageBMP::decodeColorTable8(), LLImageTGA::decodeTruecolor(), LLImageBMP::decodeTruecolor24(), LLImageTGA::decodeTruecolorNonRle(), LLImageTGA::decodeTruecolorRle15(), LLImageTGA::decodeTruecolorRle24(), LLImageTGA::decodeTruecolorRle32(), LLImageTGA::decodeTruecolorRle8(), LLImageTGA::encode(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageDXT::encodeDXT(), LLImageJ2COJ::encodeImpl(), LLImageRaw::expandToPowerOfTwo(), LLImageRaw::fill(), LLImageDXT::getMipOffset(), LLVOAvatar::onBakedTextureMasksLoaded(), LLBumpImageList::onSourceLoaded(), LLViewerWindow::rawSnapshot(), LLImageRaw::resize(), LLImageRaw::scale(), LLImageGL::setImage(), LLImagePreviewSculpted::setPreviewTarget(), LLImageGL::setSubImage(), LLImageRaw::verticalFlip(), and LLPngWrapper::writePng().
S8 LLImageBase::getComponents | ( | ) | const [inline] |
Definition at line 101 of file llimage.h.
References mComponents.
Referenced by LLImageJ2C::calcDataSize(), LLImageFormatted::calcDataSize(), LLImageRaw::clear(), LLImageRaw::composite(), LLImageRaw::compositeRowScaled4onto3(), LLImageRaw::compositeScaled4onto3(), LLImageRaw::compositeUnscaled4onto3(), LLImageRaw::copy(), LLImageRaw::copyLineScaled(), LLImageRaw::copyScaled(), LLImageRaw::copyScaled3onto4(), LLImageRaw::copyScaled4onto3(), LLImageRaw::copyUnscaled(), LLImageRaw::copyUnscaled3onto4(), LLImageRaw::copyUnscaled4onto3(), LLImageGL::createGLTexture(), LLImageTGA::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageTGA::decodeAndProcess(), LLImageTGA::decodeColorMap(), LLImageTGA::decodeTruecolor(), LLImageBMP::decodeTruecolor24(), LLImageTGA::decodeTruecolorNonRle(), LLImageTGA::decodeTruecolorRle15(), LLImageTGA::decodeTruecolorRle24(), LLImageTGA::decodeTruecolorRle32(), LLImageTGA::decodeTruecolorRle8(), LLImageTGA::encode(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageDXT::encodeDXT(), LLImageJ2COJ::encodeImpl(), LLImageRaw::fill(), LLImageDXT::getMipData(), LLImageRaw::getSubImage(), LLVOAvatar::onBakedTextureMasksLoaded(), LLBumpImageList::onSourceLoaded(), LLImageRaw::resize(), LLImageRaw::scale(), LLImageDXT::setFormat(), LLImageGL::setImage(), LLImagePreviewSculpted::setPreviewTarget(), LLImageRaw::setSubImage(), LLImageRaw::verticalFlip(), and LLPngWrapper::writePng().
S32 LLImageBase::getDataSize | ( | ) | const [inline] |
Definition at line 102 of file llimage.h.
References mDataSize.
Referenced by LLImageFormatted::allocateData(), LLImageRaw::allocateData(), LLImageFormatted::appendData(), LLImageDXT::convertToDXR(), LLImageFormatted::copyData(), LLImageTGA::decode(), LLImagePNG::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageBMP::decode(), LLImageTGA::decodeAndProcess(), LLImageJ2C::decodeChannels(), LLImageJ2COJ::decodeImpl(), LLImageTGA::decodeTruecolorRle15(), LLImageTGA::decodeTruecolorRle24(), LLImageTGA::decodeTruecolorRle32(), LLImageTGA::decodeTruecolorRle8(), LLImageFormatted::deleteData(), LLImageRaw::deleteData(), LLImageJ2COJ::getMetadata(), LLBumpImageList::onSourceLoaded(), LLImageFormatted::reallocateData(), LLImageRaw::reallocateData(), LLImageFormatted::save(), LLImageFormatted::setData(), LLImageTGA::updateData(), LLImagePNG::updateData(), LLImageJPEG::updateData(), LLImageJ2C::updateData(), LLImageDXT::updateData(), LLImageBMP::updateData(), and LLImageJ2C::validate().
const U8 * LLImageBase::getData | ( | ) | const |
Definition at line 183 of file llimage.cpp.
References llendl, llerrs, mBadBufferAllocation, and mData.
Referenced by LLImageFormatted::appendData(), LLImageRaw::clear(), LLImageRaw::compositeScaled4onto3(), LLImageRaw::compositeUnscaled4onto3(), LLImageDXT::convertToDXR(), LLImageFormatted::copyData(), LLImageRaw::copyScaled(), LLImageRaw::copyUnscaled(), LLImageRaw::copyUnscaled3onto4(), LLImageRaw::copyUnscaled4onto3(), LLImageGL::createGLTexture(), LLImageTGA::decode(), LLImagePNG::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageBMP::decode(), LLImageTGA::decodeAndProcess(), LLImageJ2C::decodeChannels(), LLImageTGA::decodeColorMap(), LLImageJ2COJ::decodeImpl(), LLImageTGA::decodeTruecolorNonRle(), LLImageTGA::decodeTruecolorRle15(), LLImageTGA::decodeTruecolorRle24(), LLImageTGA::decodeTruecolorRle32(), LLImageTGA::decodeTruecolorRle8(), LLImageTGA::encode(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageDXT::encodeDXT(), LLImageJ2COJ::encodeImpl(), LLImageRaw::fill(), LLImageJ2COJ::getMetadata(), LLImageDXT::getMipData(), LLImageRaw::getSubImage(), LLImageRaw::LLImageRaw(), LLVOAvatar::onBakedTextureMasksLoaded(), LLBumpImageList::onSourceLoaded(), LLViewerWindow::rawSnapshot(), LLImageGL::readBackRaw(), LLPngWrapper::readPng(), LLImageFormatted::save(), LLImageRaw::scale(), LLImageFormatted::setData(), LLImageGL::setImage(), LLImagePreviewSculpted::setPreviewTarget(), LLImageGL::setSubImage(), LLImageRaw::setSubImage(), LLViewerWindow::thumbnailSnapshot(), LLImageTGA::updateData(), LLImagePNG::updateData(), LLImageJPEG::updateData(), LLImageJ2C::updateData(), LLImageDXT::updateData(), LLImageBMP::updateData(), LLImageJ2C::validate(), LLImageRaw::verticalFlip(), and LLPngWrapper::writePng().
U8 * LLImageBase::getData | ( | ) |
Definition at line 193 of file llimage.cpp.
References llendl, llerrs, mBadBufferAllocation, and mData.
BOOL LLImageBase::isBufferInvalid | ( | ) |
Definition at line 203 of file llimage.cpp.
References mBadBufferAllocation, mData, and NULL.
Referenced by LLViewerWindow::rawSnapshot().
Definition at line 208 of file llimage.cpp.
References mComponents, mHeight, and mWidth.
Referenced by allocateDataSize(), LLImageJPEG::decode(), LLImageTGA::encode(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageDXT::encodeDXT(), LLImageJ2COJ::getMetadata(), LLImageTGA::updateData(), LLImagePNG::updateData(), LLImageJPEG::updateData(), LLImageDXT::updateData(), and LLImageBMP::updateData().
Definition at line 215 of file llimage.cpp.
References allocateData(), and setSize().
Referenced by LLImageRaw::LLImageRaw(), LLImageGL::readBackRaw(), LLImageRaw::resize(), and LLImageRaw::scale().
Definition at line 113 of file llimage.h.
References mData, and mDataSize.
Referenced by LLImageFormatted::setData().
static const LLString& LLImageBase::getLastError | ( | ) | [inline, static] |
Definition at line 116 of file llimage.h.
References sLastErrorMessage.
Referenced by handle_compress_image(), and upload_new_resource().
static void LLImageBase::resetLastError | ( | ) | [inline, static] |
Definition at line 117 of file llimage.h.
References sLastErrorMessage.
Referenced by allocateData(), LLImagePNG::decode(), LLImageJPEG::decode(), LLImageBMP::decode(), LLImageJ2C::decodeChannels(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageBMP::encode(), LLImageFormatted::load(), LLImageJ2C::loadAndValidate(), LLImageFormatted::save(), LLImageTGA::updateData(), LLImagePNG::updateData(), LLImageJPEG::updateData(), LLImageJ2C::updateData(), LLImageDXT::updateData(), and LLImageBMP::updateData().
BOOL LLImageBase::setLastError | ( | const LLString & | message, | |
const LLString & | filename = LLString() | |||
) | [static] |
Definition at line 103 of file llimage.cpp.
References FALSE, llendl, llwarns, and sLastErrorMessage.
Referenced by LLImageTGA::decode(), LLImagePNG::decode(), LLImageJPEG::decode(), LLImageDXT::decode(), LLImageBMP::decode(), LLImageTGA::decodeAndProcess(), LLImageJ2C::decodeChannels(), LLImagePNG::encode(), LLImageJPEG::encode(), LLImageFormatted::load(), LLImageJ2C::loadAndValidate(), LLImageFormatted::save(), LLImageTGA::updateData(), LLImagePNG::updateData(), LLImageJPEG::updateData(), LLImageJ2C::updateData(), LLImageDXT::updateData(), LLImageBMP::updateData(), and LLImageJ2C::validate().
static void LLImageBase::generateMip | ( | const U8 * | indata, | |
U8 * | mipdata, | |||
int | width, | |||
int | height, | |||
S32 | nchannels | |||
) | [static] |
Referenced by LLImageDXT::encodeDXT(), and LLImageGL::setImage().
F32 LLImageBase::calc_download_priority | ( | F32 | virtual_size, | |
F32 | visible_area, | |||
S32 | bytes_sent | |||
) | [static] |
Definition at line 1593 of file llimage.cpp.
static void LLImageBase::setSizeOverride | ( | BOOL | enabled | ) | [inline, static] |
Definition at line 126 of file llimage.h.
References sSizeOverride.
Referenced by LLFileTakeSnapshotToDisk::handleEvent(), and LLViewerWindow::saveImageNumbered().
EImageCodec LLImageBase::getCodecFromExtension | ( | const LLString & | exten | ) | [static] |
Definition at line 1128 of file llimage.cpp.
References file_extensions, i, IMG_CODEC_INVALID, and NUM_FILE_EXTENSIONS.
Referenced by LLImageFormatted::createFromExtension(), LLImageRaw::createFromFile(), and LLTextureCacheLocalFileWorker::doRead().
U8* LLImageBase::mData [private] |
Definition at line 131 of file llimage.h.
Referenced by allocateData(), deleteData(), dump(), getData(), isBufferInvalid(), reallocateData(), sanityCheck(), and setDataAndSize().
S32 LLImageBase::mDataSize [private] |
Definition at line 132 of file llimage.h.
Referenced by allocateData(), deleteData(), dump(), getDataSize(), reallocateData(), sanityCheck(), and setDataAndSize().
U16 LLImageBase::mWidth [private] |
Definition at line 134 of file llimage.h.
Referenced by allocateData(), dump(), getWidth(), sanityCheck(), and setSize().
U16 LLImageBase::mHeight [private] |
Definition at line 135 of file llimage.h.
Referenced by allocateData(), dump(), getHeight(), sanityCheck(), and setSize().
S8 LLImageBase::mComponents [private] |
Definition at line 137 of file llimage.h.
Referenced by allocateData(), dump(), getComponents(), sanityCheck(), and setSize().
BOOL LLImageBase::mBadBufferAllocation [private] |
Definition at line 139 of file llimage.h.
Referenced by allocateData(), getData(), isBufferInvalid(), and LLImageBase().
Definition at line 142 of file llimage.h.
Referenced by allocateData(), LLImageRaw::compositeScaled4onto3(), LLImageRaw::copyScaled(), LLImageJ2C::decodeChannels(), LLImageJ2C::encode(), LLImageRaw::getSubImage(), LLImageFormatted::LLImageFormatted(), LLImageRaw::LLImageRaw(), reallocateData(), LLImageRaw::scale(), LLImageJ2C::validate(), and LLImageRaw::verticalFlip().
LLString LLImageBase::sLastErrorMessage [static] |
Definition at line 144 of file llimage.h.
Referenced by getLastError(), resetLastError(), and setLastError().
BOOL LLImageBase::sSizeOverride = FALSE [static] |