aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llimage
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:37 -0500
committerJacek Antonelli2008-08-15 23:45:37 -0500
commit31ba05810c641f14e8ab5da8ad2aaf527779f6c1 (patch)
treec4b8d635dfb657fa4cfee7c285f8cadbf24afa90 /linden/indra/llimage
parentSecond Life viewer sources 1.19.1.1 (diff)
downloadmeta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.zip
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.gz
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.bz2
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.xz
Second Life viewer sources 1.19.1.2
Diffstat (limited to 'linden/indra/llimage')
-rw-r--r--linden/indra/llimage/llimage.cpp7
-rw-r--r--linden/indra/llimage/llimage.h6
-rw-r--r--linden/indra/llimage/llimagebmp.h4
-rw-r--r--linden/indra/llimage/llimagedxt.cpp4
-rw-r--r--linden/indra/llimage/llimagedxt.h8
-rw-r--r--linden/indra/llimage/llimagej2c.cpp4
-rw-r--r--linden/indra/llimage/llimagej2c.h6
-rw-r--r--linden/indra/llimage/llimagejpeg.h4
-rw-r--r--linden/indra/llimage/llimagepng.h4
-rw-r--r--linden/indra/llimage/llimageworker.cpp2
10 files changed, 27 insertions, 22 deletions
diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp
index b9bf26a..15da71a 100644
--- a/linden/indra/llimage/llimage.cpp
+++ b/linden/indra/llimage/llimage.cpp
@@ -144,7 +144,10 @@ U8* LLImageBase::allocateData(S32 size)
144 mData = new U8[size]; 144 mData = new U8[size];
145 if (!mData) 145 if (!mData)
146 { 146 {
147 llerrs << "allocate image data: " << size << llendl; 147 //llerrs << "allocate image data: " << size << llendl;
148 llwarns << "allocate image data: " << size << llendl;
149 size = 0 ;
150 mWidth = mHeight = 0 ;
148 } 151 }
149 mDataSize = size; 152 mDataSize = size;
150 } 153 }
@@ -1340,7 +1343,7 @@ S32 LLImageFormatted::calcDiscardLevelBytes(S32 bytes)
1340//---------------------------------------------------------------------------- 1343//----------------------------------------------------------------------------
1341 1344
1342// Subclasses that can handle more than 4 channels should override this function. 1345// Subclasses that can handle more than 4 channels should override this function.
1343BOOL LLImageFormatted::decode(LLImageRaw* raw_image,F32 decode_time, S32 first_channel, S32 max_channel) 1346BOOL LLImageFormatted::decodeChannels(LLImageRaw* raw_image,F32 decode_time, S32 first_channel, S32 max_channel)
1344{ 1347{
1345 llassert( (first_channel == 0) && (max_channel == 4) ); 1348 llassert( (first_channel == 0) && (max_channel == 4) );
1346 return decode( raw_image, decode_time ); // Loads first 4 channels by default. 1349 return decode( raw_image, decode_time ); // Loads first 4 channels by default.
diff --git a/linden/indra/llimage/llimage.h b/linden/indra/llimage/llimage.h
index ef736ec..8546303 100644
--- a/linden/indra/llimage/llimage.h
+++ b/linden/indra/llimage/llimage.h
@@ -268,11 +268,11 @@ public:
268 void appendData(U8 *data, S32 size); 268 void appendData(U8 *data, S32 size);
269 269
270 // Loads first 4 channels. 270 // Loads first 4 channels.
271 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time=0.0) = 0; 271 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time) = 0;
272 // Subclasses that can handle more than 4 channels should override this function. 272 // Subclasses that can handle more than 4 channels should override this function.
273 virtual BOOL decode(LLImageRaw* raw_image, F32 decode_time, S32 first_channel, S32 max_channel); 273 virtual BOOL decodeChannels(LLImageRaw* raw_image, F32 decode_time, S32 first_channel, S32 max_channel);
274 274
275 virtual BOOL encode(const LLImageRaw* raw_image, F32 encode_time=0.0) = 0; 275 virtual BOOL encode(const LLImageRaw* raw_image, F32 encode_time) = 0;
276 276
277 S8 getCodec() const; 277 S8 getCodec() const;
278 BOOL isDecoding() const { return mDecoding ? TRUE : FALSE; } 278 BOOL isDecoding() const { return mDecoding ? TRUE : FALSE; }
diff --git a/linden/indra/llimage/llimagebmp.h b/linden/indra/llimage/llimagebmp.h
index 8c83bc5..2b25c43 100644
--- a/linden/indra/llimage/llimagebmp.h
+++ b/linden/indra/llimage/llimagebmp.h
@@ -45,8 +45,8 @@ public:
45 LLImageBMP(); 45 LLImageBMP();
46 46
47 /*virtual*/ BOOL updateData(); 47 /*virtual*/ BOOL updateData();
48 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 time=0.0); 48 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
49 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 time=0.0); 49 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
50 50
51protected: 51protected:
52 BOOL decodeColorTable8( U8* dst, U8* src ); 52 BOOL decodeColorTable8( U8* dst, U8* src );
diff --git a/linden/indra/llimage/llimagedxt.cpp b/linden/indra/llimage/llimagedxt.cpp
index 722ac9b..d3b8225 100644
--- a/linden/indra/llimage/llimagedxt.cpp
+++ b/linden/indra/llimage/llimagedxt.cpp
@@ -308,7 +308,7 @@ BOOL LLImageDXT::getMipData(LLPointer<LLImageRaw>& raw, S32 discard)
308 return TRUE; 308 return TRUE;
309} 309}
310 310
311BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips) 311BOOL LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_mips)
312{ 312{
313 llassert_always(raw_image); 313 llassert_always(raw_image);
314 314
@@ -396,7 +396,7 @@ BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time, bool explicit_mip
396// virtual 396// virtual
397BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time) 397BOOL LLImageDXT::encode(const LLImageRaw* raw_image, F32 time)
398{ 398{
399 return encode(raw_image, time, false); 399 return encodeDXT(raw_image, time, false);
400} 400}
401 401
402// virtual 402// virtual
diff --git a/linden/indra/llimage/llimagedxt.h b/linden/indra/llimage/llimagedxt.h
index c795d4e..f144c21 100644
--- a/linden/indra/llimage/llimagedxt.h
+++ b/linden/indra/llimage/llimagedxt.h
@@ -95,15 +95,17 @@ public:
95 95
96protected: 96protected:
97 /*virtual*/ ~LLImageDXT(); 97 /*virtual*/ ~LLImageDXT();
98
99private:
100 BOOL encodeDXT(const LLImageRaw* raw_image, F32 decode_time, bool explicit_mips);
98 101
99public: 102public:
100 LLImageDXT(); 103 LLImageDXT();
101 104
102 /*virtual*/ BOOL updateData(); 105 /*virtual*/ BOOL updateData();
103 106
104 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 time=0.0); 107 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
105 BOOL encode(const LLImageRaw* raw_image, F32 time, bool explicit_mips); 108 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
106 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 time=0.0);
107 109
108 /*virtual*/ S32 calcHeaderSize(); 110 /*virtual*/ S32 calcHeaderSize();
109 /*virtual*/ S32 calcDataSize(S32 discard_level = 0); 111 /*virtual*/ S32 calcDataSize(S32 discard_level = 0);
diff --git a/linden/indra/llimage/llimagej2c.cpp b/linden/indra/llimage/llimagej2c.cpp
index 0011296..9de4d5f 100644
--- a/linden/indra/llimage/llimagej2c.cpp
+++ b/linden/indra/llimage/llimagej2c.cpp
@@ -250,11 +250,11 @@ BOOL LLImageJ2C::updateData()
250 250
251BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time) 251BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time)
252{ 252{
253 return decode(raw_imagep, decode_time, 0, 4); 253 return decodeChannels(raw_imagep, decode_time, 0, 4);
254} 254}
255 255
256 256
257BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count ) 257BOOL LLImageJ2C::decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count )
258{ 258{
259 LLMemType mt1((LLMemType::EMemType)mMemType); 259 LLMemType mt1((LLMemType::EMemType)mMemType);
260 260
diff --git a/linden/indra/llimage/llimagej2c.h b/linden/indra/llimage/llimagej2c.h
index da844a1..7e02c98 100644
--- a/linden/indra/llimage/llimagej2c.h
+++ b/linden/indra/llimage/llimagej2c.h
@@ -46,9 +46,9 @@ public:
46 46
47 // Base class overrides 47 // Base class overrides
48 /*virtual*/ BOOL updateData(); 48 /*virtual*/ BOOL updateData();
49 /*virtual*/ BOOL decode(LLImageRaw *raw_imagep, F32 decode_time=0.0); 49 /*virtual*/ BOOL decode(LLImageRaw *raw_imagep, F32 decode_time);
50 /*virtual*/ BOOL decode(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count); 50 /*virtual*/ BOOL decodeChannels(LLImageRaw *raw_imagep, F32 decode_time, S32 first_channel, S32 max_channel_count);
51 /*virtual*/ BOOL encode(const LLImageRaw *raw_imagep, F32 encode_time=0.0); 51 /*virtual*/ BOOL encode(const LLImageRaw *raw_imagep, F32 encode_time);
52 /*virtual*/ S32 calcHeaderSize(); 52 /*virtual*/ S32 calcHeaderSize();
53 /*virtual*/ S32 calcDataSize(S32 discard_level = 0); 53 /*virtual*/ S32 calcDataSize(S32 discard_level = 0);
54 /*virtual*/ S32 calcDiscardLevelBytes(S32 bytes); 54 /*virtual*/ S32 calcDiscardLevelBytes(S32 bytes);
diff --git a/linden/indra/llimage/llimagejpeg.h b/linden/indra/llimage/llimagejpeg.h
index b143c47..a890bf4 100644
--- a/linden/indra/llimage/llimagejpeg.h
+++ b/linden/indra/llimage/llimagejpeg.h
@@ -55,8 +55,8 @@ public:
55 LLImageJPEG(); 55 LLImageJPEG();
56 56
57 /*virtual*/ BOOL updateData(); 57 /*virtual*/ BOOL updateData();
58 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 time=0.0); 58 /*virtual*/ BOOL decode(LLImageRaw* raw_image, F32 decode_time);
59 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 time=0.0); 59 /*virtual*/ BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
60 60
61 void setEncodeQuality( S32 q ) { mEncodeQuality = q; } // on a scale from 1 to 100 61 void setEncodeQuality( S32 q ) { mEncodeQuality = q; } // on a scale from 1 to 100
62 S32 getEncodeQuality() { return mEncodeQuality; } 62 S32 getEncodeQuality() { return mEncodeQuality; }
diff --git a/linden/indra/llimage/llimagepng.h b/linden/indra/llimage/llimagepng.h
index 982454a..7ca59cf 100644
--- a/linden/indra/llimage/llimagepng.h
+++ b/linden/indra/llimage/llimagepng.h
@@ -43,8 +43,8 @@ public:
43 LLImagePNG(); 43 LLImagePNG();
44 44
45 BOOL updateData(); 45 BOOL updateData();
46 BOOL decode(LLImageRaw* raw_image, F32 decode_time = 0.0); 46 BOOL decode(LLImageRaw* raw_image, F32 decode_time);
47 BOOL encode(const LLImageRaw* raw_image, F32 encode_time = 0.0); 47 BOOL encode(const LLImageRaw* raw_image, F32 encode_time);
48 48
49private: 49private:
50 U8* mTmpWriteBuffer; 50 U8* mTmpWriteBuffer;
diff --git a/linden/indra/llimage/llimageworker.cpp b/linden/indra/llimage/llimageworker.cpp
index 2800caf..dc6f2e4 100644
--- a/linden/indra/llimage/llimageworker.cpp
+++ b/linden/indra/llimage/llimageworker.cpp
@@ -115,7 +115,7 @@ bool LLImageWorker::doWork(S32 param)
115 else 115 else
116 { 116 {
117 // Decode aux channel 117 // Decode aux channel
118 decoded = mFormattedImage->decode(mDecodedImage, .1f, param, param); // 1ms 118 decoded = mFormattedImage->decodeChannels(mDecodedImage, .1f, param, param); // 1ms
119 } 119 }
120 } 120 }
121 if (decoded) 121 if (decoded)