aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llimage/llimage.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llimage/llimage.h')
-rw-r--r--linden/indra/llimage/llimage.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/linden/indra/llimage/llimage.h b/linden/indra/llimage/llimage.h
index 98a98c2..321eda8 100644
--- a/linden/indra/llimage/llimage.h
+++ b/linden/indra/llimage/llimage.h
@@ -4,7 +4,7 @@
4 * 4 *
5 * $LicenseInfo:firstyear=2000&license=viewergpl$ 5 * $LicenseInfo:firstyear=2000&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2000-2008, Linden Research, Inc. 7 * Copyright (c) 2000-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
@@ -59,6 +59,7 @@ const S32 MAX_IMG_PACKET_SIZE = 1000;
59class LLImageFormatted; 59class LLImageFormatted;
60class LLImageRaw; 60class LLImageRaw;
61class LLColor4U; 61class LLColor4U;
62class LLWorkerThread;
62 63
63typedef enum e_image_codec 64typedef enum e_image_codec
64{ 65{
@@ -74,6 +75,24 @@ typedef enum e_image_codec
74} EImageCodec; 75} EImageCodec;
75 76
76//============================================================================ 77//============================================================================
78// library initialization class
79
80class LLImage
81{
82public:
83 static void initClass(LLWorkerThread* workerthread);
84 static void cleanupClass();
85
86 static const std::string& getLastError();
87 static void setLastError(const std::string& message);
88
89protected:
90 static LLMutex* sMutex;
91 static std::string sLastErrorMessage;
92};
93
94//============================================================================
95// Image base class
77 96
78class LLImageBase : public LLThreadSafeRefCount 97class LLImageBase : public LLThreadSafeRefCount
79{ 98{
@@ -113,10 +132,6 @@ protected:
113 void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }; 132 void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; };
114 133
115public: 134public:
116 static const std::string& getLastError() {return sLastErrorMessage;};
117 static void resetLastError() {sLastErrorMessage = "No Error"; };
118 static BOOL setLastError(const std::string& message, const std::string& filename = std::string()); // returns FALSE
119
120 static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels); 135 static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels);
121 136
122 // Function for calculating the download priority for textures 137 // Function for calculating the download priority for textures
@@ -141,8 +156,6 @@ private:
141public: 156public:
142 S16 mMemType; // debug 157 S16 mMemType; // debug
143 158
144 static std::string sLastErrorMessage;
145
146 static BOOL sSizeOverride; 159 static BOOL sSizeOverride;
147}; 160};
148 161
@@ -245,7 +258,6 @@ public:
245 LLImageFormatted(S8 codec); 258 LLImageFormatted(S8 codec);
246 259
247 // LLImageBase 260 // LLImageBase
248public:
249 /*virtual*/ void deleteData(); 261 /*virtual*/ void deleteData();
250 /*virtual*/ U8* allocateData(S32 size = -1); 262 /*virtual*/ U8* allocateData(S32 size = -1);
251 /*virtual*/ U8* reallocateData(S32 size); 263 /*virtual*/ U8* reallocateData(S32 size);
@@ -254,7 +266,6 @@ public:
254 /*virtual*/ void sanityCheck(); 266 /*virtual*/ void sanityCheck();
255 267
256 // New methods 268 // New methods
257public:
258 // subclasses must return a prefered file extension (lowercase without a leading dot) 269 // subclasses must return a prefered file extension (lowercase without a leading dot)
259 virtual std::string getExtension() = 0; 270 virtual std::string getExtension() = 0;
260 // calcHeaderSize() returns the maximum size of header; 271 // calcHeaderSize() returns the maximum size of header;
@@ -287,6 +298,10 @@ public:
287 void setDiscardLevel(S8 discard_level) { mDiscardLevel = discard_level; } 298 void setDiscardLevel(S8 discard_level) { mDiscardLevel = discard_level; }
288 S8 getDiscardLevel() const { return mDiscardLevel; } 299 S8 getDiscardLevel() const { return mDiscardLevel; }
289 300
301 // setLastError needs to be deferred for J2C images since it may be called from a DLL
302 virtual void resetLastError();
303 virtual void setLastError(const std::string& message, const std::string& filename = std::string());
304
290protected: 305protected:
291 BOOL copyData(U8 *data, S32 size); // calls updateData() 306 BOOL copyData(U8 *data, S32 size); // calls updateData()
292 307
@@ -295,7 +310,7 @@ protected:
295 S8 mDecoding; 310 S8 mDecoding;
296 S8 mDecoded; 311 S8 mDecoded;
297 S8 mDiscardLevel; 312 S8 mDiscardLevel;
298 313
299public: 314public:
300 static S32 sGlobalFormattedMemory; 315 static S32 sGlobalFormattedMemory;
301}; 316};