]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 5 Sep 2010 01:37:25 +0000 (01:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 5 Sep 2010 01:37:25 +0000 (01:37 +0000)
magick/resize.c

index 2219810275c62ac50302784efc4c4ee3564ffa5c..551cc7dbcc7d39cb0b41eab1a50ea4644c8531eb 100644 (file)
@@ -149,9 +149,13 @@ static MagickRealType Blackman(const MagickRealType x,
   const ResizeFilter *magick_unused(resize_filter))
 {
   /*
-    Blackman: 2rd Order cosine windowing function.
+    Blackman: 2rd Order cosine windowing function:
+      0.42 + 0.5 cos(pi x) + 0.08 cos(2pi x)
+      Refactored by Chantal Racette and Nicolas Robidoux so it needs
+      only one trig call and five flops.
   */
-  return(0.42+0.5*cos(MagickPI*(double) x)+0.08*cos(2.0*MagickPI*(double) x));
+  const double alpha = cos(MagickPI*(double) x);
+  return(0.34+alpha*(0.5+alpha*0.16));
 }
 
 static MagickRealType Bohman(const MagickRealType x,