summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-07-18 17:50:25 +0000
committerJames Cook <james@lindenlab.com>2008-07-18 17:50:25 +0000
commited386ae547c225e352c39e8d14921572ee534b0b (patch)
treef67ff767edfc07900c0c8c16cd4439eb38d05be0 /indra/llimage
parent292627c09df6085c985a189edd5df06d3ca1eb47 (diff)
merge support-featurettes-snapshot-merge-2 for QAR-754, includes:
* featurettes-4 89061:89589 (which is all of featurettes-1, -2, and -3, and part of -4) * gteam-showstoppers-3 91950:91951 (which is all of gteam-showstoppers-1, -2, and -3) * featurettes-5 92149:92150 (patch for last line of chat text not visible in chat history, DEV-17771) * snapshot-3 91988:91991 (which is all of snapshot-1, -2, and -3) Merging revisions 92190-92387 of svn+ssh://svn.lindenlab.com/svn/linden/branches/support-featurettes-snapshot-merge-2 into release, respecting ancestry * QAR-590 Merge Lock Request for Support Sprint * QAR-627 Merge snapshot improvements * QAR-686 Merge Lock request for Featurettes
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimage.cpp12
-rw-r--r--indra/llimage/llimage.h2
-rw-r--r--indra/llimage/llimagebmp.cpp8
-rw-r--r--indra/llimage/llimagebmp.h1
-rw-r--r--indra/llimage/llimagedxt.h1
-rw-r--r--indra/llimage/llimagej2c.h1
-rw-r--r--indra/llimage/llimagejpeg.cpp6
-rw-r--r--indra/llimage/llimagejpeg.h3
-rw-r--r--indra/llimage/llimagepng.h7
-rw-r--r--indra/llimage/llimagetga.h1
10 files changed, 23 insertions, 19 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 1c8fb4234f..d7ae9611fc 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -40,9 +40,7 @@
#include "llimagebmp.h"
#include "llimagetga.h"
#include "llimagej2c.h"
-#if JPEG_SUPPORT
#include "llimagejpeg.h"
-#endif
#include "llimagepng.h"
#include "llimagedxt.h"
@@ -1192,11 +1190,9 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
case IMG_CODEC_TGA:
image = new LLImageTGA();
break;
-#if JPEG_SUPPORT
case IMG_CODEC_JPEG:
image = new LLImageJPEG();
break;
-#endif
case IMG_CODEC_J2C:
image = new LLImageJ2C();
break;
@@ -1280,20 +1276,18 @@ LLImageFormatted* LLImageFormatted::createFromType(S8 codec)
case IMG_CODEC_TGA:
image = new LLImageTGA();
break;
-#if JPEG_SUPPORT
case IMG_CODEC_JPEG:
image = new LLImageJPEG();
break;
-#endif
+ case IMG_CODEC_PNG:
+ image = new LLImagePNG();
+ break;
case IMG_CODEC_J2C:
image = new LLImageJ2C();
break;
case IMG_CODEC_DXT:
image = new LLImageDXT();
break;
- case IMG_CODEC_PNG:
- image = new LLImagePNG();
- break;
default:
image = NULL;
break;
diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h
index 98a86ad755..c4fd661976 100644
--- a/indra/llimage/llimage.h
+++ b/indra/llimage/llimage.h
@@ -255,6 +255,8 @@ public:
// New methods
public:
+ // subclasses must return a prefered file extension (lowercase without a leading dot)
+ virtual std::string getExtension() = 0;
// calcHeaderSize() returns the maximum size of header;
// 0 indicates we don't know have a header and have to lead the entire file
virtual S32 calcHeaderSize() { return 0; };
diff --git a/indra/llimage/llimagebmp.cpp b/indra/llimage/llimagebmp.cpp
index f8423000a8..b6b1d695d1 100644
--- a/indra/llimage/llimagebmp.cpp
+++ b/indra/llimage/llimagebmp.cpp
@@ -644,10 +644,10 @@ BOOL LLImageBMP::encode(const LLImageRaw* raw_image, F32 encode_time)
break;
}
- for( S32 i = 0; i < alignment_bytes; i++ )
- {
- *dst++ = 0;
- }
+ }
+ for( S32 i = 0; i < alignment_bytes; i++ )
+ {
+ *dst++ = 0;
}
}
diff --git a/indra/llimage/llimagebmp.h b/indra/llimage/llimagebmp.h
index 00d3e957e4..6ad1fac4ae 100644
--- a/indra/llimage/llimagebmp.h
+++ b/indra/llimage/llimagebmp.h
@@ -44,6 +44,7 @@ protected:
public:
LLImageBMP();
+ /*virtual*/ std::string getExtension() { return std::string("bmp"); }
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h
index b6df098456..c994a8578b 100644
--- a/indra/llimage/llimagedxt.h
+++ b/indra/llimage/llimagedxt.h
@@ -102,6 +102,7 @@ private:
public:
LLImageDXT();
+ /*virtual*/ std::string getExtension() { return std::string("dxt"); }
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h
index 8d01eceb54..03172d344f 100644
--- a/indra/llimage/llimagej2c.h
+++ b/indra/llimage/llimagej2c.h
@@ -45,6 +45,7 @@ public:
LLImageJ2C();
// Base class overrides
+ /*virtual*/ std::string getExtension() { return std::string("j2c"); }
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw *raw_imagep, F32 decode_time);
/*virtual*/ BOOL decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count);
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index aebe87d626..1bddd7a051 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -35,13 +35,15 @@
#include "llerror.h"
-LLImageJPEG::LLImageJPEG()
+LLImageJPEG::LLImageJPEG(S32 quality)
:
LLImageFormatted(IMG_CODEC_JPEG),
mOutputBuffer( NULL ),
mOutputBufferSize( 0 ),
- mEncodeQuality( 75 ) // on a scale from 1 to 100
+ mEncodeQuality( quality ) // on a scale from 1 to 100
{
+ // Including in initializer list above generates warning on VC2005
+ memset(mSetjmpBuffer, 0, sizeof(mSetjmpBuffer));
}
LLImageJPEG::~LLImageJPEG()
diff --git a/indra/llimage/llimagejpeg.h b/indra/llimage/llimagejpeg.h
index 054ddad9bc..36d3454d4b 100644
--- a/indra/llimage/llimagejpeg.h
+++ b/indra/llimage/llimagejpeg.h
@@ -52,8 +52,9 @@ protected:
virtual ~LLImageJPEG();
public:
- LLImageJPEG();
+ LLImageJPEG(S32 quality = 75);
+ /*virtual*/ std::string getExtension() { return std::string("jpg"); }
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
diff --git a/indra/llimage/llimagepng.h b/indra/llimage/llimagepng.h
index 027caf9780..38af80f2dd 100644
--- a/indra/llimage/llimagepng.h
+++ b/indra/llimage/llimagepng.h
@@ -42,9 +42,10 @@ protected:
public:
LLImagePNG();
- BOOL updateData();
- BOOL decode(LLImageRaw* raw_image, F32 decode_time);
- BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
+ /*virtual*/ std::string getExtension() { return std::string("png"); }
+ /*virtual*/ BOOL updateData();
+ /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
+ /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
private:
U8* mTmpWriteBuffer;
diff --git a/indra/llimage/llimagetga.h b/indra/llimage/llimagetga.h
index d1178ffb73..e8f9672778 100644
--- a/indra/llimage/llimagetga.h
+++ b/indra/llimage/llimagetga.h
@@ -45,6 +45,7 @@ public:
LLImageTGA();
LLImageTGA(const std::string& file_name);
+ /*virtual*/ std::string getExtension() { return std::string("tga"); }
/*virtual*/ BOOL updateData();
/*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time=0.0);
/*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time=0.0);