]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 3 Jun 2012 15:12:30 +0000 (15:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 3 Jun 2012 15:12:30 +0000 (15:12 +0000)
17 files changed:
MagickCore/accelerate.c
MagickCore/colorspace.c
MagickCore/compare.c
MagickCore/composite-private.h
MagickCore/composite.c
MagickCore/distort.c
MagickCore/draw.c
MagickCore/effect.c
MagickCore/feature.c
MagickCore/image.c
MagickCore/pixel-private.h
MagickCore/pixel.c
MagickCore/quantize.c
MagickCore/quantum-import.c
MagickCore/resize.c
coders/pango.c
coders/svg.c

index eab0b31cb7cf71c0f7771c184ddaa6f38342fac9..5bbbdecabf2eec1ac973c8d706edbd75f9da074c 100644 (file)
@@ -295,7 +295,7 @@ static const char
     "      break;\n"
     "    }\n"
     "  }\n"
-    "  gamma=MagickReciprocal(gamma);\n"
+    "  gamma=MagickEpsilonReciprocal(gamma);\n"
     "  const unsigned long index = y*columns+x;\n"
     "  output[index].x=ClampToQuantum(gamma*sum.x);\n"
     "  output[index].y=ClampToQuantum(gamma*sum.y);\n"
index c558a82c6086e8020e2a5a65e410ab75e1708aa9..1fcff7666fa0f5adc46fb7ce50039f0c7b4590a8 100644 (file)
@@ -642,7 +642,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       gamma=DisplayGamma;
       value=GetImageProperty(image,"gamma",exception);
       if (value != (const char *) NULL)
-        gamma=MagickReciprocal(StringToDouble(value,(char **) NULL));
+        gamma=MagickEpsilonReciprocal(StringToDouble(value,(char **) NULL));
       film_gamma=FilmGamma;
       value=GetImageProperty(image,"film-gamma",exception);
       if (value != (const char *) NULL)
@@ -2150,7 +2150,7 @@ static MagickBooleanType TransformsRGBImage(Image *image,
       gamma=DisplayGamma;
       value=GetImageProperty(image,"gamma",exception);
       if (value != (const char *) NULL)
-        gamma=MagickReciprocal(StringToDouble(value,(char **) NULL));
+        gamma=MagickEpsilonReciprocal(StringToDouble(value,(char **) NULL));
       film_gamma=FilmGamma;
       value=GetImageProperty(image,"film-gamma",exception);
       if (value != (const char *) NULL)
index d9060807503364494f2df19343ba865f25f8e916..b2cd11e4645bca486ea8f42a024fbe0f1308759d 100644 (file)
@@ -950,7 +950,7 @@ static MagickBooleanType GetNormalizedCrossCorrelationDistortion(
     channel=GetPixelChannelMapChannel(image,i);
     gamma=image_statistics[i].standard_deviation*
       reconstruct_statistics[channel].standard_deviation;
-    gamma=MagickReciprocal(gamma);
+    gamma=MagickEpsilonReciprocal(gamma);
     distortion[i]=QuantumRange*gamma*distortion[i];
     distortion[CompositePixelChannel]+=distortion[i]*distortion[i];
   }
index c0c9a7d30e7b5f1008a9058323dbc0f7f04acd16..6204057474e5a6b711f4e0ac4a88b8d93b8e403f 100644 (file)
@@ -62,7 +62,7 @@ static inline void CompositePixelOver(const Image *image,const PixelInfo *p,
   Sa=QuantumScale*alpha;
   Da=QuantumScale*beta,
   gamma=Sa*(-Da)+Sa+Da;
-  gamma=MagickReciprocal(gamma);
+  gamma=MagickEpsilonReciprocal(gamma);
   for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
   {
     PixelChannel
@@ -133,7 +133,7 @@ static inline void CompositePixelInfoOver(const PixelInfo *p,
   Da=QuantumScale*beta,
   gamma=Sa*(-Da)+Sa+Da;
   composite->alpha=(MagickRealType) QuantumRange*gamma;
-  gamma=MagickReciprocal(gamma);
+  gamma=MagickEpsilonReciprocal(gamma);
   composite->red=gamma*MagickOver_(p->red,alpha,q->red,beta);
   composite->green=gamma*MagickOver_(p->green,alpha,q->green,beta);
   composite->blue=gamma*MagickOver_(p->blue,alpha,q->blue,beta);
@@ -162,7 +162,7 @@ static inline void CompositePixelInfoPlus(const PixelInfo *p,
   Da=QuantumScale*beta;
   gamma=RoundToUnity(Sa+Da);  /* 'Plus' blending -- not 'Over' blending */
   composite->alpha=(MagickRealType) QuantumRange*gamma;
-  gamma=MagickReciprocal(gamma);
+  gamma=MagickEpsilonReciprocal(gamma);
   composite->red=gamma*(Sa*p->red+Da*q->red);
   composite->green=gamma*(Sa*p->green+Da*q->green);
   composite->blue=gamma*(Sa*p->blue+Da*q->blue);
index 8f810a6801ef804a8fa7fc745023b39927fc6d6e..64f5afb8b8f136ce704da46205c35efeadc1187e 100644 (file)
@@ -502,7 +502,7 @@ static MagickBooleanType CompositeOverImage(Image *image,
         */
         Sc=(MagickRealType) GetPixelChannel(composite_image,channel,p);
         Dc=(MagickRealType) q[i];
-        gamma=MagickReciprocal(alpha);
+        gamma=MagickEpsilonReciprocal(alpha);
         q[i]=ClampToQuantum(gamma*(Sa*Sc-Sa*Da*Dc+Da*Dc));
       }
       p+=GetPixelChannels(composite_image);
@@ -1649,7 +1649,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
           default:
             break;
         }
-        gamma=MagickReciprocal(alpha);
+        gamma=MagickEpsilonReciprocal(alpha);
         pixel=Dc;
         switch (compose)
         {
index 96dc6829edba4cf3db45466dda43368ade09d678..5c77784fce00040e328d0f3e0dd654a1b5439e75 100644 (file)
@@ -1798,28 +1798,28 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
         s.x = (double) image->page.x;
         s.y = (double) image->page.y;
         scale=inverse[6]*s.x+inverse[7]*s.y+1.0;
-        scale=MagickReciprocal(scale);
+        scale=MagickEpsilonReciprocal(scale);
         d.x = scale*(inverse[0]*s.x+inverse[1]*s.y+inverse[2]);
         d.y = scale*(inverse[3]*s.x+inverse[4]*s.y+inverse[5]);
         InitalBounds(d);
         s.x = (double) image->page.x+image->columns;
         s.y = (double) image->page.y;
         scale=inverse[6]*s.x+inverse[7]*s.y+1.0;
-        scale=MagickReciprocal(scale);
+        scale=MagickEpsilonReciprocal(scale);
         d.x = scale*(inverse[0]*s.x+inverse[1]*s.y+inverse[2]);
         d.y = scale*(inverse[3]*s.x+inverse[4]*s.y+inverse[5]);
         ExpandBounds(d);
         s.x = (double) image->page.x;
         s.y = (double) image->page.y+image->rows;
         scale=inverse[6]*s.x+inverse[7]*s.y+1.0;
-        scale=MagickReciprocal(scale);
+        scale=MagickEpsilonReciprocal(scale);
         d.x = scale*(inverse[0]*s.x+inverse[1]*s.y+inverse[2]);
         d.y = scale*(inverse[3]*s.x+inverse[4]*s.y+inverse[5]);
         ExpandBounds(d);
         s.x = (double) image->page.x+image->columns;
         s.y = (double) image->page.y+image->rows;
         scale=inverse[6]*s.x+inverse[7]*s.y+1.0;
-        scale=MagickReciprocal(scale);
+        scale=MagickEpsilonReciprocal(scale);
         d.x = scale*(inverse[0]*s.x+inverse[1]*s.y+inverse[2]);
         d.y = scale*(inverse[3]*s.x+inverse[4]*s.y+inverse[5]);
         ExpandBounds(d);
index 4b2b82b0657cc7f62d96486e18dddc00396de6cc..a654d0cd9923290354debf61fb6e2bd8bfe31c70 100644 (file)
@@ -3180,7 +3180,7 @@ static inline MagickRealType GetStopColorOffset(const GradientInfo *gradient,
       q.y=(double) y-gradient_vector->y1;
       length=sqrt(q.x*q.x+q.y*q.y);
       gamma=sqrt(p.x*p.x+p.y*p.y)*length;
-      gamma=MagickReciprocal(gamma);
+      gamma=MagickEpsilonReciprocal(gamma);
       scale=p.x*q.x+p.y*q.y;
       offset=gamma*scale*length;
       return(offset);
index 9b74f329dee843252b07a42a0ef901d338edfe2b..14f3866562149220b8c11e1759cb05085956c894 100644 (file)
@@ -408,7 +408,7 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius,
                 pixels+=GetPixelChannels(image);
               }
             }
-            gamma=MagickReciprocal(gamma);
+            gamma=MagickEpsilonReciprocal(gamma);
             SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
             continue;
           }
@@ -426,7 +426,7 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,const double radius,
             pixels+=GetPixelChannels(image);
           }
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       q+=GetPixelChannels(blur_image);
@@ -735,7 +735,7 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
                 pixels+=GetPixelChannels(image);
               }
             }
-            gamma=MagickReciprocal(gamma);
+            gamma=MagickEpsilonReciprocal(gamma);
             SetPixelChannel(sharp_image,channel,ClampToQuantum(gamma*pixel),q);
             continue;
           }
