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

index a3dc23d9f72368bad2c834aa71e89f8312bc2c34..eb81af4680a5d1ed40e2d59dd0a666e98556d7b0 100644 (file)
@@ -145,8 +145,8 @@ static MagickRealType Bessel(const MagickRealType x,
     http://www.ph.ed.ac.uk/%7ewjh/teaching/mo/slides/lens/lens.pdf.
   */
   if (x == 0.0)
-    return(0.25*MagickPIL);
-  return(BesselOrderOne(MagickPIL*x)/(x+x));
+    return((MagickRealType) (0.25*MagickPIL));
+  return(BesselOrderOne((MagickRealType) (MagickPIL*x))/(x+x));
 }
 
 static MagickRealType Blackman(const MagickRealType x,
@@ -158,7 +158,7 @@ static MagickRealType Blackman(const MagickRealType x,
     Refactored by Chantal Racette and Nicolas Robidoux to one trig
     call and five flops.
   */
-  const double pix = MagickPIL*x;
+  const double pix = (double) (MagickPIL*x);
   const MagickRealType cospix = cos(pix);
   return(0.34+cospix*(0.5+cospix*0.16));
 }
@@ -170,8 +170,8 @@ static MagickRealType Bohman(const MagickRealType x,
     Bohman: 2rd Order cosine windowing function:
       (1-x) cos(pi x) + sin(pi x) / pi.
   */
-  const double pix = MagickPIL*x;
-  return((1-x)*cos(pix)+(1.0/MagickPIL)*sin(pix));
+  const double pix = (double) (MagickPIL*x);
+  return((MagickRealType) ((1-x)*cos(pix)+(1.0/MagickPIL)*sin(pix)));
 }
 
 static MagickRealType Box(const MagickRealType magick_unused(x),
@@ -231,7 +231,7 @@ static MagickRealType Gaussian(const MagickRealType x,
      1D Gaussian with sigm=1/2
       exp(-2 x^2)/sqrt(pi/2))
   */
-  const MagickRealType alpha = 2.0/MagickSQ2PI;
+  const MagickRealType alpha = (MagickRealType) (2.0/MagickSQ2PI);
   return(exp(-(double)(2.0*x*x))*alpha);
 }
 
@@ -241,7 +241,7 @@ static MagickRealType Hanning(const MagickRealType x,
   /*
     Cosine window function: .5 + .5 cos(pi x).
   */
-  const double pix = MagickPIL*x;
+  const double pix = (double) (MagickPIL*x);
   const MagickRealType cospix = cos(pix);
   return(0.5+0.5*cospix);
 }
@@ -252,7 +252,7 @@ static MagickRealType Hamming(const MagickRealType x,
   /*
     Offset cosine window function: .54 + .46 cos(pi x).
   */
-  const double pix = MagickPIL*x;
+  const double pix = (double) (MagickPIL*x);
   const MagickRealType cospix = cos(pix);
   return(0.54+0.46*cospix);
 }
@@ -415,7 +415,7 @@ static MagickRealType Sinc(const MagickRealType x,
   if (x == 0.0)
     return(1.0);
   {
-    const MagickRealType pix = MagickPIL*x;
+    const MagickRealType pix = (MagickRealType) (MagickPIL*x);
     const MagickRealType sinpix = sin((double) pix);
     return(sinpix/pix);
   }
@@ -433,7 +433,7 @@ static MagickRealType SincPolynomial(const MagickRealType x,
   const MagickRealType xx = x*x;
   if (xx > 16.0)
     {
-      const MagickRealType pix = MagickPIL*x;
+      const MagickRealType pix = (MagickRealType) (MagickPIL*x);
       const MagickRealType sinpix = sin((double) pix);
       return(sinpix/pix);
     }