summaryrefslogtreecommitdiff
path: root/indra/llkdu/llimagej2ckdu.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-11-03 20:48:41 -0400
committerNat Goodspeed <nat@lindenlab.com>2016-11-03 20:48:41 -0400
commit0413e40d82cc53c1e8180023db36108557b6f21c (patch)
treebd358b773a730070aa5e5843f76bd57931215a50 /indra/llkdu/llimagej2ckdu.cpp
parent6cc4a8dcd2a0a320698312fe4775a946a16575e4 (diff)
DRTVWR-418: Update KDU and llimagej2ckdu* with certain clang fixes.
Diffstat (limited to 'indra/llkdu/llimagej2ckdu.cpp')
-rw-r--r--indra/llkdu/llimagej2ckdu.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp
index b85e39b452..0540e55e07 100644
--- a/indra/llkdu/llimagej2ckdu.cpp
+++ b/indra/llkdu/llimagej2ckdu.cpp
@@ -37,7 +37,6 @@
#include "llpointer.h"
#include "llmath.h"
#include "llkdumem.h"
-#include "stringize.h"
#define kdu_xxxx "kdu_block_coding.h"
#include "include_kdu_xxxx.h"
@@ -50,6 +49,18 @@ using namespace kdu_core;
#include <sstream>
#include <iomanip>
+// stream kdu_dims to std::ostream
+// Turns out this must NOT be in the anonymous namespace!
+// It must also precede #include "stringize.h".
+inline
+std::ostream& operator<<(std::ostream& out, const kdu_dims& dims)
+{
+ return out << "(" << dims.pos.x << "," << dims.pos.y << "),"
+ "[" << dims.size.x << "x" << dims.size.y << "]";
+}
+
+#include "stringize.h"
+
namespace {
// Failure to load an image shouldn't crash the whole viewer.
struct KDUError: public LLContinueError
@@ -92,15 +103,6 @@ std::string report_kdu_exception(kdu_exception mb)
}
} // anonymous namespace
-// stream kdu_dims to std::ostream
-// Turns out this must NOT be in the anonymous namespace!
-inline
-std::ostream& operator<<(std::ostream& out, const kdu_dims& dims)
-{
- return out << "(" << dims.pos.x << "," << dims.pos.y << "),"
- "[" << dims.size.x << "x" << dims.size.y << "]";
-}
-
class kdc_flow_control {
public:
@@ -356,9 +358,9 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod
// This method is only called from methods that catch KDUError.
// We want to fail the image load, not crash the viewer.
LLTHROW(KDUError(STRINGIZE("Component " << idx << " dimensions "
- << other_dims
- << " do not match component 0 dimensions "
- << dims << "!")));
+ << stringize(other_dims)
+ << " do not match component 0 dimensions "
+ << stringize(dims) << "!")));
}
}
@@ -570,7 +572,8 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
kdu_coords offset = tile_dims.pos - dims.pos;
int row_gap = channels*dims.size.x; // inter-row separation
kdu_byte *buf = buffer + offset.y*row_gap + offset.x*channels;
- mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap));
+ mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap,
+ mCodeStreamp.get()));
}
// Do the actual processing
F32 remaining_time = decode_time - decode_timer.getElapsedTimeF32();