1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Sun, 7 Sep 2025 21:27:45 +0200
Subject: Private alias for easing backport
origin: backport, https://github.com/ImageMagick/ImageMagick/commit/7e5d87fe6e92b6cc3e96d5175974626317512dd9
---
magick/pixel-accessor.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/magick/pixel-accessor.h b/magick/pixel-accessor.h
index c89ae90..683778b 100644
--- a/magick/pixel-accessor.h
+++ b/magick/pixel-accessor.h
@@ -133,7 +133,15 @@ static inline double PerceptibleReciprocal(const double x)
if ((sign*x) >= MagickEpsilon)
return(1.0/x);
return(sign/MagickEpsilon);
-}
+}
+
+static inline double MagickSafeReciprocal(const double x)
+{
+ if ((x > -MagickEpsilon) && (x < MagickEpsilon))
+ return(1.0/MagickEpsilon);
+ return(1.0/x);
+}
+
static inline MagickRealType GetPixelLuma(const Image *magick_restrict image,
const PixelPacket *magick_restrict pixel)
|