changeset 1944:1a5e070a21c3

fix compilation against DCMTK 3.6.1
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Apr 2016 13:33:19 +0200
parents bc949ea71fe6
children 76ff6eecf07f
files OrthancServer/Internals/DicomImageDecoder.cpp
diffstat 1 files changed, 31 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Internals/DicomImageDecoder.cpp	Mon Apr 04 13:17:08 2016 +0200
+++ b/OrthancServer/Internals/DicomImageDecoder.cpp	Mon Apr 04 13:33:19 2016 +0200
@@ -95,22 +95,30 @@
 #include <dcmtk/dcmdata/dcrlecp.h>
 
 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
-#include <dcmtk/dcmjpls/djcodecd.h>
-#include <dcmtk/dcmjpls/djcparam.h>
-#include <dcmtk/dcmjpeg/djrplol.h>
+#  include <dcmtk/dcmjpls/djcodecd.h>
+#  include <dcmtk/dcmjpls/djcparam.h>
+#  include <dcmtk/dcmjpeg/djrplol.h>
 #endif
 
 #if ORTHANC_JPEG_ENABLED == 1
-#include <dcmtk/dcmjpeg/djcodecd.h>
-#include <dcmtk/dcmjpeg/djcparam.h>
-#include <dcmtk/dcmjpeg/djdecbas.h>
-#include <dcmtk/dcmjpeg/djdecext.h>
-#include <dcmtk/dcmjpeg/djdeclol.h>
-#include <dcmtk/dcmjpeg/djdecpro.h>
-#include <dcmtk/dcmjpeg/djdecsps.h>
-#include <dcmtk/dcmjpeg/djdecsv1.h>
+#  include <dcmtk/dcmjpeg/djcodecd.h>
+#  include <dcmtk/dcmjpeg/djcparam.h>
+#  include <dcmtk/dcmjpeg/djdecbas.h>
+#  include <dcmtk/dcmjpeg/djdecext.h>
+#  include <dcmtk/dcmjpeg/djdeclol.h>
+#  include <dcmtk/dcmjpeg/djdecpro.h>
+#  include <dcmtk/dcmjpeg/djdecsps.h>
+#  include <dcmtk/dcmjpeg/djdecsv1.h>
 #endif
 
+#if DCMTK_VERSION_NUMBER <= 360
+#  define EXS_JPEGProcess1      EXS_JPEGProcess1TransferSyntax
+#  define EXS_JPEGProcess2_4    EXS_JPEGProcess2_4TransferSyntax
+#  define EXS_JPEGProcess6_8    EXS_JPEGProcess6_8TransferSyntax
+#  define EXS_JPEGProcess10_12  EXS_JPEGProcess10_12TransferSyntax
+#  define EXS_JPEGProcess14     EXS_JPEGProcess14TransferSyntax
+#  define EXS_JPEGProcess14SV1  EXS_JPEGProcess14SV1TransferSyntax
+#endif
 
 namespace Orthanc
 {
@@ -548,12 +556,12 @@
      * Deal with JPEG images.
      **/
 
-    if (syntax == EXS_JPEGProcess1TransferSyntax     ||  // DJDecoderBaseline
-        syntax == EXS_JPEGProcess2_4TransferSyntax   ||  // DJDecoderExtended
-        syntax == EXS_JPEGProcess6_8TransferSyntax   ||  // DJDecoderSpectralSelection (retired)
-        syntax == EXS_JPEGProcess10_12TransferSyntax ||  // DJDecoderProgressive (retired)
-        syntax == EXS_JPEGProcess14TransferSyntax    ||  // DJDecoderLossless
-        syntax == EXS_JPEGProcess14SV1TransferSyntax)    // DJDecoderP14SV1
+    if (syntax == EXS_JPEGProcess1     ||  // DJDecoderBaseline
+        syntax == EXS_JPEGProcess2_4   ||  // DJDecoderExtended
+        syntax == EXS_JPEGProcess6_8   ||  // DJDecoderSpectralSelection (retired)
+        syntax == EXS_JPEGProcess10_12 ||  // DJDecoderProgressive (retired)
+        syntax == EXS_JPEGProcess14    ||  // DJDecoderLossless
+        syntax == EXS_JPEGProcess14SV1)    // DJDecoderP14SV1
     {
       // http://support.dcmtk.org/docs-snapshot/djutils_8h.html#a2a9695e5b6b0f5c45a64c7f072c1eb9d
       DJCodecParameter parameters(
@@ -565,32 +573,32 @@
 
       switch (syntax)
       {
-        case EXS_JPEGProcess1TransferSyntax:
+        case EXS_JPEGProcess1:
           LOG(INFO) << "Decoding a JPEG baseline (process 1) DICOM image";
           decoder.reset(new DJDecoderBaseline);
           break;
           
-        case EXS_JPEGProcess2_4TransferSyntax :
+        case EXS_JPEGProcess2_4 :
           LOG(INFO) << "Decoding a JPEG baseline (processes 2 and 4) DICOM image";
           decoder.reset(new DJDecoderExtended);
           break;
           
-        case EXS_JPEGProcess6_8TransferSyntax:   // Retired
+        case EXS_JPEGProcess6_8:   // Retired
           LOG(INFO) << "Decoding a JPEG spectral section, nonhierarchical (processes 6 and 8) DICOM image";
           decoder.reset(new DJDecoderSpectralSelection);
           break;
           
-        case EXS_JPEGProcess10_12TransferSyntax:   // Retired
+        case EXS_JPEGProcess10_12:   // Retired
           LOG(INFO) << "Decoding a JPEG full progression, nonhierarchical (processes 10 and 12) DICOM image";
           decoder.reset(new DJDecoderProgressive);
           break;
           
-        case EXS_JPEGProcess14TransferSyntax:
+        case EXS_JPEGProcess14:
           LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical (process 14) DICOM image";
           decoder.reset(new DJDecoderLossless);
           break;
           
-        case EXS_JPEGProcess14SV1TransferSyntax:
+        case EXS_JPEGProcess14SV1:
           LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical, first-order prediction (process 14 selection value 1) DICOM image";
           decoder.reset(new DJDecoderP14SV1);
           break;