# HG changeset patch # User Sebastien Jodogne # Date 1521207326 -3600 # Node ID 465b294a55f03c5aae3aab4fc173302fe7296f12 # Parent 964118e7e6de7beb784a417b1da912d974882d52 typo diff -r 964118e7e6de -r 465b294a55f0 Framework/Toolbox/ImageGeometry.cpp --- a/Framework/Toolbox/ImageGeometry.cpp Fri Mar 16 13:19:23 2018 +0100 +++ b/Framework/Toolbox/ImageGeometry.cpp Fri Mar 16 14:35:26 2018 +0100 @@ -47,7 +47,7 @@ } - bool GetPerpectiveTransformExtent(unsigned int& x1, + bool GetProjectiveTransformExtent(unsigned int& x1, unsigned int& y1, unsigned int& x2, unsigned int& y2, @@ -201,7 +201,7 @@ unsigned int x1, y1, x2, y2; - if (GetPerpectiveTransformExtent(x1, y1, x2, y2, a, + if (GetProjectiveTransformExtent(x1, y1, x2, y2, a, source.GetWidth(), source.GetHeight(), target.GetWidth(), target.GetHeight())) { @@ -360,10 +360,10 @@ template - static void ApplyPerspectiveInternal(Orthanc::ImageAccessor& target, - const Orthanc::ImageAccessor& source, - const Matrix& a, - const Matrix& inva) + static void ApplyProjectiveInternal(Orthanc::ImageAccessor& target, + const Orthanc::ImageAccessor& source, + const Matrix& a, + const Matrix& inva) { assert(target.GetFormat() == Format && source.GetFormat() == Format); @@ -377,7 +377,7 @@ const float floatWidth = source.GetWidth(); const float floatHeight = source.GetHeight(); - if (GetPerpectiveTransformExtent(x1, y1, x2, y2, a, + if (GetProjectiveTransformExtent(x1, y1, x2, y2, a, source.GetWidth(), source.GetHeight(), target.GetWidth(), target.GetHeight())) { @@ -403,7 +403,7 @@ // Make sure no integer overflow will occur after truncation // (the static_cast could otherwise throw an - // exception in WebAssembly if strong perspective effects) + // exception in WebAssembly if strong projective effects) if (sourceX < floatWidth && sourceY < floatHeight) { @@ -423,10 +423,10 @@ } - void ApplyPerspectiveTransform(Orthanc::ImageAccessor& target, - const Orthanc::ImageAccessor& source, - const Matrix& a, - ImageInterpolation interpolation) + void ApplyProjectiveTransform(Orthanc::ImageAccessor& target, + const Orthanc::ImageAccessor& source, + const Matrix& a, + ImageInterpolation interpolation) { if (source.GetFormat() != target.GetFormat()) { @@ -452,7 +452,7 @@ double w = a(2, 2); if (LinearAlgebra::IsCloseToZero(w)) { - LOG(ERROR) << "Singular perspective matrix"; + LOG(ERROR) << "Singular projective matrix"; throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } else @@ -486,13 +486,13 @@ switch (interpolation) { case ImageInterpolation_Nearest: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; case ImageInterpolation_Bilinear: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; default: @@ -504,13 +504,13 @@ switch (interpolation) { case ImageInterpolation_Nearest: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; case ImageInterpolation_Bilinear: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; default: @@ -522,13 +522,13 @@ switch (interpolation) { case ImageInterpolation_Nearest: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; case ImageInterpolation_Bilinear: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; default: @@ -540,8 +540,8 @@ switch (interpolation) { case ImageInterpolation_Nearest: - ApplyPerspectiveInternal(target, source, a, inva); + ApplyProjectiveInternal(target, source, a, inva); break; default: diff -r 964118e7e6de -r 465b294a55f0 Framework/Toolbox/ImageGeometry.h --- a/Framework/Toolbox/ImageGeometry.h Fri Mar 16 13:19:23 2018 +0100 +++ b/Framework/Toolbox/ImageGeometry.h Fri Mar 16 14:35:26 2018 +0100 @@ -32,7 +32,7 @@ // Returns the "useful" portion of the target image when applying a // 3x3 perspective transform "a" (i.e. the bounding box where points // of the source image are mapped to) - bool GetPerpectiveTransformExtent(unsigned int& x1, + bool GetProjectiveTransformExtent(unsigned int& x1, unsigned int& y1, unsigned int& x2, unsigned int& y2, @@ -52,8 +52,8 @@ double b2, ImageInterpolation interpolation); - void ApplyPerspectiveTransform(Orthanc::ImageAccessor& target, - const Orthanc::ImageAccessor& source, - const Matrix& a, - ImageInterpolation interpolation); + void ApplyProjectiveTransform(Orthanc::ImageAccessor& target, + const Orthanc::ImageAccessor& source, + const Matrix& a, + ImageInterpolation interpolation); }