This commit is contained in:
Aleric Inglewood
2011-05-05 15:54:21 +02:00
23 changed files with 132 additions and 299 deletions

View File

@@ -34,6 +34,7 @@
#include "apr_dso.h"
#include "lldir.h"
#include "../llxml/llcontrol.h"
#include "llimagej2c.h"
#include "llmemtype.h"
@@ -377,6 +378,12 @@ S32 LLImageJ2C::calcHeaderSize()
// to load discard_level (including header and higher discard levels)
S32 LLImageJ2C::calcDataSize(S32 discard_level)
{
static const LLCachedControl<bool> legacy_size("SianaLegacyJ2CSize", false);
if (legacy_size) {
return calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate);
}
discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL);
if ( mAreaUsedForDataSizeCalcs != (getHeight() * getWidth())

View File

@@ -35,6 +35,8 @@
#include <csetjmp>
#include "llimage.h"
extern "C" {
#ifdef LL_STANDALONE
# include <jpeglib.h>
@@ -45,8 +47,6 @@ extern "C" {
#endif
}
#include "llimage.h"
class LLImageJPEG : public LLImageFormatted
{
protected:

View File

@@ -213,7 +213,7 @@ void LLPngWrapper::normalizeImage()
}
if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8)
{
png_set_gray_1_2_4_to_8(mReadPngPtr);
png_set_expand_gray_1_2_4_to_8(mReadPngPtr);
}
if (mColorType == PNG_COLOR_TYPE_GRAY
|| mColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
@@ -354,7 +354,7 @@ void LLPngWrapper::releaseResources()
{
if (mReadPngPtr || mReadInfoPtr)
{
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);
png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, NULL);
mReadPngPtr = NULL;
mReadInfoPtr = NULL;
}

View File

@@ -32,7 +32,11 @@
#ifndef LL_LLPNGWRAPPER_H
#define LL_LLPNGWRAPPER_H
#if LL_WINDOWS
#include "libpng15/png.h"
#else
#include "libpng12/png.h"
#endif
#include "llimage.h"
class LLPngWrapper