diff options
author | Oz Linden <oz@lindenlab.com> | 2016-08-11 15:36:09 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-08-11 15:36:09 -0400 |
commit | 6ff420d705625fef4b0456c19bb9c766cabb31af (patch) | |
tree | 16c27571df04932dd830b35e06cdf4e9b5dbf07e /indra/llimage/llimagej2c.h | |
parent | c32b27f5b77c7d8e53b11163d04f2842949d71de (diff) | |
parent | 4fb100ac7a33174883184f1320d0beac08ead3a7 (diff) |
merge changes for 4.0.7-release
Diffstat (limited to 'indra/llimage/llimagej2c.h')
-rw-r--r-- | indra/llimage/llimagej2c.h | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index ce8195940d..e196f7479e 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -30,6 +30,7 @@ #include "llimage.h" #include "llassettype.h" #include "llmetricperformancetester.h" +#include <boost/scoped_ptr.hpp> // JPEG2000 : compression rate used in j2c conversion. const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f; @@ -47,10 +48,10 @@ public: // 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); - /*virtual*/ BOOL encode(const LLImageRaw *raw_imagep, F32 encode_time); + /*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); + /*virtual*/ bool encode(const LLImageRaw *raw_imagep, F32 encode_time); /*virtual*/ S32 calcHeaderSize(); /*virtual*/ S32 calcDataSize(S32 discard_level = 0); /*virtual*/ S32 calcDiscardLevelBytes(S32 bytes); @@ -59,17 +60,17 @@ 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); - BOOL initEncode(LLImageRaw &raw_image, int blocks_size, int precincts_size, int levels); + bool initDecode(LLImageRaw &raw_image, int discard_level, int* region); + bool initEncode(LLImageRaw &raw_image, int blocks_size, int precincts_size, int levels); // Encode with comment text - BOOL encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time=0.0); + bool encode(const LLImageRaw *raw_imagep, const char* comment_text, F32 encode_time=0.0); - BOOL validate(U8 *data, U32 file_size); - BOOL loadAndValidate(const std::string &filename); + bool validate(U8 *data, U32 file_size); + bool loadAndValidate(const std::string &filename); // Encode accessors - void setReversible(const BOOL reversible); // Use non-lossy? + void setReversible(const bool reversible); // Use non-lossy? void setMaxBytes(S32 max_bytes); S32 getMaxBytes() const { return mMaxBytes; } @@ -93,8 +94,8 @@ protected: S8 mRawDiscardLevel; F32 mRate; - BOOL mReversible; - LLImageJ2CImpl *mImpl; + bool mReversible; + boost::scoped_ptr<LLImageJ2CImpl> mImpl; std::string mLastError; // Image compression/decompression tester @@ -111,23 +112,25 @@ protected: // Return value: // true: image size and number of channels was determined // false: error on decode - virtual BOOL getMetadata(LLImageJ2C &base) = 0; + virtual bool getMetadata(LLImageJ2C &base) = 0; // Decode the raw image optionally aborting (to continue later) after // decode_time seconds. Decode at most max_channel_count and start // decoding channel first_channel. // Return value: // true: decoding complete (even if it failed) // false: time expired while decoding - 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; - virtual BOOL initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) = 0; + 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; + virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) = 0; + + virtual std::string getEngineInfo() const = 0; friend class LLImageJ2C; }; -#define LINDEN_J2C_COMMENT_PREFIX "LL_" +#define LINDEN_J2C_COMMENT_PREFIX "LL_" // Used by LLAppearanceUtility // // This class is used for performance data gathering only. |