aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llimage/llimage.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llimage/llimage.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llimage/llimage.h')
-rw-r--r--linden/indra/llimage/llimage.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/linden/indra/llimage/llimage.h b/linden/indra/llimage/llimage.h
index 0d97595..98a98c2 100644
--- a/linden/indra/llimage/llimage.h
+++ b/linden/indra/llimage/llimage.h
@@ -113,9 +113,9 @@ protected:
113 void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; }; 113 void setDataAndSize(U8 *data, S32 size) { mData = data; mDataSize = size; };
114 114
115public: 115public:
116 static const LLString& getLastError() {return sLastErrorMessage;}; 116 static const std::string& getLastError() {return sLastErrorMessage;};
117 static void resetLastError() {sLastErrorMessage = LLString("No Error"); }; 117 static void resetLastError() {sLastErrorMessage = "No Error"; };
118 static BOOL setLastError(const LLString& message, const LLString& filename = LLString()); // returns FALSE 118 static BOOL setLastError(const std::string& message, const std::string& filename = std::string()); // returns FALSE
119 119
120 static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels); 120 static void generateMip(const U8 *indata, U8* mipdata, int width, int height, S32 nchannels);
121 121
@@ -125,7 +125,7 @@ public:
125 125
126 static void setSizeOverride(BOOL enabled) { sSizeOverride = enabled; } 126 static void setSizeOverride(BOOL enabled) { sSizeOverride = enabled; }
127 127
128 static EImageCodec getCodecFromExtension(const LLString& exten); 128 static EImageCodec getCodecFromExtension(const std::string& exten);
129 129
130private: 130private:
131 U8 *mData; 131 U8 *mData;
@@ -141,7 +141,7 @@ private:
141public: 141public:
142 S16 mMemType; // debug 142 S16 mMemType; // debug
143 143
144 static LLString sLastErrorMessage; 144 static std::string sLastErrorMessage;
145 145
146 static BOOL sSizeOverride; 146 static BOOL sSizeOverride;
147}; 147};
@@ -157,7 +157,7 @@ public:
157 LLImageRaw(U16 width, U16 height, S8 components); 157 LLImageRaw(U16 width, U16 height, S8 components);
158 LLImageRaw(U8 *data, U16 width, U16 height, S8 components); 158 LLImageRaw(U8 *data, U16 width, U16 height, S8 components);
159 // Construct using createFromFile (used by tools) 159 // Construct using createFromFile (used by tools)
160 LLImageRaw(const LLString& filename, bool j2c_lowest_mip_only = false); 160 LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false);
161 161
162 /*virtual*/ void deleteData(); 162 /*virtual*/ void deleteData();
163 /*virtual*/ U8* allocateData(S32 size = -1); 163 /*virtual*/ U8* allocateData(S32 size = -1);
@@ -218,7 +218,7 @@ public:
218 218
219protected: 219protected:
220 // Create an image from a local file (generally used in tools) 220 // Create an image from a local file (generally used in tools)
221 bool createFromFile(const LLString& filename, bool j2c_lowest_mip_only = false); 221 bool createFromFile(const std::string& filename, bool j2c_lowest_mip_only = false);
222 222
223 void copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step ); 223 void copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len, S32 in_pixel_step, S32 out_pixel_step );
224 void compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len ); 224 void compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S32 out_pixel_len );
@@ -236,7 +236,7 @@ class LLImageFormatted : public LLImageBase
236{ 236{
237public: 237public:
238 static LLImageFormatted* createFromType(S8 codec); 238 static LLImageFormatted* createFromType(S8 codec);
239 static LLImageFormatted* createFromExtension(const LLString& instring); 239 static LLImageFormatted* createFromExtension(const std::string& instring);
240 240
241protected: 241protected:
242 /*virtual*/ ~LLImageFormatted(); 242 /*virtual*/ ~LLImageFormatted();
@@ -255,6 +255,8 @@ public:
255 255
256 // New methods 256 // New methods
257public: 257public:
258 // subclasses must return a prefered file extension (lowercase without a leading dot)
259 virtual std::string getExtension() = 0;
258 // calcHeaderSize() returns the maximum size of header; 260 // calcHeaderSize() returns the maximum size of header;
259 // 0 indicates we don't know have a header and have to lead the entire file 261 // 0 indicates we don't know have a header and have to lead the entire file
260 virtual S32 calcHeaderSize() { return 0; }; 262 virtual S32 calcHeaderSize() { return 0; };
@@ -265,8 +267,8 @@ public:
265 // getRawDiscardLevel()by default returns mDiscardLevel, but may be overridden (LLImageJ2C) 267 // getRawDiscardLevel()by default returns mDiscardLevel, but may be overridden (LLImageJ2C)
266 virtual S8 getRawDiscardLevel() { return mDiscardLevel; } 268 virtual S8 getRawDiscardLevel() { return mDiscardLevel; }
267 269
268 BOOL load(const LLString& filename); 270 BOOL load(const std::string& filename);
269 BOOL save(const LLString& filename); 271 BOOL save(const std::string& filename);
270 272
271 virtual BOOL updateData() = 0; // pure virtual 273 virtual BOOL updateData() = 0; // pure virtual
272 void setData(U8 *data, S32 size); 274 void setData(U8 *data, S32 size);