From 71b593e88b1e601db84cd3c399865a0bfd8164cf Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Jul 2016 16:49:02 -0400 Subject: MAINT-6584: Streamline static LLImageJ2C implementation API. Specifically, remove unused function pointer types CreateLLImageJ2CFunction, DestroyLLImageJ2CFunction and EngineInfoLLImageJ2CFunction. Also eliminate static fallbackDestroyLLImageJ2CImpl() and fallbackEngineInfoLLImageJ2CImpl(), leaving only static fallbackCreateLLImageJ2CImpl(). We do need a factory function to instantiate the appropriate LLImageJ2CImpl subclass, so leave the fallbackCreateLLImageJ2CImpl() link seam in place. However, given that every known LLImageJ2CImpl subclass is cheap to instantiate, make getEngineInfo() a pure virtual method on that subclass: the static LLImageJ2C::getEngineInfo() method can temporarily construct an instance to query. While we're at it, make getEngineInfo() return std::string like LLImageJ2C::getEngineInfo(). It's ridiculous that fallbackEngineInfoLLImageJ2CImpl() implementations constructed a static std::string and returned its c_str(), only to have LLImageJ2C::getEngineInfo() construct ANOTHER std::string from the returned const char*. fallbackDestroyLLImageJ2CImpl() never did anything useful: it merely deleted the passed LLImageJ2CImpl subclass pointer as the specific subclass type. But since LLImageJ2CImpl's destructor is virtual, LLImageJ2C's destructor could simply delete the stored LLImageJ2CImpl*. In fact, make mImpl a boost::scoped_ptr so we don't even have to delete it manually. --- indra/llimagej2coj/llimagej2coj.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/llimagej2coj/llimagej2coj.h') diff --git a/indra/llimagej2coj/llimagej2coj.h b/indra/llimagej2coj/llimagej2coj.h index 40ad4edb00..ae96a175a2 100644 --- a/indra/llimagej2coj/llimagej2coj.h +++ b/indra/llimagej2coj/llimagej2coj.h @@ -35,12 +35,13 @@ public: LLImageJ2COJ(); virtual ~LLImageJ2COJ(); protected: - /*virtual*/ BOOL getMetadata(LLImageJ2C &base); - /*virtual*/ BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); - /*virtual*/ BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, + virtual BOOL getMetadata(LLImageJ2C &base); + virtual BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); + virtual BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, BOOL reversible = FALSE); - /*virtual*/ BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); - /*virtual*/ BOOL initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); + virtual BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); + virtual BOOL initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); + virtual std::string getEngineInfo() const; }; #endif -- cgit v1.2.3 From acdb050ce5e672a6e5c83ef6e95257ce68934d1b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 22 Jul 2016 11:35:23 -0400 Subject: MAINT-6584: Convert LLImage class hierarchy to standard 'bool' instead of legacy BOOL. --- indra/llimagej2coj/llimagej2coj.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llimagej2coj/llimagej2coj.h') diff --git a/indra/llimagej2coj/llimagej2coj.h b/indra/llimagej2coj/llimagej2coj.h index ae96a175a2..5c6193944e 100644 --- a/indra/llimagej2coj/llimagej2coj.h +++ b/indra/llimagej2coj/llimagej2coj.h @@ -35,12 +35,12 @@ public: LLImageJ2COJ(); virtual ~LLImageJ2COJ(); protected: - virtual BOOL getMetadata(LLImageJ2C &base); - virtual BOOL decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); - virtual BOOL encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, - BOOL reversible = FALSE); - virtual BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); - virtual BOOL initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); + virtual bool getMetadata(LLImageJ2C &base); + virtual bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count); + virtual bool encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, + bool reversible = false); + virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); + virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); virtual std::string getEngineInfo() const; }; -- cgit v1.2.3