Mercurial > hg > orthanc
diff 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 |
line wrap: on
line diff
--- a/Core/Images/ImageProcessing.cpp Wed Feb 20 12:34:33 2019 +0100 +++ b/Core/Images/ImageProcessing.cpp Wed Feb 20 14:17:52 2019 +0100 @@ -47,6 +47,13 @@ namespace Orthanc { + double ImageProcessing::ImagePoint::GetDistanceTo(const ImagePoint& other) const + { + double dx = (double)(other.GetX() - GetX()); + double dy = (double)(other.GetY() - GetY()); + return sqrt(dx * dx + dy * dy); + } + template <typename TargetType, typename SourceType> static void ConvertInternal(ImageAccessor& target, const ImageAccessor& source)