comparison OrthancFramework/Sources/Images/ImageProcessing.cpp @ 4056:55727d85f419 framework

fix for msvc2008
author s.jodogne@gmail.com
date Thu, 11 Jun 2020 13:46:57 +0200
parents d25f4c0fa160
children d6362b2c4b61
comparison
equal deleted inserted replaced
4055:9214e3a7b0a2 4056:55727d85f419
58 #include <stdint.h> 58 #include <stdint.h>
59 #include <algorithm> 59 #include <algorithm>
60 60
61 namespace Orthanc 61 namespace Orthanc
62 { 62 {
63 void ImageProcessing::ImagePoint::ClipTo(int32_t minX, int32_t maxX, int32_t minY, int32_t maxY)
64 {
65 x_ = std::max(minX, std::min(maxX, x_));
66 y_ = std::max(minY, std::min(maxY, y_));
67 }
68
63 double ImageProcessing::ImagePoint::GetDistanceTo(const ImagePoint& other) const 69 double ImageProcessing::ImagePoint::GetDistanceTo(const ImagePoint& other) const
64 { 70 {
65 double dx = (double)(other.GetX() - GetX()); 71 double dx = (double)(other.GetX() - GetX());
66 double dy = (double)(other.GetY() - GetY()); 72 double dy = (double)(other.GetY() - GetY());
67 return sqrt(dx * dx + dy * dy); 73 return sqrt(dx * dx + dy * dy);