# HG changeset patch # User s.jodogne@gmail.com # Date 1591876017 -7200 # Node ID 55727d85f41936d99eef58961797c87d4acaf991 # Parent 9214e3a7b0a241c3ccfe41023abd76d083dcaf16 fix for msvc2008 diff -r 9214e3a7b0a2 -r 55727d85f419 OrthancFramework/Sources/Images/ImageProcessing.cpp --- 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()); diff -r 9214e3a7b0a2 -r 55727d85f419 OrthancFramework/Sources/Images/ImageProcessing.h --- 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 - #include -#include #include 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; diff -r 9214e3a7b0a2 -r 55727d85f419 OrthancFramework/UnitTestsSources/ImageProcessingTests.cpp --- 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)); diff -r 9214e3a7b0a2 -r 55727d85f419 OrthancServer/Plugins/Engine/OrthancPlugins.cpp --- 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(p.output); - output->SetErrorDetails(p.details, p.log); + output->SetErrorDetails(p.details, (p.log != 0)); }