summaryrefslogtreecommitdiff
path: root/indra/llimage
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-04-04 18:37:32 -0700
committerMerov Linden <merov@lindenlab.com>2011-04-04 18:37:32 -0700
commit83ec0cd62f70888c90671ea91cd056ecb6095bc1 (patch)
tree3bfd13782f0b056e61249f17a057d5bf7ee6f882 /indra/llimage
parentdc00f42dd7ff59143869e17010ed435db009ae12 (diff)
STORM-746 : add new arguments for precincts and blocks on output, region and level on input, add code for input loading restriction
Diffstat (limited to 'indra/llimage')
-rw-r--r--indra/llimage/llimagej2c.cpp7
-rw-r--r--indra/llimage/llimagej2c.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index 80fec7f8a0..6b49f3de88 100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -139,6 +139,10 @@ BOOL LLImageJ2C::updateData()
return res;
}
+BOOL LLImageJ2C::initDecode(LLImageRaw &raw_image, int discard_level, int* region)
+{
+ return mImpl->initDecode(*this,raw_image,discard_level,region);
+}
BOOL LLImageJ2C::decode(LLImageRaw *raw_imagep, F32 decode_time)
{
@@ -251,6 +255,9 @@ S32 LLImageJ2C::calcHeaderSizeJ2C()
//static
S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate)
{
+ // Note: this only provides an *estimate* of the size in bytes of an image level
+ // *TODO: find a way to read the true size (when available) and convey the fact
+ // that the result is an estimate in the other cases
if (rate <= 0.f) rate = .125f;
while (discard_level > 0)
{
diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h
index dd5bec8b2e..7af1c13921 100644
--- a/indra/llimage/llimagej2c.h
+++ b/indra/llimage/llimagej2c.h
@@ -56,6 +56,7 @@ public:
/*virtual*/ void resetLastError();
/*virtual*/ void setLastError(const std::string& message, const std::string& filename = std::string());
+ BOOL initDecode(LLImageRaw &raw_image, int discard_level, int* region);
// Encode with comment text
BOOL encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time=0.0);
@@ -117,6 +118,7 @@ protected:
virtual BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) = 0;
virtual BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
BOOL reversible=FALSE) = 0;
+ virtual BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL) = 0;
friend class LLImageJ2C;
};