vcl/source/bitmap/BitmapSobelGreyFilter.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
New commits: commit 841ab19fb3f68dbab6295459ef11a257f0f022e8 Author: ektagoel12 <ektagoel12j...@gmail.com> AuthorDate: Thu Jan 19 21:51:53 2023 +0530 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Fri Jan 20 12:04:30 2023 +0000 tdf#147906 Use std::hypot for Pythagorean addition Change-Id: I4b16fc7daff2f85ae60666e512636634f7d6eb19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145822 Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Hossein <hoss...@libreoffice.org> diff --git a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx index 80daebedf949..043f9ad12fee 100644 --- a/vcl/source/bitmap/BitmapSobelGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapSobelGreyFilter.cxx @@ -113,8 +113,7 @@ BitmapEx BitmapSobelGreyFilter::execute(BitmapEx const& rBitmapEx) const nSum1 += nMask331 * nGrey33; nSum2 += nMask332 * nGrey33; - nSum1 - = static_cast<sal_Int32>(sqrt(static_cast<double>(nSum1 * nSum1 + nSum2 * nSum2))); + nSum1 = static_cast<sal_Int32>(std::hypot(nSum1, nSum2)); aGrey.SetIndex( ~static_cast<sal_uInt8>(std::clamp(nSum1, sal_Int32(0), sal_Int32(255))));