Mercurial > hg > orthanc
comparison Core/Images/ImageProcessing.cpp @ 3265:59a184cbb596
ImagePoint::Set + GetDistanceTo
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 20 Feb 2019 14:17:52 +0100 |
parents | 6f9398eb902d |
children | a15a4b9d8c00 |
comparison
equal
deleted
inserted
replaced
3264:3af3b74fbd5c | 3265:59a184cbb596 |
---|---|
45 #include <stdint.h> | 45 #include <stdint.h> |
46 #include <algorithm> | 46 #include <algorithm> |
47 | 47 |
48 namespace Orthanc | 48 namespace Orthanc |
49 { | 49 { |
50 double ImageProcessing::ImagePoint::GetDistanceTo(const ImagePoint& other) const | |
51 { | |
52 double dx = (double)(other.GetX() - GetX()); | |
53 double dy = (double)(other.GetY() - GetY()); | |
54 return sqrt(dx * dx + dy * dy); | |
55 } | |
56 | |
50 template <typename TargetType, typename SourceType> | 57 template <typename TargetType, typename SourceType> |
51 static void ConvertInternal(ImageAccessor& target, | 58 static void ConvertInternal(ImageAccessor& target, |
52 const ImageAccessor& source) | 59 const ImageAccessor& source) |
53 { | 60 { |
54 const TargetType minValue = std::numeric_limits<TargetType>::min(); | 61 const TargetType minValue = std::numeric_limits<TargetType>::min(); |