# HG changeset patch # User Sebastien Jodogne # Date 1527843066 -7200 # Node ID 193ef9c1b731a02396a18132a3ed3ecf62533e4b # Parent e1893d31652a46b2336ee5281043f181b53a1dc0# Parent 89b7893665963401774a57ffdb71eaa4b10a1f9a integration mainline->jobs diff -r e1893d31652a -r 193ef9c1b731 Core/Enumerations.cpp --- a/Core/Enumerations.cpp Thu May 31 18:44:05 2018 +0200 +++ b/Core/Enumerations.cpp Fri Jun 01 10:51:06 2018 +0200 @@ -762,6 +762,9 @@ case PixelFormat_Grayscale32: return "Grayscale (unsigned 32bpp)"; + case PixelFormat_Grayscale64: + return "Grayscale (unsigned 64bpp)"; + case PixelFormat_RGB48: return "RGB48"; @@ -1523,6 +1526,9 @@ case PixelFormat_RGB48: return 6; + case PixelFormat_Grayscale64: + return 8; + default: throw OrthancException(ErrorCode_ParameterOutOfRange); } diff -r e1893d31652a -r 193ef9c1b731 Core/Enumerations.h --- a/Core/Enumerations.h Thu May 31 18:44:05 2018 +0200 +++ b/Core/Enumerations.h Fri Jun 01 10:51:06 2018 +0200 @@ -225,7 +225,13 @@ * {description}{This format describes a color image. The pixels are stored in 6 * consecutive bytes. The memory layout is RGB.} **/ - PixelFormat_RGB48 = 9 + PixelFormat_RGB48 = 9, + + /** + * {summary}{Graylevel, unsigned 64bpp image.} + * {description}{The image is graylevel. Each pixel is unsigned and stored in 4 bytes.} + **/ + PixelFormat_Grayscale64 = 10 }; diff -r e1893d31652a -r 193ef9c1b731 Core/Images/ImageAccessor.cpp --- a/Core/Images/ImageAccessor.cpp Thu May 31 18:44:05 2018 +0200 +++ b/Core/Images/ImageAccessor.cpp Fri Jun 01 10:51:06 2018 +0200 @@ -222,6 +222,10 @@ ToMatlabStringInternal(buffer, *this); break; + case PixelFormat_Grayscale64: + ToMatlabStringInternal(buffer, *this); + break; + case PixelFormat_SignedGrayscale16: ToMatlabStringInternal(buffer, *this); break; diff -r e1893d31652a -r 193ef9c1b731 Core/Images/ImageProcessing.cpp --- a/Core/Images/ImageProcessing.cpp Thu May 31 18:44:05 2018 +0200 +++ b/Core/Images/ImageProcessing.cpp Fri Jun 01 10:51:06 2018 +0200 @@ -705,6 +705,17 @@ } return; + case PixelFormat_Grayscale64: + if (value == 0) + { + memset(image.GetBuffer(), 0, image.GetPitch() * image.GetHeight()); + } + else + { + SetInternal(image, value); + } + return; + case PixelFormat_SignedGrayscale16: if (value == 0) { diff -r e1893d31652a -r 193ef9c1b731 Core/Images/PixelTraits.h --- a/Core/Images/PixelTraits.h Thu May 31 18:44:05 2018 +0200 +++ b/Core/Images/PixelTraits.h Fri Jun 01 10:51:06 2018 +0200 @@ -150,6 +150,20 @@ template <> + struct PixelTraits : + public IntegerPixelTraits + { + }; + + + template <> + struct PixelTraits : + public IntegerPixelTraits + { + }; + + + template <> struct PixelTraits { struct PixelType @@ -264,4 +278,57 @@ target.alpha_ = 255; } }; + + + template <> + struct PixelTraits + { + typedef float PixelType; + + ORTHANC_FORCE_INLINE + static PixelFormat GetPixelFormat() + { + return PixelFormat_Float32; + } + + ORTHANC_FORCE_INLINE + static void SetZero(PixelType& target) + { + target = 0.0f; + } + + ORTHANC_FORCE_INLINE + static void Copy(PixelType& target, + const PixelType& source) + { + target = source; + } + + ORTHANC_FORCE_INLINE + static bool IsEqual(const PixelType& a, + const PixelType& b) + { + float tmp = (a - b); + + if (tmp < 0) + { + tmp = -tmp; + } + + return tmp <= std::numeric_limits::epsilon(); + } + + ORTHANC_FORCE_INLINE + static void FloatToPixel(PixelType& target, + float value) + { + target = value; + } + + ORTHANC_FORCE_INLINE + static float PixelToFloat(const PixelType& source) + { + return source; + } + }; } diff -r e1893d31652a -r 193ef9c1b731 OrthancServer/LuaScripting.cpp diff -r e1893d31652a -r 193ef9c1b731 Plugins/Engine/PluginsEnumerations.cpp --- a/Plugins/Engine/PluginsEnumerations.cpp Thu May 31 18:44:05 2018 +0200 +++ b/Plugins/Engine/PluginsEnumerations.cpp Fri Jun 01 10:51:06 2018 +0200 @@ -151,6 +151,9 @@ case PixelFormat_Grayscale32: return OrthancPluginPixelFormat_Grayscale32; + case PixelFormat_Grayscale64: + return OrthancPluginPixelFormat_Grayscale64; + case PixelFormat_Grayscale8: return OrthancPluginPixelFormat_Grayscale8; @@ -188,6 +191,9 @@ case OrthancPluginPixelFormat_Grayscale32: return PixelFormat_Grayscale32; + case OrthancPluginPixelFormat_Grayscale64: + return PixelFormat_Grayscale64; + case OrthancPluginPixelFormat_Grayscale8: return PixelFormat_Grayscale8; diff -r e1893d31652a -r 193ef9c1b731 Plugins/Include/orthanc/OrthancCPlugin.h --- a/Plugins/Include/orthanc/OrthancCPlugin.h Thu May 31 18:44:05 2018 +0200 +++ b/Plugins/Include/orthanc/OrthancCPlugin.h Fri Jun 01 10:51:06 2018 +0200 @@ -117,8 +117,8 @@ #endif #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1 -#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 3 -#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 2 +#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 4 +#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) @@ -614,6 +614,14 @@ **/ OrthancPluginPixelFormat_BGRA32 = 10, + /** + * @brief Graylevel, unsigned 64bpp image. + * + * The image is graylevel. Each pixel is unsigned and stored in + * eight bytes. + **/ + OrthancPluginPixelFormat_Grayscale64 = 11, + _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff } OrthancPluginPixelFormat;