comparison 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
comparison
equal deleted inserted replaced
692:10910827f235 693:9a474e90e832
193 LinearAlgebra::IsCloseToZero(extent.GetHeight())) 193 LinearAlgebra::IsCloseToZero(extent.GetHeight()))
194 { 194 {
195 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 195 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
196 } 196 }
197 197
198 intermediateWidth_ = std::ceil(extent.GetWidth() / maxScaling); 198 intermediateWidth_ =
199 intermediateHeight_ = std::ceil(extent.GetHeight() / maxScaling); 199 static_cast<unsigned int>(std::ceil(extent.GetWidth() / maxScaling));
200 intermediateHeight_ =
201 static_cast<unsigned int>(std::ceil(extent.GetHeight() / maxScaling));
200 202
201 // This is the product "T * S" in Equation (A.16) on page 209 203 // This is the product "T * S" in Equation (A.16) on page 209
202 Matrix TS = LinearAlgebra::Product( 204 Matrix TS = LinearAlgebra::Product(
203 GeometryToolbox::CreateTranslationMatrix(static_cast<double>(intermediateWidth_) / 2.0, 205 GeometryToolbox::CreateTranslationMatrix(
204 static_cast<double>(intermediateHeight_) / 2.0, 0), 206 static_cast<double>(intermediateWidth_) / 2.0,
205 GeometryToolbox::CreateScalingMatrix(1.0 / maxScaling, 1.0 / maxScaling, 1), 207 static_cast<double>(intermediateHeight_) / 2.0, 0),
206 GeometryToolbox::CreateTranslationMatrix(-extent.GetCenterX(), -extent.GetCenterY(), 0)); 208 GeometryToolbox::CreateScalingMatrix(
209 1.0 / maxScaling, 1.0 / maxScaling, 1),
210 GeometryToolbox::CreateTranslationMatrix(
211 -extent.GetCenterX(), -extent.GetCenterY(), 0));
207 212
208 // This is Equation (A.16) on page 209. WARNING: There is an 213 // This is Equation (A.16) on page 209. WARNING: There is an
209 // error in Lacroute's thesis: "inv(MM_shear)" is used instead 214 // error in Lacroute's thesis: "inv(MM_shear)" is used instead
210 // of "MM_shear". 215 // of "MM_shear".
211 M_shear = LinearAlgebra::Product(TS, MM_shear); 216 M_shear = LinearAlgebra::Product(TS, MM_shear);