Blob Blame History Raw
From b3c7a934cbd9f1b90a5d1280c46b8cfe2c7863c6 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
Date: Sun, 28 Jul 2019 19:03:56 +0100
Subject: [PATCH 09/16] 3.6.4 update JlsParameters for new CharLS

---
 dcmjpls/libsrc/djcodecd.cc |  4 ++--
 dcmjpls/libsrc/djcodece.cc | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc
index 3f906b783..ece4a5e10 100644
--- a/dcmjpls/libsrc/djcodecd.cc
+++ b/dcmjpls/libsrc/djcodecd.cc
@@ -393,8 +393,8 @@ OFCondition DJLSDecoderBase::decodeFrame(
       if (params.width != imageColumns) result = EC_JLSImageDataMismatch;
       else if (params.height != imageRows) result = EC_JLSImageDataMismatch;
       else if (params.components != imageSamplesPerPixel) result = EC_JLSImageDataMismatch;
-      else if ((bytesPerSample == 1) && (params.bitspersample > 8)) result = EC_JLSImageDataMismatch;
-      else if ((bytesPerSample == 2) && (params.bitspersample <= 8)) result = EC_JLSImageDataMismatch;
+      else if ((bytesPerSample == 1) && (params.bitsPerSample > 8)) result = EC_JLSImageDataMismatch;
+      else if ((bytesPerSample == 2) && (params.bitsPerSample <= 8)) result = EC_JLSImageDataMismatch;
     }
 
     if (!result.good())
diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc
index 98a9ceccb..8e68f7386 100644
--- a/dcmjpls/libsrc/djcodece.cc
+++ b/dcmjpls/libsrc/djcodece.cc
@@ -569,13 +569,13 @@ OFCondition DJLSEncoderBase::compressRawFrame(
 
   // Set up the information structure for CharLS
   OFBitmanipTemplate<char>::zeroMem((char *) &jls_params, sizeof(jls_params));
-  jls_params.bitspersample = bitsAllocated;
+  jls_params.bitsPerSample = bitsAllocated;
   jls_params.height = height;
   jls_params.width = width;
-  jls_params.allowedlossyerror = 0; // must be zero for raw mode
+  jls_params.allowedLossyError = 0; // must be zero for raw mode
   jls_params.outputBgr = false;
   // No idea what this one does, but I don't think DICOM says anything about it
-  jls_params.colorTransform = 0;
+  jls_params.colorTransformation = 0;
 
   // Unset: jls_params.jfif (thumbnail, dpi)
 
@@ -998,11 +998,11 @@ OFCondition DJLSEncoderBase::compressCookedFrame(
   OFBitmanipTemplate<char>::zeroMem((char *) &jls_params, sizeof(jls_params));
   jls_params.height = height;
   jls_params.width = width;
-  jls_params.allowedlossyerror = nearLosslessDeviation;
+  jls_params.allowedLossyError = nearLosslessDeviation;
   jls_params.outputBgr = false;
-  jls_params.bitspersample = depth;
+  jls_params.bitsPerSample = depth;
   // No idea what this one does, but I don't think DICOM says anything about it
-  jls_params.colorTransform = 0;
+  jls_params.colorTransformation = 0;
 
   // This was already checked for a sane value above
   jls_params.components = samplesPerPixel;
@@ -1010,11 +1010,11 @@ OFCondition DJLSEncoderBase::compressCookedFrame(
   {
     case EPR_Uint8:
     case EPR_Sint8:
-      jls_params.bitspersample = 8;
+      jls_params.bitsPerSample = 8;
       break;
     case EPR_Uint16:
     case EPR_Sint16:
-      jls_params.bitspersample = 16;
+      jls_params.bitsPerSample = 16;
       break;
     default:
       // Everything else was already handled above and can't happen here
@@ -1064,7 +1064,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame(
 
     frameBuffer = new Uint8[buffer_size];
     framePointer = frameBuffer;
-    result = convertToUninterleaved(frameBuffer, buffer, samplesPerPixel, width, height, jls_params.bitspersample);
+    result = convertToUninterleaved(frameBuffer, buffer, samplesPerPixel, width, height, jls_params.bitsPerSample);
   }
 
   size_t compressed_buffer_size = buffer_size + 1024;
-- 
2.21.0