changeset 4056:55727d85f419 framework

fix for msvc2008
author s.jodogne@gmail.com
date Thu, 11 Jun 2020 13:46:57 +0200
parents 9214e3a7b0a2
children 8b7cd69806f2
files OrthancFramework/Sources/Images/ImageProcessing.cpp OrthancFramework/Sources/Images/ImageProcessing.h OrthancFramework/UnitTestsSources/ImageProcessingTests.cpp OrthancServer/Plugins/Engine/OrthancPlugins.cpp
diffstat 4 files changed, 25 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Images/ImageProcessing.cpp	Thu Jun 11 12:52:09 2020 +0200
+++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp	Thu Jun 11 13:46:57 2020 +0200
@@ -60,6 +60,12 @@
 
 namespace Orthanc
 {
+  void ImageProcessing::ImagePoint::ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY)
+  {
+    x_ = std::max(minX, std::min(maxX, x_));
+    y_ = std::max(minY, std::min(maxY, y_));
+  }
+
   double ImageProcessing::ImagePoint::GetDistanceTo(const ImagePoint& other) const
   {
     double dx = (double)(other.GetX() - GetX());
--- a/OrthancFramework/Sources/Images/ImageProcessing.h	Thu Jun 11 12:52:09 2020 +0200
+++ b/OrthancFramework/Sources/Images/ImageProcessing.h	Thu Jun 11 13:46:57 2020 +0200
@@ -36,10 +36,9 @@
 #include "../OrthancFramework.h"
 
 #include "ImageAccessor.h"
+
 #include <vector>
-
 #include <stdint.h>
-#include <algorithm>
 #include <boost/noncopyable.hpp>
 
 namespace Orthanc
@@ -47,21 +46,28 @@
   class ORTHANC_PUBLIC ImageProcessing : public boost::noncopyable
   {
   public:
-    class ImagePoint
+    class ORTHANC_PUBLIC ImagePoint
     {
       int32_t x_;
       int32_t y_;
       
     public:
-      ImagePoint(int32_t x, int32_t y)
-        : x_(x),
-          y_(y)
+      ImagePoint(int32_t x, 
+        int32_t y) : 
+        x_(x),
+        y_(y)
       {
       }
 
-      int32_t GetX() const {return x_;}
+      int32_t GetX() const
+      {
+        return x_;
+      }
 
-      int32_t GetY() const {return y_;}
+      int32_t GetY() const
+      {
+        return y_;
+      }
 
       void Set(int32_t x, int32_t y)
       {
@@ -69,11 +75,7 @@
         y_ = y;
       }
 
-      void ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY)
-      {
-        x_ = std::max(minX, std::min(maxX, x_));
-        y_ = std::max(minY, std::min(maxY, y_));
-      }
+      void ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY);
 
       double GetDistanceTo(const ImagePoint& other) const;
 
--- a/OrthancFramework/UnitTestsSources/ImageProcessingTests.cpp	Thu Jun 11 12:52:09 2020 +0200
+++ b/OrthancFramework/UnitTestsSources/ImageProcessingTests.cpp	Thu Jun 11 13:46:57 2020 +0200
@@ -972,7 +972,7 @@
   SetGrayscale8Pixel(image, 3, 0, 10);
   SetGrayscale8Pixel(image, 4, 0, 255);
 
-  ImageProcessing::ShiftScale(image, -1.1, 1.5, true);
+  ImageProcessing::ShiftScale(image, -1.1f, 1.5f, true);
   ASSERT_TRUE(TestGrayscale8Pixel(image, 0, 0, 0));
   ASSERT_TRUE(TestGrayscale8Pixel(image, 1, 0, 1));
   ASSERT_TRUE(TestGrayscale8Pixel(image, 2, 0, 6));
@@ -990,7 +990,7 @@
   SetGrayscale16Pixel(image, 3, 0, 10);
   SetGrayscale16Pixel(image, 4, 0, 255);
 
-  ImageProcessing::ShiftScale(image, -1.1, 1.5, true);
+  ImageProcessing::ShiftScale(image, -1.1f, 1.5f, true);
   ASSERT_TRUE(TestGrayscale16Pixel(image, 0, 0, 0));
   ASSERT_TRUE(TestGrayscale16Pixel(image, 1, 0, 1));
   ASSERT_TRUE(TestGrayscale16Pixel(image, 2, 0, 6));
@@ -1008,7 +1008,7 @@
   SetSignedGrayscale16Pixel(image, 3, 0, 10);
   SetSignedGrayscale16Pixel(image, 4, 0, 255);
 
-  ImageProcessing::ShiftScale(image, -17.1, 11.5, true);
+  ImageProcessing::ShiftScale(image, -17.1f, 11.5f, true);
   ASSERT_TRUE(TestSignedGrayscale16Pixel(image, 0, 0, -197));
   ASSERT_TRUE(TestSignedGrayscale16Pixel(image, 1, 0, -174));
   ASSERT_TRUE(TestSignedGrayscale16Pixel(image, 2, 0, -139));
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Thu Jun 11 12:52:09 2020 +0200
+++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Thu Jun 11 13:46:57 2020 +0200
@@ -2296,7 +2296,7 @@
 
     PImpl::PluginHttpOutput* output =
       reinterpret_cast<PImpl::PluginHttpOutput*>(p.output);
-    output->SetErrorDetails(p.details, p.log);
+    output->SetErrorDetails(p.details, (p.log != 0));
   }