]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 11 Jan 2015 16:40:57 +0000 (16:40 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 11 Jan 2015 16:40:57 +0000 (16:40 +0000)
MagickCore/pixel-accessor.h
MagickCore/pixel-private.h

index 2b9b0603baf4cab0ff1a6528e74c3c3b6ce5e60c..83716f0bbe55fe5ddbc68ede34de4b06ba6f4133 100644 (file)
@@ -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)
 {
index 43ba82fa2dbb31195f25542701b3d07d8d6faee3..763e4be7e8bbf758a5cd186a6635f36fc87fde38 100644 (file)
 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