Mercurial > hg > orthanc-webviewer
diff Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp @ 172:330ecfd96aec
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 10 Oct 2017 12:53:46 +0200 |
parents | 5dc54316d68b |
children | 4f0f4f64cff3 |
line wrap: on
line diff
--- a/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Thu Aug 24 19:49:20 2017 +0200 +++ b/Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Oct 10 12:53:46 2017 +0200 @@ -32,6 +32,17 @@ #include <boost/iostreams/device/array.hpp> +// This is for compatibility with Orthanc SDK <= 1.3.0 +#if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) +#define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \ + (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \ + (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \ + (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \ + (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \ + ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision)))) +#endif + + namespace OrthancPlugins { struct GdcmImageDecoder::PImpl @@ -199,6 +210,13 @@ case gdcm::PixelFormat::UINT8: return OrthancPluginPixelFormat_RGB24; + case gdcm::PixelFormat::UINT16: +#if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 3, 1) + return OrthancPluginPixelFormat_RGB48; +#else + throw std::runtime_error("RGB48 pixel format is only supported by Orthanc >= 1.3.1"); +#endif + default: break; }