Mercurial > hg > orthanc-stone
diff Framework/Toolbox/ShearWarpProjectiveTransform.cpp @ 693:9a474e90e832
Fixed a bunch of truncation warnings in various parts of the library
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Fri, 17 May 2019 08:49:55 +0200 |
parents | 7719eb852dd5 |
children | 059e1fd05fd6 |
line wrap: on
line diff
--- a/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Thu May 16 20:39:30 2019 +0200 +++ b/Framework/Toolbox/ShearWarpProjectiveTransform.cpp Fri May 17 08:49:55 2019 +0200 @@ -195,15 +195,20 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } - intermediateWidth_ = std::ceil(extent.GetWidth() / maxScaling); - intermediateHeight_ = std::ceil(extent.GetHeight() / maxScaling); + intermediateWidth_ = + static_cast<unsigned int>(std::ceil(extent.GetWidth() / maxScaling)); + intermediateHeight_ = + static_cast<unsigned int>(std::ceil(extent.GetHeight() / maxScaling)); // This is the product "T * S" in Equation (A.16) on page 209 Matrix TS = LinearAlgebra::Product( - GeometryToolbox::CreateTranslationMatrix(static_cast<double>(intermediateWidth_) / 2.0, - static_cast<double>(intermediateHeight_) / 2.0, 0), - GeometryToolbox::CreateScalingMatrix(1.0 / maxScaling, 1.0 / maxScaling, 1), - GeometryToolbox::CreateTranslationMatrix(-extent.GetCenterX(), -extent.GetCenterY(), 0)); + GeometryToolbox::CreateTranslationMatrix( + static_cast<double>(intermediateWidth_) / 2.0, + static_cast<double>(intermediateHeight_) / 2.0, 0), + GeometryToolbox::CreateScalingMatrix( + 1.0 / maxScaling, 1.0 / maxScaling, 1), + GeometryToolbox::CreateTranslationMatrix( + -extent.GetCenterX(), -extent.GetCenterY(), 0)); // This is Equation (A.16) on page 209. WARNING: There is an // error in Lacroute's thesis: "inv(MM_shear)" is used instead