Commit Graph

58 Commits (4da402dd239b0c8ef52df0233fdb884c8a621e9d)

Author SHA1 Message Date
Ansariel 4da402dd23 Merge viewer-bear 2016-08-21 12:39:18 +02:00
Ansariel cb89140d29 Merge LL release 4.0.7 2016-08-11 23:42:52 +02:00
Nat Goodspeed 2ce38c3c98 MAINT-6584: Comment out completely unused LLImageJ2CKDU code.
The only call to the findDiscardLevelsBoundaries() method was commented out
inside initDecode(), with a comment:
        // Merov : Test!! DO NOT COMMIT!!

This was the only caller of copy_tile(), which was the only caller of
copy_block(). Commented out all three of these (biggish!) functions, since I
have no idea what any of them were supposed to do or when it might be useful
to call them. In other words, I can't yet rule out the possibility that I
might have to uncomment them.
2016-08-04 16:20:39 -04:00
Nat Goodspeed 1773f44b6d MAINT-6584: Don't crash on inconsistent dims in a JPEG-2000 image.
Previous code would crump with LL_ERRS. But a bad image file should fail only
the image load -- not crash the viewer.

While at it, validate all components present, not just 0, 1, 2.

While at it, make the failure message report which component and what the
mismatched dimensions are, not just "Components don't have matching
dimensions!"
2016-08-06 11:39:11 -04:00
Nat Goodspeed 80adc9b6aa MAINT-6584: Introduce KDUError exception from other viewer project.
Specifically, manually apply changesets b4db8a8 and b98371d from
nat_linden/viewer-mac-mainloop. We need to throw from a new place, but if we
threw const char* (current convention), the new throw wouldn't be patched when
we merge to new exception convention.
2016-08-05 17:57:24 -04:00
Nat Goodspeed a5ce63eb3c MAINT-6584: Add explanatory comments to LLImageJ2CKDU implementation.
These comments are inherently fragile, in that they enumerate all present
callers of certain methods. Adding, removing or relocating calls would
invalidate these comments. However, the LLImageJ2CKDU implementation is
probably pretty stable by now.
2016-08-05 17:44:13 -04:00
Nat Goodspeed 65d608cdac MAINT-6584: Clarify LLKDUMessageError::flush() throwing exception. 2016-08-05 14:02:12 -04:00
AndreyL ProductEngine 2339e759fc MAINT-4327/MAINT-6584 Supress the crash on memory allocation error when decoding J2C images 2016-07-27 05:49:07 +03:00
Nat Goodspeed 03bff896bd MAINT-6584: Use RAII classes to manage helper object lifespans.
Use boost::scoped_ptr instead of raw pointers to LLKDUMemSource,
LLKDUDecodeState, kdu_coords and kdu_dims so cleanup is simpler, and automated
on destruction of LLImageJ2CKDU.

Replace pointer to kdu_codestream with a custom RAII class. kdu_codestream is
itself an opaque handle, so we don't need to add another layer of indirection.
Just wrap it to ensure its destroy() method is reliably called when needed.

Make static instances of LLKDUMessageWarning and LLKDUMessageError
self-register, eliminating the companion static bool and explicit checks in
code.
2016-08-03 20:40:03 -04:00
Nat Goodspeed acdb050ce5 MAINT-6584: Convert LLImage class hierarchy to standard 'bool'
instead of legacy BOOL.
2016-07-22 11:35:23 -04:00
Nat Goodspeed ab07b1a461 MAINT-6584: Rationalize custom KDU error/warning message classes.
Derive them both from a common base class that does the message logging,
instead of having each handler class log redundantly -- especially since the
put_text() override accepting const kdu_uint16* was simply streaming the
kdu_uint16 pointer to the log file, which would log the hex value of the
pointer.

Although we want a static instance of each of these handler classes, pull it
out rather than nesting the instance within the class itself.
2016-07-22 10:32:53 -04:00
Nat Goodspeed 71b593e88b 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<LLImageJ2CImpl> so we don't even have to delete it manually.
2016-07-21 16:49:02 -04:00
Nat Goodspeed f09a92f1f3 DRTVWR-427: Remove engineInfoLLImageJ2CKDU(), createLLImageJ2CKDU(),
destroyLLImageJ2CKDU().

