From: cristy Date: Sun, 11 Jan 2015 16:40:57 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69bab0f3071fcfb617e50dbc642edb2e3bf571c3;p=imagemagick --- diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h index 2b9b0603b..83716f0bb 100644 --- a/MagickCore/pixel-accessor.h +++ b/MagickCore/pixel-accessor.h @@ -31,6 +31,19 @@ extern "C" { #undef index +static inline Quantum ClampPixel(const MagickRealType value) +{ + if (value < 0.0f) + return(0); + if (value >= (MagickRealType) QuantumRange) + return((Quantum) QuantumRange); +#if !defined(MAGICKCORE_HDRI_SUPPORT) + return((Quantum) (value+0.5f)); +#else + return((Quantum) value); +#endif +} + static inline Quantum GetPixela(const Image *restrict image, const Quantum *restrict pixel) { diff --git a/MagickCore/pixel-private.h b/MagickCore/pixel-private.h index 43ba82fa2..763e4be7e 100644 --- a/MagickCore/pixel-private.h +++ b/MagickCore/pixel-private.h @@ -22,19 +22,6 @@ extern "C" { #endif -static inline Quantum ClampPixel(const MagickRealType value) -{ -#if !defined(MAGICKCORE_HDRI_SUPPORT) - return((Quantum) value); -#else - if (value < 0.0) - return((Quantum) 0.0); - if (value >= (MagickRealType) QuantumRange) - return((Quantum) QuantumRange); - return((Quantum) value); -#endif -} - static inline double PerceptibleReciprocal(const double x) { double