@@ -753,7 +753,7 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
             pixels+=GetPixelChannels(image);
           }
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(sharp_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       q+=GetPixelChannels(sharp_image);
@@ -1051,7 +1051,7 @@ MagickExport Image *BlurImage(const Image *image,const double radius,
           k++;
           pixels+=GetPixelChannels(image);
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       p+=GetPixelChannels(image);
@@ -1181,7 +1181,7 @@ MagickExport Image *BlurImage(const Image *image,const double radius,
           k++;
           pixels+=GetPixelChannels(blur_image);
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       p+=GetPixelChannels(blur_image);
@@ -2060,7 +2060,7 @@ MagickExport Image *MotionBlurImage(const Image *image,const double radius,
           gamma+=(*k)*alpha;
           k++;
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       p+=GetPixelChannels(image);
@@ -2843,7 +2843,7 @@ MagickExport Image *RadialBlurImage(const Image *image,const double angle,
               pixel+=r[i];
               gamma++;
             }
-            gamma=MagickReciprocal(gamma);
+            gamma=MagickEpsilonReciprocal(gamma);
             SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
             continue;
           }
@@ -2861,7 +2861,7 @@ MagickExport Image *RadialBlurImage(const Image *image,const double angle,
           pixel+=GetPixelAlpha(image,r)*r[i];
           gamma+=GetPixelAlpha(image,r);
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       p+=GetPixelChannels(image);
@@ -3139,7 +3139,7 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius,
                 SetPixelChannel(blur_image,channel,p[center+i],q);
                 continue;
               }
-            gamma=MagickReciprocal(gamma);
+            gamma=MagickEpsilonReciprocal(gamma);
             SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
             continue;
           }
@@ -3165,7 +3165,7 @@ MagickExport Image *SelectiveBlurImage(const Image *image,const double radius,
             SetPixelChannel(blur_image,channel,p[center+i],q);
             continue;
           }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(blur_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       p+=GetPixelChannels(image);
index 863be65bed8e8ed076aecb1bcf75e6c6d44fe49f..73af2196298d5f4a76ffa79b20334aae012d8a30 100644 (file)
@@ -572,7 +572,7 @@ MagickExport ChannelFeatures *GetImageFeatures(const Image *image,
         break;
       }
     }
-    normalize=MagickReciprocal(normalize);
+    normalize=MagickEpsilonReciprocal(normalize);
     for (y=0; y < (ssize_t) number_grays; y++)
     {
       register ssize_t
index c0aea2c983fb3e296e0a921d03476c6c2f14f1ac..e4ab882d7edf216567fc8c73684e856195d267c0 100644 (file)
@@ -2087,7 +2087,7 @@ static inline void FlattenPixelInfo(const Image *image,const PixelInfo *p,
   Sa=QuantumScale*alpha;
   Da=QuantumScale*beta,
   gamma=Sa*(-Da)+Sa+Da;
-  gamma=MagickReciprocal(gamma);
+  gamma=MagickEpsilonReciprocal(gamma);
   for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
   {
     PixelChannel
index f7d3e46f7b37433901b811a5c47f3d743c9e2857..ec296e2453ec8762398cdbab92a78deaa3d3e1a7 100644 (file)
@@ -22,7 +22,7 @@
 extern "C" {
 #endif
 
-static inline MagickRealType MagickReciprocal(const MagickRealType x)
+static inline MagickRealType MagickEpsilonReciprocal(const MagickRealType x)
 {
   return((MagickRealType) 1.0/(((x) > (MagickRealType) 0.0 ? (x) : -(x)) <
     MagickEpsilon ? MagickEpsilon : x));
index 2eab8648ed588932a67a18cfe43a8a2e2711a3e9..996cd1b7fc574aaa2ee77bb6c65de257c762acc5 100644 (file)
@@ -4136,7 +4136,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
         }
       for (i=0; i < 16; i++)
       {
-        gamma=MagickReciprocal(alpha[i]);
+        gamma=MagickEpsilonReciprocal(alpha[i]);
         *pixel+=gamma*0.0625*pixels[i];
       }
       break;
@@ -4199,7 +4199,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
       */
       gamma=1.0;
       if (channel != AlphaPixelChannel)
-        gamma=MagickReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
+        gamma=MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
           alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+
           cx[2]*alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+
           cx[1]*alpha[9]+cx[2]*alpha[10]+cx[3]*alpha[11])+cy[3]*(
@@ -4243,7 +4243,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
       epsilon.y=1.0-delta.y;
       gamma=((epsilon.y*(epsilon.x*alpha[0]+delta.x*alpha[1])+delta.y*
         (epsilon.x*alpha[2]+delta.x*alpha[3])));
-      gamma=MagickReciprocal(gamma);
+      gamma=MagickEpsilonReciprocal(gamma);
       *pixel=gamma*(epsilon.y*(epsilon.x*pixels[0]+delta.x*pixels[1])+delta.y*
         (epsilon.x*pixels[2]+delta.x*pixels[3]));
       break;
@@ -4350,7 +4350,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
               */
               delta.y=1.0-delta.y;
               gamma=MeshInterpolate(&delta,alpha[2],alpha[3],alpha[0]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               *pixel=gamma*MeshInterpolate(&delta,pixels[2],pixels[3],
                 pixels[0]);
             }
@@ -4361,7 +4361,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
               */
               delta.x=1.0-delta.x;
               gamma=MeshInterpolate(&delta,alpha[1],alpha[0],alpha[3]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               *pixel=gamma*MeshInterpolate(&delta,pixels[1],pixels[0],
                 pixels[3]);
             }
@@ -4377,7 +4377,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
                 Top-left triangle (pixel: 0, diagonal: 1-2).
               */
               gamma=MeshInterpolate(&delta,alpha[0],alpha[1],alpha[2]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               *pixel=gamma*MeshInterpolate(&delta,pixels[0],pixels[1],
                 pixels[2]);
             }
@@ -4389,7 +4389,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
               delta.x=1.0-delta.x;
               delta.y=1.0-delta.y;
               gamma=MeshInterpolate(&delta,alpha[3],alpha[2],alpha[1]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               *pixel=gamma*MeshInterpolate(&delta,pixels[3],pixels[2],
                 pixels[1]);
             }
@@ -4438,7 +4438,7 @@ MagickExport MagickBooleanType InterpolatePixelChannel(const Image *image,
         for (j=(-1); j < 3L; j++)
         {
           dx=CubicWeightingFunction(delta.x-(MagickRealType) j);
-          gamma=MagickReciprocal(alpha[n]);
+          gamma=MagickEpsilonReciprocal(alpha[n]);
           *pixel+=gamma*dx*dy*pixels[n];
           n++;
         }
@@ -4565,7 +4565,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
           alpha[j]=QuantumScale*GetPixelAlpha(source,p+j*
             GetPixelChannels(source));
           pixels[j]*=alpha[j];
-          gamma=MagickReciprocal(alpha[j]);
+          gamma=MagickEpsilonReciprocal(alpha[j]);
           sum+=gamma*0.0625*pixels[j];
         }
         SetPixelChannel(destination,channel,ClampToQuantum(sum),pixel);
@@ -4641,7 +4641,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
         */
         gamma=1.0;
         if ((traits & BlendPixelTrait) == 0)
-          gamma=MagickReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
+          gamma=MagickEpsilonReciprocal(cy[0]*(cx[0]*alpha[0]+cx[1]*alpha[1]+cx[2]*
             alpha[2]+cx[3]*alpha[3])+cy[1]*(cx[0]*alpha[4]+cx[1]*alpha[5]+
             cx[2]*alpha[6]+cx[3]*alpha[7])+cy[2]*(cx[0]*alpha[8]+
             cx[1]*alpha[9]+cx[2]*alpha[10]+cx[3]*alpha[11])+cy[3]*(
@@ -4687,7 +4687,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
         if ((traits & BlendPixelTrait) == 0)
           {
             gamma=((epsilon.y*(epsilon.x+delta.x)+delta.y*(epsilon.x+delta.x)));
-            gamma=MagickReciprocal(gamma);
+            gamma=MagickEpsilonReciprocal(gamma);
             SetPixelChannel(destination,channel,ClampToQuantum(gamma*(epsilon.y*
               (epsilon.x*pixels[0]+delta.x*pixels[1])+delta.y*(epsilon.x*
               pixels[2]+delta.x*pixels[3]))),pixel);
@@ -4705,7 +4705,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
         pixels[3]*=alpha[3];
         gamma=((epsilon.y*(epsilon.x*alpha[0]+delta.x*alpha[1])+delta.y*
           (epsilon.x*alpha[2]+delta.x*alpha[3])));
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(destination,channel,ClampToQuantum(gamma*(epsilon.y*
           (epsilon.x*pixels[0]+delta.x*pixels[1])+delta.y*(epsilon.x*pixels[2]+
           delta.x*pixels[3]))),pixel);
@@ -4859,7 +4859,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
                 */
                 delta.y=1.0-delta.y;
                 gamma=MeshInterpolate(&delta,alpha[2],alpha[3],alpha[0]);
-                gamma=MagickReciprocal(gamma);
+                gamma=MagickEpsilonReciprocal(gamma);
                 SetPixelChannel(destination,channel,ClampToQuantum(gamma*
                   MeshInterpolate(&delta,pixels[2],pixels[3],pixels[0])),pixel);
               }
@@ -4870,7 +4870,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
                 */
                 delta.x=1.0-delta.x;
                 gamma=MeshInterpolate(&delta,alpha[1],alpha[0],alpha[3]);
-                gamma=MagickReciprocal(gamma);
+                gamma=MagickEpsilonReciprocal(gamma);
                 SetPixelChannel(destination,channel,ClampToQuantum(gamma*
                   MeshInterpolate(&delta,pixels[1],pixels[0],pixels[3])),pixel);
               }
@@ -4886,7 +4886,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
                   Top-left triangle (pixel: 0, diagonal: 1-2).
                 */
                 gamma=MeshInterpolate(&delta,alpha[0],alpha[1],alpha[2]);
-                gamma=MagickReciprocal(gamma);
+                gamma=MagickEpsilonReciprocal(gamma);
                 SetPixelChannel(destination,channel,ClampToQuantum(gamma*
                   MeshInterpolate(&delta,pixels[0],pixels[1],pixels[2])),pixel);
               }
@@ -4898,7 +4898,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
                 delta.x=1.0-delta.x;
                 delta.y=1.0-delta.y;
                 gamma=MeshInterpolate(&delta,alpha[3],alpha[2],alpha[1]);
-                gamma=MagickReciprocal(gamma);
+                gamma=MagickEpsilonReciprocal(gamma);
                 SetPixelChannel(destination,channel,ClampToQuantum(gamma*
                   MeshInterpolate(&delta,pixels[3],pixels[2],pixels[1])),pixel);
               }
@@ -4963,7 +4963,7 @@ MagickExport MagickBooleanType InterpolatePixelChannels(const Image *source,
           for (k=(-1); k < 3L; k++)
           {
             dx=CubicWeightingFunction(delta.x-(MagickRealType) k);
-            gamma=MagickReciprocal(alpha[n]);
+            gamma=MagickEpsilonReciprocal(alpha[n]);
             sum+=gamma*dx*dy*pixels[n];
             n++;
           }
@@ -5109,7 +5109,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
       pixel->alpha=0.0;
       for (i=0; i < 16L; i++)
       {
-        gamma=MagickReciprocal(alpha[i]);
+        gamma=MagickEpsilonReciprocal(alpha[i]);
         pixel->red+=gamma*0.0625*pixels[i].red;
         pixel->green+=gamma*0.0625*pixels[i].green;
         pixel->blue+=gamma*0.0625*pixels[i].blue;
@@ -5251,7 +5251,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
       epsilon.y=1.0-delta.y;
       gamma=((epsilon.y*(epsilon.x*alpha[0]+delta.x*alpha[1])+delta.y*
         (epsilon.x*alpha[2]+delta.x*alpha[3])));
-      gamma=MagickReciprocal(gamma);
+      gamma=MagickEpsilonReciprocal(gamma);
       pixel->red=gamma*(epsilon.y*(epsilon.x*pixels[0].red+delta.x*
         pixels[1].red)+delta.y*(epsilon.x*pixels[2].red+delta.x*pixels[3].red));
       pixel->green=gamma*(epsilon.y*(epsilon.x*pixels[0].green+delta.x*
@@ -5265,7 +5265,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
           pixels[1].black)+delta.y*(epsilon.x*pixels[2].black+delta.x*
           pixels[3].black));
       gamma=((epsilon.y*(epsilon.x+delta.x)+delta.y*(epsilon.x+delta.x)));
-      gamma=MagickReciprocal(gamma);
+      gamma=MagickEpsilonReciprocal(gamma);
       pixel->alpha=(epsilon.y*(epsilon.x*pixels[0].alpha+delta.x*
         pixels[1].alpha)+delta.y*(epsilon.x*pixels[2].alpha+delta.x*
         pixels[3].alpha));
@@ -5350,7 +5350,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
               */
               delta.y=1.0-delta.y;
               gamma=MeshInterpolate(&delta,alpha[2],alpha[3],alpha[0]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               pixel->red=gamma*MeshInterpolate(&delta,pixels[2].red,
                 pixels[3].red,pixels[0].red);
               pixel->green=gamma*MeshInterpolate(&delta,pixels[2].green,
@@ -5371,7 +5371,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
               */
               delta.x=1.0-delta.x;
               gamma=MeshInterpolate(&delta,alpha[1],alpha[0],alpha[3]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               pixel->red=gamma*MeshInterpolate(&delta,pixels[1].red,
                 pixels[0].red,pixels[3].red);
               pixel->green=gamma*MeshInterpolate(&delta,pixels[1].green,
@@ -5397,7 +5397,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
                 Top-left triangle (pixel: 0, diagonal: 1-2).
               */
               gamma=MeshInterpolate(&delta,alpha[0],alpha[1],alpha[2]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               pixel->red=gamma*MeshInterpolate(&delta,pixels[0].red,
                 pixels[1].red,pixels[2].red);
               pixel->green=gamma*MeshInterpolate(&delta,pixels[0].green,
@@ -5419,7 +5419,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
               delta.x=1.0-delta.x;
               delta.y=1.0-delta.y;
               gamma=MeshInterpolate(&delta,alpha[3],alpha[2],alpha[1]);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               pixel->red=gamma*MeshInterpolate(&delta,pixels[3].red,
                 pixels[2].red,pixels[1].red);
               pixel->green=gamma*MeshInterpolate(&delta,pixels[3].green,
@@ -5504,7 +5504,7 @@ MagickExport MagickBooleanType InterpolatePixelInfo(const Image *image,
         for (j=(-1); j < 3L; j++)
         {
           dx=CubicWeightingFunction(delta.x-(MagickRealType) j);
-          gamma=MagickReciprocal(alpha[n]);
+          gamma=MagickEpsilonReciprocal(alpha[n]);
           pixel->red+=gamma*dx*dy*pixels[n].red;
           pixel->green+=gamma*dx*dy*pixels[n].green;
           pixel->blue+=gamma*dx*dy*pixels[n].blue;
index f029a65664f9d324e846d8148b077217e60667ea..1d6ab626c3e8b470a0326539b34b94ddb9928316 100644 (file)
@@ -1252,7 +1252,7 @@ static size_t DefineImageColormap(Image *image,CubeInfo *cube_info,
       */
       q=image->colormap+image->colors;
       alpha=(MagickRealType) ((MagickOffsetType) node_info->number_unique);
-      alpha=MagickReciprocal(alpha);
+      alpha=MagickEpsilonReciprocal(alpha);
       if (cube_info->associate_alpha == MagickFalse)
         {
           q->red=(double) ClampToQuantum((MagickRealType)
@@ -1286,7 +1286,7 @@ static size_t DefineImageColormap(Image *image,CubeInfo *cube_info,
                 gamma;
 
               gamma=(MagickRealType) (QuantumScale*q->alpha);
-              gamma=MagickReciprocal(gamma);
+              gamma=MagickEpsilonReciprocal(gamma);
               q->red=(double) ClampToQuantum((MagickRealType)
                 (alpha*gamma*QuantumRange*node_info->total_color.red));
               q->green=(double) ClampToQuantum((MagickRealType)
index f9dafd17329c5b6e6d89a58b4cac59d5beac3ad2..37f649ba62050c39b885f1a564272fd891f3ca5e 100644 (file)
@@ -3610,7 +3610,7 @@ MagickExport size_t ImportQuantumPixels(const Image *image,
             continue;
           }
         Sa=QuantumScale*GetPixelAlpha(image,q);
-        gamma=MagickReciprocal(Sa);
+        gamma=MagickEpsilonReciprocal(Sa);
         for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
         {
           PixelChannel
index 2501e5a1f140f6b28098440ff6e54f37e90c2217..c2e9ba892aafe741acbf4439e1803205802a8ac3 100644 (file)
@@ -2363,7 +2363,7 @@ static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter,
           pixel+=alpha*p[k*GetPixelChannels(image)+i];
           gamma+=alpha;
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(resize_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       q+=GetPixelChannels(resize_image);
@@ -2579,7 +2579,7 @@ static MagickBooleanType VerticalFilter(const ResizeFilter *resize_filter,
           pixel+=alpha*p[k*GetPixelChannels(image)+i];
           gamma+=alpha;
         }
-        gamma=MagickReciprocal(gamma);
+        gamma=MagickEpsilonReciprocal(gamma);
         SetPixelChannel(resize_image,channel,ClampToQuantum(gamma*pixel),q);
       }
       q+=GetPixelChannels(resize_image);
@@ -3210,7 +3210,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
               }
             alpha=QuantumScale*scanline[x*GetPixelChannels(image)+
               GetPixelChannelMapChannel(image,AlphaPixelChannel)];
-            gamma=MagickReciprocal(alpha);
+            gamma=MagickEpsilonReciprocal(alpha);
             SetPixelChannel(scale_image,channel,ClampToQuantum(gamma*scanline[
               x*GetPixelChannels(image)+offset]),q);
           }
@@ -3312,7 +3312,7 @@ MagickExport Image *ScaleImage(const Image *image,const size_t columns,
             }
           alpha=QuantumScale*scanline[x*GetPixelChannels(image)+
             GetPixelChannelMapChannel(image,AlphaPixelChannel)];
-          gamma=MagickReciprocal(alpha);
+          gamma=MagickEpsilonReciprocal(alpha);
           SetPixelChannel(scale_image,channel,ClampToQuantum(gamma*
             scale_scanline[x*MaxPixelChannels+channel]),q);
         }
index c23d19ffde6440cead8d13709b7da47320dfc3f9..483069bfe254273180c6e73f4c89ba39bff5e2cb 100644 (file)
@@ -424,7 +424,7 @@ static Image *ReadPANGOImage(const ImageInfo *image_info,
         Disassociate alpha.
       */
       gamma=1.0-QuantumScale*fill_color.alpha;
-      gamma=MagickReciprocal(gamma);
+      gamma=MagickEpsilonReciprocal(gamma);
       fill_color.blue*=gamma;
       fill_color.green*=gamma;
       fill_color.red*=gamma;
index 0c5c96cc68278a4e33b900315f1d9b489685a16a..8f741be64bd56f542c371a9c59eddb602c70be00 100644 (file)
@@ -2939,7 +2939,7 @@ static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception)
                   gamma;
     
                 gamma=1.0-QuantumScale*fill_color.alpha;
-                gamma=MagickReciprocal(gamma);
+                gamma=MagickEpsilonReciprocal(gamma);
                 fill_color.blue*=gamma;
                 fill_color.green*=gamma;
                 fill_color.red*=gamma;