]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 11 May 2010 01:46:22 +0000 (01:46 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 11 May 2010 01:46:22 +0000 (01:46 +0000)
magick/magick-type.h
magick/quantum.h

index 23b06f023e743bfe97ace6b04f8eedeec11a4c3c..ab8b0b25aa8703ac29ad196285dcc526c56e8ea6 100644 (file)
@@ -97,7 +97,7 @@ typedef double Quantum;
 #define QuantumFormat  "%g"
 #else
 #if !defined(_CH_)
-# error "Specified value of MAGICKCORE_QUANTUM_DEPTH is not supported"
+# error "MAGICKCORE_QUANTUM_DEPTH must be one of 8, 16, 32, or 64"
 #endif
 #endif
 #define MaxRGB  QuantumRange  /* deprecated */
index 75b4dfa57975997b7ed3a0c4601204941fd3a066..330e40d1bd940bef6f5ddd1f1418ee1ab7314ce2 100644 (file)
@@ -137,7 +137,15 @@ static inline unsigned char ScaleQuantumToChar(const Quantum quantum)
 #elif (MAGICKCORE_QUANTUM_DEPTH == 64)
 static inline unsigned char ScaleQuantumToChar(const Quantum quantum)
 {
+#if !defined(MAGICKCORE_HDRI_SUPPORT)
   return((unsigned char) (quantum/72340172838076673.0+0.5));
+#else
+  if (quantum <= 0.0)
+    return(0);
+  if ((quantum/72340172838076673.0) >= 255.0)
+    return(255);
+  return((unsigned char) (quantum/72340172838076673.0+0.5));
+#endif
 }
 #endif