From dfdd7fa95977fd083a57a1d64bddee63408903c9 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 18:30:46 +0100 Subject: [PATCH 01/11] 3.6.4 Correct CharLS API call --- dcmjpls/libsrc/djcodece.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index 34eb810237..8209bf8877 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -664,7 +664,7 @@ OFCondition DJLSEncoderBase::compressRawFrame( size_t bytesWritten = 0; - JLS_ERROR err = JpegLsEncode(&buffer, &size, &bytesWritten, framePointer, frameSize, &jls_params); + JLS_ERROR err = JpegLsEncode(buffer, size, &bytesWritten, framePointer, frameSize, &jls_params); result = DJLSError::convert(err); if (result.good()) @@ -1071,7 +1071,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame( size_t bytesWritten = 0; - JLS_ERROR err = JpegLsEncode(&compressed_buffer, &compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); + JLS_ERROR err = JpegLsEncode(compressed_buffer, compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); result = DJLSError::convert(err); if (result.good()) From 4a41f0918f0dff18aebe60e974aafd4a2f59d65b Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 18:58:25 +0100 Subject: [PATCH 02/11] 3.6.4 Update JLS_ERROR to jpegls_error in CharLS usage --- dcmjpls/libsrc/djcodecd.cc | 5 +++-- dcmjpls/libsrc/djcodece.cc | 9 +++++++-- dcmjpls/libsrc/djerror.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc index 3f0d85e1df..0a31ff974e 100644 --- a/dcmjpls/libsrc/djcodecd.cc +++ b/dcmjpls/libsrc/djcodecd.cc @@ -37,7 +37,8 @@ #include "djerror.h" /* for private class DJLSError */ // JPEG-LS library (CharLS) includes -#include "intrface.h" +#include "CharLS/charls.h" +#include "CharLS/public_types.h" E_TransferSyntax DJLSLosslessDecoder::supportedTransferSyntax() const { @@ -382,7 +383,7 @@ OFCondition DJLSDecoderBase::decodeFrame( if (result.good()) { JlsParameters params; - JLS_ERROR err; + CharlsApiResultType err; err = JpegLsReadHeader(jlsData, compressedSize, ¶ms); result = DJLSError::convert(err); diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index 8209bf8877..6bdf15b537 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -55,7 +55,12 @@ #include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ // JPEG-LS library (CharLS) includes +<<<<<<< HEAD #include "intrface.h" +======= +#include "CharLS/charls.h" +#include "CharLS/public_types.h" +>>>>>>> 42dbe6a06... 3.6.4 Update JLS_ERROR to jpegls_error in CharLS usage BEGIN_EXTERN_C #ifdef HAVE_FCNTL_H @@ -664,7 +669,7 @@ OFCondition DJLSEncoderBase::compressRawFrame( size_t bytesWritten = 0; - JLS_ERROR err = JpegLsEncode(buffer, size, &bytesWritten, framePointer, frameSize, &jls_params); + CharlsApiResultType err = JpegLsEncode(buffer, size, &bytesWritten, framePointer, frameSize, &jls_params); result = DJLSError::convert(err); if (result.good()) @@ -1071,7 +1076,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame( size_t bytesWritten = 0; - JLS_ERROR err = JpegLsEncode(compressed_buffer, compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); + CharlsApiResultType err = JpegLsEncode(compressed_buffer, compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); result = DJLSError::convert(err); if (result.good()) diff --git a/dcmjpls/libsrc/djerror.h b/dcmjpls/libsrc/djerror.h index d625c48a69..b2199467aa 100644 --- a/dcmjpls/libsrc/djerror.h +++ b/dcmjpls/libsrc/djerror.h @@ -40,7 +40,7 @@ class DJLSError * @param error The CharLS error code * @return The OFCondition */ - static const OFConditionConst& convert(JLS_ERROR error) + static const OFConditionConst& convert(CharlsApiResultType error) { switch (error) { From 5cf2376b6671ed887fb038c4923202552db92702 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 19:01:23 +0100 Subject: [PATCH 03/11] 3.6.4 correct JpegLsReadHeader arguments --- dcmjpls/libsrc/djcodecd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc index 0a31ff974e..3f906b7839 100644 --- a/dcmjpls/libsrc/djcodecd.cc +++ b/dcmjpls/libsrc/djcodecd.cc @@ -385,7 +385,7 @@ OFCondition DJLSDecoderBase::decodeFrame( JlsParameters params; CharlsApiResultType err; - err = JpegLsReadHeader(jlsData, compressedSize, ¶ms); + err = JpegLsReadHeader(jlsData, compressedSize, ¶ms, NULL); result = DJLSError::convert(err); if (result.good()) From 7116ad852a4564d813f55964db9a3ebde7de19d5 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 19:03:56 +0100 Subject: [PATCH 04/11] 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 3f906b7839..ece4a5e10a 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 6bdf15b537..0499b9b2a9 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -573,13 +573,13 @@ OFCondition DJLSEncoderBase::compressRawFrame( // Set up the information structure for CharLS OFBitmanipTemplate::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) @@ -1002,11 +1002,11 @@ OFCondition DJLSEncoderBase::compressCookedFrame( OFBitmanipTemplate::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; @@ -1014,11 +1014,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 @@ -1068,7 +1068,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; From 5c6f60209822c28358d30f287e0a73d553472caf Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 19:06:44 +0100 Subject: [PATCH 05/11] 3.6.4 correct JpegLsDecode arguments for CharLS 2 --- dcmjpls/libsrc/djcodecd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc index ece4a5e10a..6f1ddba616 100644 --- a/dcmjpls/libsrc/djcodecd.cc +++ b/dcmjpls/libsrc/djcodecd.cc @@ -403,7 +403,7 @@ OFCondition DJLSDecoderBase::decodeFrame( } else { - err = JpegLsDecode(buffer, bufSize, jlsData, compressedSize, ¶ms); + err = JpegLsDecode(buffer, bufSize, jlsData, compressedSize, ¶ms, NULL); result = DJLSError::convert(err); delete[] jlsData; From 8a25b9cbd6cb50de4b05c2ccb834cd904b12d0f2 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 19:20:49 +0100 Subject: [PATCH 06/11] 3.6.4 update ilv for new CharLS --- dcmjpls/libsrc/djcodecd.cc | 4 ++-- dcmjpls/libsrc/djcodece.cc | 48 +++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc index 6f1ddba616..2e36680cdd 100644 --- a/dcmjpls/libsrc/djcodecd.cc +++ b/dcmjpls/libsrc/djcodecd.cc @@ -409,7 +409,7 @@ OFCondition DJLSDecoderBase::decodeFrame( if (result.good() && imageSamplesPerPixel == 3) { - if (imagePlanarConfiguration == 1 && params.ilv != ILV_NONE) + if (imagePlanarConfiguration == 1 && params.interleaveMode != charls::InterleaveMode::None) { // The dataset says this should be planarConfiguration == 1, but // it isn't -> convert it. @@ -419,7 +419,7 @@ OFCondition DJLSDecoderBase::decodeFrame( else result = createPlanarConfiguration1Word(OFreinterpret_cast(Uint16*, buffer), imageColumns, imageRows); } - else if (imagePlanarConfiguration == 0 && params.ilv != ILV_SAMPLE && params.ilv != ILV_LINE) + else if (imagePlanarConfiguration == 0 && params.interleaveMode != charls::InterleaveMode::Sample && params.interleaveMode != charls::InterleaveMode::Line) { // The dataset says this should be planarConfiguration == 0, but // it isn't -> convert it. diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index 0499b9b2a9..1bbf5f59bc 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -601,15 +601,15 @@ OFCondition DJLSEncoderBase::compressRawFrame( else return EC_IllegalCall; - enum interleavemode ilv; + CharlsInterleaveModeType ilv; switch (planarConfiguration) { - // ILV_LINE is not supported by DICOM + // charls::InterleaveMode::Line is not supported by DICOM case 0: - ilv = ILV_SAMPLE; + ilv = charls::InterleaveMode::Sample; break; case 1: - ilv = ILV_NONE; + ilv = charls::InterleaveMode::None; break; default: return EC_IllegalCall; @@ -618,39 +618,39 @@ OFCondition DJLSEncoderBase::compressRawFrame( switch (djcp->getJplsInterleaveMode()) { case DJLSCodecParameter::interleaveSample: - jls_params.ilv = ILV_SAMPLE; + jls_params.interleaveMode = charls::InterleaveMode::Sample; break; case DJLSCodecParameter::interleaveLine: - jls_params.ilv = ILV_LINE; + jls_params.interleaveMode = charls::InterleaveMode::Line; break; case DJLSCodecParameter::interleaveNone: - jls_params.ilv = ILV_NONE; + jls_params.interleaveMode = charls::InterleaveMode::None; break; case DJLSCodecParameter::interleaveDefault: default: // In default mode we just never convert the image to another // interleave-mode. Instead, we use what is already there. - jls_params.ilv = ilv; + jls_params.interleaveMode = ilv; break; } - // Special case: one component images are always ILV_NONE (Standard requires this) + // Special case: one component images are always charls::InterleaveMode::None (Standard requires this) if (jls_params.components == 1) { - jls_params.ilv = ILV_NONE; + jls_params.interleaveMode = charls::InterleaveMode::None; // Don't try to convert to another interleave mode, not necessary - ilv = ILV_NONE; + ilv = charls::InterleaveMode::None; } // Do we have to convert the image to some other interleave mode? - if ((jls_params.ilv == ILV_NONE && (ilv == ILV_SAMPLE || ilv == ILV_LINE)) || - (ilv == ILV_NONE && (jls_params.ilv == ILV_SAMPLE || jls_params.ilv == ILV_LINE))) + if ((jls_params.interleaveMode == charls::InterleaveMode::None && (ilv == charls::InterleaveMode::Sample || ilv == charls::InterleaveMode::Line)) || + (ilv == charls::InterleaveMode::None && (jls_params.interleaveMode == charls::InterleaveMode::Sample || jls_params.interleaveMode == charls::InterleaveMode::Line))) { - DCMJPLS_DEBUG("Converting image from " << (ilv == ILV_NONE ? "color-by-plane" : "color-by-pixel") - << " to " << (jls_params.ilv == ILV_NONE ? "color-by-plane" : "color-by-pixel")); + DCMJPLS_DEBUG("Converting image from " << (ilv == charls::InterleaveMode::None ? "color-by-plane" : "color-by-pixel") + << " to " << (jls_params.interleaveMode == charls::InterleaveMode::None ? "color-by-plane" : "color-by-pixel")); frameBuffer = new Uint8[frameSize]; - if (jls_params.ilv == ILV_NONE) + if (jls_params.interleaveMode == charls::InterleaveMode::None) result = convertToUninterleaved(frameBuffer, framePointer, samplesPerPixel, width, height, bitsAllocated); else /* For CharLS, sample-interleaved and line-interleaved is both expected to @@ -1038,31 +1038,31 @@ OFCondition DJLSEncoderBase::compressCookedFrame( switch (djcp->getJplsInterleaveMode()) { case DJLSCodecParameter::interleaveSample: - jls_params.ilv = ILV_SAMPLE; + jls_params.interleaveMode = charls::InterleaveMode::Sample; break; case DJLSCodecParameter::interleaveLine: - jls_params.ilv = ILV_LINE; + jls_params.interleaveMode = charls::InterleaveMode::Line; break; case DJLSCodecParameter::interleaveNone: - jls_params.ilv = ILV_NONE; + jls_params.interleaveMode = charls::InterleaveMode::None; break; case DJLSCodecParameter::interleaveDefault: default: - // Default for the cooked encoder is always ILV_LINE - jls_params.ilv = ILV_LINE; + // Default for the cooked encoder is always charls::InterleaveMode::Line + jls_params.interleaveMode = charls::InterleaveMode::Line; break; } - // Special case: one component images are always ILV_NONE (Standard requires this) + // Special case: one component images are always CharlsInterleaveMode.None (Standard requires this) if (jls_params.components == 1) { - jls_params.ilv = ILV_NONE; + jls_params.interleaveMode = charls::InterleaveMode::None; } Uint8 *frameBuffer = NULL; Uint8 *framePointer = buffer; // Do we have to convert the image to color-by-plane now? - if (jls_params.ilv == ILV_NONE && jls_params.components != 1) + if (jls_params.interleaveMode == charls::InterleaveMode::None && jls_params.components != 1) { DCMJPLS_DEBUG("Converting image from color-by-pixel to color-by-plane"); From 3219f5ca1e86812a5e2ca986c009df06893c19a4 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 19:43:48 +0100 Subject: [PATCH 07/11] 3.6.4 Correct extra include for CharLS --- dcmjpls/libsrc/djcodecd.cc | 2 +- dcmjpls/libsrc/djcodece.cc | 6 +----- dcmjpls/libsrc/djerror.h | 3 ++- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dcmjpls/libsrc/djcodecd.cc b/dcmjpls/libsrc/djcodecd.cc index 2e36680cdd..b2ad93d602 100644 --- a/dcmjpls/libsrc/djcodecd.cc +++ b/dcmjpls/libsrc/djcodecd.cc @@ -38,7 +38,7 @@ // JPEG-LS library (CharLS) includes #include "CharLS/charls.h" -#include "CharLS/public_types.h" +#include "CharLS/publictypes.h" E_TransferSyntax DJLSLosslessDecoder::supportedTransferSyntax() const { diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index 1bbf5f59bc..d91965c25c 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -55,12 +55,8 @@ #include "dcmtk/dcmimgle/dcmimage.h" /* for class DicomImage */ // JPEG-LS library (CharLS) includes -<<<<<<< HEAD -#include "intrface.h" -======= #include "CharLS/charls.h" -#include "CharLS/public_types.h" ->>>>>>> 42dbe6a06... 3.6.4 Update JLS_ERROR to jpegls_error in CharLS usage +#include "CharLS/publictypes.h" BEGIN_EXTERN_C #ifdef HAVE_FCNTL_H diff --git a/dcmjpls/libsrc/djerror.h b/dcmjpls/libsrc/djerror.h index b2199467aa..e0a4a3022a 100644 --- a/dcmjpls/libsrc/djerror.h +++ b/dcmjpls/libsrc/djerror.h @@ -24,7 +24,8 @@ #include "dcmtk/config/osconfig.h" #include "dcmtk/dcmjpls/djlsutil.h" /* For the OFCondition codes */ -#include "intrface.h" /* CharLS include */ +#include "CharLS/charls.h" /* CharLS include */ +#include "CharLS/publictypes.h" /* CharLS include */ /** Helper class for converting between dcmjpls and CharLS error codes */ From 3ddfa333d4ae34cbc4138cc5cee3bd5356d6d818 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 21:26:28 +0100 Subject: [PATCH 08/11] 3.6.4 Update errors to use enum class in CharLS 2 --- dcmjpls/libsrc/djerror.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dcmjpls/libsrc/djerror.h b/dcmjpls/libsrc/djerror.h index e0a4a3022a..e1a88f359b 100644 --- a/dcmjpls/libsrc/djerror.h +++ b/dcmjpls/libsrc/djerror.h @@ -45,25 +45,25 @@ class DJLSError { switch (error) { - case OK: + case charls::ApiResult::OK: return EC_Normal; - case UncompressedBufferTooSmall: + case charls::ApiResult::UncompressedBufferTooSmall: return EC_JLSUncompressedBufferTooSmall; - case CompressedBufferTooSmall: + case charls::ApiResult::CompressedBufferTooSmall: return EC_JLSCompressedBufferTooSmall; - case ImageTypeNotSupported: + case charls::ApiResult::ImageTypeNotSupported: return EC_JLSCodecUnsupportedImageType; - case InvalidJlsParameters: + case charls::ApiResult::InvalidJlsParameters: return EC_JLSCodecInvalidParameters; - case ParameterValueNotSupported: + case charls::ApiResult::ParameterValueNotSupported: return EC_JLSCodecUnsupportedValue; - case InvalidCompressedData: + case charls::ApiResult::InvalidCompressedData: return EC_JLSInvalidCompressedData; - case UnsupportedBitDepthForTransform: + case charls::ApiResult::UnsupportedBitDepthForTransform: return EC_JLSUnsupportedBitDepthForTransform; - case UnsupportedColorTransform: + case charls::ApiResult::UnsupportedColorTransform: return EC_JLSUnsupportedColorTransform; - case TooMuchCompressedData: + case charls::ApiResult::TooMuchCompressedData: return EC_JLSTooMuchCompressedData; default: return EC_IllegalParameter; From 50b4a40b36c8399a167119151c76c491a938a498 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 22:20:51 +0100 Subject: [PATCH 09/11] 3.6.4 define BYTE for CharLS --- dcmjpls/libsrc/djcodece.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index d91965c25c..c6f4a55964 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -70,6 +70,9 @@ BEGIN_EXTERN_C #endif END_EXTERN_C +// No longer defined in charls +typedef unsigned char BYTE; + E_TransferSyntax DJLSLosslessEncoder::supportedTransferSyntax() const { From 2936a127dbbde5decc00a631f70fa825fc325f91 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 22:44:56 +0100 Subject: [PATCH 10/11] 3.6.4 Update colorTransformation for CharLS 2 --- dcmjpls/libsrc/djcodece.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index c6f4a55964..707b94dcbd 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -578,7 +578,7 @@ OFCondition DJLSEncoderBase::compressRawFrame( 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.colorTransformation = 0; + jls_params.colorTransformation = charls::ColorTransformation::None; // Unset: jls_params.jfif (thumbnail, dpi) @@ -1005,7 +1005,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame( jls_params.outputBgr = false; jls_params.bitsPerSample = depth; // No idea what this one does, but I don't think DICOM says anything about it - jls_params.colorTransformation = 0; + jls_params.colorTransformation = charls::ColorTransformation::None; // This was already checked for a sane value above jls_params.components = samplesPerPixel; From 5d7847ff8077d190f62076e604aec7fd0134427c Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Sun, 28 Jul 2019 22:48:27 +0100 Subject: [PATCH 11/11] 3.6.4 Update JpegLsEncode for CharLS 2 --- dcmjpls/libsrc/djcodece.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcmjpls/libsrc/djcodece.cc b/dcmjpls/libsrc/djcodece.cc index 707b94dcbd..87120a5b9f 100644 --- a/dcmjpls/libsrc/djcodece.cc +++ b/dcmjpls/libsrc/djcodece.cc @@ -668,7 +668,7 @@ OFCondition DJLSEncoderBase::compressRawFrame( size_t bytesWritten = 0; - CharlsApiResultType err = JpegLsEncode(buffer, size, &bytesWritten, framePointer, frameSize, &jls_params); + CharlsApiResultType err = JpegLsEncode(buffer, size, &bytesWritten, framePointer, frameSize, &jls_params, NULL); result = DJLSError::convert(err); if (result.good()) @@ -1075,7 +1075,7 @@ OFCondition DJLSEncoderBase::compressCookedFrame( size_t bytesWritten = 0; - CharlsApiResultType err = JpegLsEncode(compressed_buffer, compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params); + CharlsApiResultType err = JpegLsEncode(compressed_buffer, compressed_buffer_size, &bytesWritten, framePointer, buffer_size, &jls_params, NULL); result = DJLSError::convert(err); if (result.good())