diff OrthancServer/Internals/DicomImageDecoder.cpp @ 2380:96b3ec054b69

reorganization in macros
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Aug 2017 16:49:44 +0200
parents e002430baa41
children b8969010b534
line wrap: on
line diff
--- a/OrthancServer/Internals/DicomImageDecoder.cpp	Mon Aug 28 18:07:03 2017 +0200
+++ b/OrthancServer/Internals/DicomImageDecoder.cpp	Tue Aug 29 16:49:44 2017 +0200
@@ -81,27 +81,33 @@
 #include "../../Core/OrthancException.h"
 #include "../../Core/Images/Image.h"
 #include "../../Core/Images/ImageProcessing.h"
-#include "../../Core/Images/PngWriter.h"
-#include "../../Core/Images/JpegWriter.h"
 #include "../../Core/DicomFormat/DicomIntegerPixelAccessor.h"
 #include "../ToDcmtkBridge.h"
 #include "../FromDcmtkBridge.h"
 #include "../ParsedDicomFile.h"
 #include "../OrthancInitialization.h"
 
+#if ORTHANC_ENABLE_PNG == 1
+#  include "../../Core/Images/PngWriter.h"
+#endif
+
+#if ORTHANC_ENABLE_JPEG == 1
+#  include "../../Core/Images/JpegWriter.h"
+#endif
+
 #include <boost/lexical_cast.hpp>
 
 #include <dcmtk/dcmdata/dcfilefo.h>
 #include <dcmtk/dcmdata/dcrleccd.h>
 #include <dcmtk/dcmdata/dcrlecp.h>
 
-#if ORTHANC_ENABLE_JPEG_LOSSLESS == 1
+#if ORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS == 1
 #  include <dcmtk/dcmjpls/djcodecd.h>
 #  include <dcmtk/dcmjpls/djcparam.h>
 #  include <dcmtk/dcmjpeg/djrplol.h>
 #endif
 
-#if ORTHANC_ENABLE_JPEG == 1
+#if ORTHANC_ENABLE_DCMTK_JPEG == 1
 #  include <dcmtk/dcmjpeg/djcodecd.h>
 #  include <dcmtk/dcmjpeg/djcparam.h>
 #  include <dcmtk/dcmjpeg/djdecbas.h>
@@ -518,7 +524,7 @@
     }
 
 
-#if ORTHANC_ENABLE_JPEG_LOSSLESS == 1
+#if ORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS == 1
     /**
      * Deal with JPEG-LS images.
      **/
@@ -550,7 +556,7 @@
 #endif
 
 
-#if ORTHANC_ENABLE_JPEG == 1
+#if ORTHANC_ENABLE_DCMTK_JPEG == 1
     /**
      * Deal with JPEG images.
      **/
@@ -775,6 +781,7 @@
   }
 
 
+#if ORTHANC_ENABLE_PNG == 1
   void DicomImageDecoder::ExtractPngImage(std::string& result,
                                           std::auto_ptr<ImageAccessor>& image,
                                           ImageExtractionMode mode,
@@ -785,8 +792,10 @@
     PngWriter writer;
     writer.WriteToMemory(result, *image);
   }
+#endif
 
 
+#if ORTHANC_ENABLE_JPEG == 1
   void DicomImageDecoder::ExtractJpegImage(std::string& result,
                                            std::auto_ptr<ImageAccessor>& image,
                                            ImageExtractionMode mode,
@@ -805,4 +814,5 @@
     writer.SetQuality(quality);
     writer.WriteToMemory(result, *image);
   }
+#endif
 }