changeset 394:14303bf258b0 default tip

relax IsNear() for arm64, ppc64el, riscv64 and s390x, cf. Debian #1104044
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 27 Apr 2025 20:27:54 +0200 (10 hours ago)
parents 0fb1c1e6373f
children
files Framework/ImageToolbox.cpp ViewerPlugin/Plugin.cpp
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/ImageToolbox.cpp	Tue Apr 08 16:57:06 2025 +0200
+++ b/Framework/ImageToolbox.cpp	Sun Apr 27 20:27:54 2025 +0200
@@ -48,7 +48,7 @@
     bool IsNear(double a,
                 double b)
     {
-      return std::abs(a - b) < 10.0 * std::numeric_limits<float>::epsilon();
+      return std::abs(a - b) < 100.0 * std::numeric_limits<double>::epsilon();
     }
 
 
--- a/ViewerPlugin/Plugin.cpp	Tue Apr 08 16:57:06 2025 +0200
+++ b/ViewerPlugin/Plugin.cpp	Sun Apr 27 20:27:54 2025 +0200
@@ -472,17 +472,17 @@
 
       OrthancWSI::LABColor lab;
       if (!OrthancWSI::LABColor::DecodeDicomRecommendedAbsentPixelCIELab(lab, "65535\\0\\0") ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetL(), 100.0f) ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetA(), -128.0f) ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetB(), -128.0f))
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetL(), 100.0) ||
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetA(), -128.0) ||
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetB(), -128.0))
       {
         throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }
 
       if (!OrthancWSI::LABColor::DecodeDicomRecommendedAbsentPixelCIELab(lab, "0\\32896\\65535") ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetL(), 0.0f) ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetA(), 0.0f) ||
-          !OrthancWSI::ImageToolbox::IsNear(lab.GetB(), 127.0f))
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetL(), 0.0) ||
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetA(), 0.0) ||
+          !OrthancWSI::ImageToolbox::IsNear(lab.GetB(), 127.0))
       {
         throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }