#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)
{
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