These were apparently intended as simple C-style DLL entry points. But as
nobody calls them, and as we decided against building the viewer from DLLs,
they only clutter the code.
2016-07-21 14:29:29 -04:00
Ansariel 2a40a3cc7c Merge viewer-quickgraphics 2016-04-05 12:00:17 +02:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Ansariel 3192fe832f Merge viewer-quickgraphics 2016-03-08 01:41:31 +01:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nicky 5818c318d7 Fix for a possible memory corruption and one memory leak. 2015-04-18 01:36:17 +02:00
Tank_Master 6babf8abd2 Merge LL 3.7.7 2014-06-09 11:29:57 -07:00
Nicky 38bffcbc4e KDU 7.3.2 upgrade. 2013-12-05 00:00:15 +01:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Cinders b04e00b2a3 Fix a few implicit double to float conversions, pedanticly add a few missing function prototypes 2013-07-28 14:41:32 -06:00
Tank_Master d4640277d0 Merge LL 3.5.3 release. 2013-07-09 16:24:58 -07:00
Tank_Master 5b5f4c8bf5 Merge LL 3.4.2 release,
broken revision, KDU package needs updating, mac packager also likely broken
2012-12-14 07:59:55 -08:00
Liny 48d7e9420f Fix for kdu powered texture comment decode crashing uppon a texture that has no comment. 2012-11-21 23:04:52 -08:00
Techwolf Lupindo eaa3a51a19 Texture comment metadata support.
Currently extracts the comment out of the texture if it exists and decodes any <letter>=<value> embedded in the comment.
Currenly LL uses this to id the uploader and time uploaded.
This will be used by the export feature in the future.
2012-11-21 23:36:37 -05:00
Merov Linden 1bfdfcb7b9 Merge pull from vir/drano 2012-06-08 18:58:35 -07:00
Merov Linden e8ef6fd0e7 SH-3075 : Fix reversible compression for very small textures. Also supress the forcing to reversible for small textures. 2012-05-09 17:04:02 -07:00
Merov Linden 28cf5199ce SH-3047 : Fix lossless compression for small textures. 2012-05-08 21:42:53 -07:00
Merov Linden 172b45d5a2 SH-3060 : Complete new byte range computation, clean up and back pedal on some changes that didn't pay of. 2012-04-06 18:28:47 -07:00
Merov Linden 91094d92a7 SH-3060 : Implement new byte range computation, cleaned up use of compression rate as well. 2012-04-05 22:05:00 -07:00
Merov Linden 782981866a SH-3060 : New byte range implementation. Intermediate (not working) state. 2012-04-04 18:58:34 -07:00
Merov Linden c6511d9c85 SH-3075 : Fix encoding for reversible images and small textures 2012-04-04 15:59:52 -07:00
Merov Linden df09fd8e8b SH-3060 : Preliminary implementation of the new byte range computation, implement setting to turn it on or off 2012-04-02 19:05:32 -07:00
Merov Linden 792943c211 SH-3050 : Add a call to set_max_bytes() and some clean up 2012-03-30 14:07:43 -07:00
Merov Linden 5c86d19373 SH-3050 : Parse an input codestream without decompressing it to find discard levels boundaries (test only). 2012-03-25 11:52:10 -07:00
Merov Linden bc6f669ff4 SH-3047 : Read the number of levels from the j2c image header instead of relying on hacked computation based on width / height. 2012-03-15 13:01:14 -07:00
Tank_Master 991d43709c merge LL 3.3.3 beta 2012-06-16 07:22:27 -07:00
Merov Linden 7fd2290177 SH-3075 : Fix reversible compression for very small textures. Also supress the forcing to reversible for small textures. 2012-05-09 17:04:02 -07:00
Merov Linden 005ce31f41 SH-3047 : Fix lossless compression for small textures. 2012-05-08 21:42:53 -07:00
Merov Linden 7122308534 SH-1998 : Compatible API changes KDU v6.4.1 / v7.0.0 2012-02-27 15:24:39 -08:00
Arrehn c79f624ec9 Decreased verbosity of KDU corruption error 2012-01-30 01:31:28 -05:00
callum 1afbbba03d EXP-826 FIX Help -> About Secondlife Info is corrupted. 2011-05-23 17:12:08 -07:00
Merov Linden 1e0d3fc7bc EXP-664 : following richard codereview: use llclamp where appropriate 2011-05-07 11:09:34 -07:00
Merov Linden c6c1419faa EXP-664 : Make encoding parameters more resilient to bad entries, add levels as encoding parameters, update test applet to support this 2011-05-04 22:43:51 -07:00
Merov Linden 6f6cebbf5d EXP-672, EXP-673 : Fix bug in encoding small textures (16x16 and under) 2011-04-15 17:53:16 -07:00
Merov Linden 8c7d9bbd06 EXP-663 : Fix memory leak introduced in precincts handling 2011-04-14 09:28:34 -07:00
Merov Linden e752e91828 STORM-746 : add precincts and blocks arguments taken into account in j2c output 2011-04-04 23:49:40 -07:00
Merov Linden 83ec0cd62f STORM-746 : add new arguments for precincts and blocks on output, region and level on input, add code for input loading restriction 2011-04-04 18:37:32 -07:00