# HG changeset patch # User Sebastien Jodogne # Date 1507631882 -7200 # Node ID 7ef9207f31d44c34133694c8faac8f43e1d43287 # Parent 5a7c5c541a1df8003ca2239a283b4583a8026fee New pixel formats exposed in plugin SDK diff -r 5a7c5c541a1d -r 7ef9207f31d4 NEWS --- a/NEWS Mon Oct 09 21:58:08 2017 +0200 +++ b/NEWS Tue Oct 10 12:38:02 2017 +0200 @@ -13,6 +13,11 @@ * New argument "ignore-length" to force the inclusion of too long tags in JSON * New argument "/.../media?extended" to include additional type-3 tags in DICOMDIR +Plugins +------- + +* New pixel formats exposed in SDK: BGRA32, Float32, Grayscale32, RGB48 + Maintenance ----------- diff -r 5a7c5c541a1d -r 7ef9207f31d4 Plugins/Engine/PluginsEnumerations.cpp --- a/Plugins/Engine/PluginsEnumerations.cpp Mon Oct 09 21:58:08 2017 +0200 +++ b/Plugins/Engine/PluginsEnumerations.cpp Tue Oct 10 12:38:02 2017 +0200 @@ -139,15 +139,27 @@ { switch (format) { + case PixelFormat_BGRA32: + return OrthancPluginPixelFormat_BGRA32; + + case PixelFormat_Float32: + return OrthancPluginPixelFormat_Float32; + case PixelFormat_Grayscale16: return OrthancPluginPixelFormat_Grayscale16; + case PixelFormat_Grayscale32: + return OrthancPluginPixelFormat_Grayscale32; + case PixelFormat_Grayscale8: return OrthancPluginPixelFormat_Grayscale8; case PixelFormat_RGB24: return OrthancPluginPixelFormat_RGB24; + case PixelFormat_RGB48: + return OrthancPluginPixelFormat_RGB48; + case PixelFormat_RGBA32: return OrthancPluginPixelFormat_RGBA32; @@ -164,15 +176,27 @@ { switch (format) { + case OrthancPluginPixelFormat_BGRA32: + return PixelFormat_BGRA32; + + case OrthancPluginPixelFormat_Float32: + return PixelFormat_Float32; + case OrthancPluginPixelFormat_Grayscale16: return PixelFormat_Grayscale16; + case OrthancPluginPixelFormat_Grayscale32: + return PixelFormat_Grayscale32; + case OrthancPluginPixelFormat_Grayscale8: return PixelFormat_Grayscale8; case OrthancPluginPixelFormat_RGB24: return PixelFormat_RGB24; + case OrthancPluginPixelFormat_RGB48: + return PixelFormat_RGB48; + case OrthancPluginPixelFormat_RGBA32: return PixelFormat_RGBA32; diff -r 5a7c5c541a1d -r 7ef9207f31d4 Plugins/Include/orthanc/OrthancCPlugin.h --- a/Plugins/Include/orthanc/OrthancCPlugin.h Mon Oct 09 21:58:08 2017 +0200 +++ b/Plugins/Include/orthanc/OrthancCPlugin.h Tue Oct 10 12:38:02 2017 +0200 @@ -118,7 +118,17 @@ #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 3 -#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0 +#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 1 + + +#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 @@ -570,6 +580,38 @@ OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */ + /** + * @brief Color image in RGB48 format. + * + * This format describes a color image. The pixels are stored in 6 + * consecutive bytes. The memory layout is RRGGBB. + **/ + OrthancPluginPixelFormat_RGB48 = 7, + + /** + * @brief Graylevel, unsigned 32bpp image. + * + * The image is graylevel. Each pixel is unsigned and stored in + * four bytes. + **/ + OrthancPluginPixelFormat_Grayscale32 = 8, + + /** + * @brief Graylevel, floating-point 32bpp image. + * + * The image is graylevel. Each pixel is floating-point and stored + * in four bytes. + **/ + OrthancPluginPixelFormat_Float32 = 9, + + /** + * @brief Color image in BGRA32 format. + * + * This format describes a color image. The pixels are stored in 4 + * consecutive bytes. The memory layout is BGRA. + **/ + OrthancPluginPixelFormat_BGRA32 = 10, + _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff } OrthancPluginPixelFormat; diff -r 5a7c5c541a1d -r 7ef9207f31d4 Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Mon Oct 09 21:58:08 2017 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Tue Oct 10 12:38:02 2017 +0200 @@ -44,13 +44,15 @@ +#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 + #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 0) // The "OrthancPluginFindMatcher()" primitive was introduced in Orthanc 1.2.0 diff -r 5a7c5c541a1d -r 7ef9207f31d4 Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp --- a/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Mon Oct 09 21:58:08 2017 +0200 +++ b/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Oct 10 12:38:02 2017 +0200 @@ -199,6 +199,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; }