]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 14 Oct 2012 13:40:33 +0000 (13:40 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 14 Oct 2012 13:40:33 +0000 (13:40 +0000)
MagickCore/colorspace.c
MagickCore/composite.c
MagickCore/enhance.c
MagickCore/fx.c
MagickCore/gem.c
MagickCore/pixel-accessor.h
MagickCore/xwindow-private.h
MagickCore/xwindow.c
PerlMagick/t/write.t

index dec5e3575b083c6cede89714a99ee42bb515fc88..2c5fa2e3dbbd817ad0b21b82791548753d6d0ded 100644 (file)
@@ -430,7 +430,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
           red=DecodesRGBGamma((double) GetPixelRed(image,q));
           green=DecodesRGBGamma((double) GetPixelGreen(image,q));
           blue=DecodesRGBGamma((double) GetPixelBlue(image,q));
-          gray=0.298839*red+0.586811*green+0.114350*blue;
+          gray=0.298839f*red+0.586811f*green+0.114350f*blue;
           SetPixelGray(image,ClampToQuantum(gray),q);
           q+=GetPixelChannels(image);
         }
@@ -1341,7 +1341,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       /*
         Initialize YCbCr tables (ITU-R BT.601):
 
-          Y =  0.2988390*R+0.5868110*G+0.1143500*B
+          Y =  0.298839f0*R+0.586811f0*G+0.114350f0*B
           Cb= -0.1687367*R-0.3312640*G+0.5000000*B
           Cr=  0.5000000*R-0.4186880*G-0.0813120*B
 
@@ -1356,15 +1356,15 @@ static MagickBooleanType sRGBTransformImage(Image *image,
 #endif
       for (i=0; i <= (ssize_t) MaxMap; i++)
       {
-        x_map[i].x=0.298839*i;
-        y_map[i].x=0.586811*i;
-        z_map[i].x=0.114350*i;
-        x_map[i].y=(-0.1687367)*i;
-        y_map[i].y=(-0.331264)*i;
-        z_map[i].y=0.500000*i;
-        x_map[i].z=0.500000*i;
-        y_map[i].z=(-0.418688)*i;
-        z_map[i].z=(-0.081312)*i;
+        x_map[i].x=(MagickRealType) (0.298839f*(float) i);
+        y_map[i].x=(MagickRealType) (0.586811f*(float) i);
+        z_map[i].x=(MagickRealType) (0.114350f*(float) i);
+        x_map[i].y=(MagickRealType) (-0.1687367f*(float) i);
+        y_map[i].y=(MagickRealType) (-0.331264f*(float) i);
+        z_map[i].y=(MagickRealType) (0.500000f*(float) i);
+        x_map[i].z=(MagickRealType) (0.500000f*(float) i);
+        y_map[i].z=(MagickRealType) (-0.418688f*(float) i);
+        z_map[i].z=(MagickRealType) (-0.081312f*(float) i);
       }
       break;
     }
@@ -1405,9 +1405,9 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       /*
         Initialize YCC tables:
 
-          Y =  0.298839*R+0.586811*G+0.114350*B
-          C1= -0.298839*R-0.586811*G+0.88600*B
-          C2=  0.70100*R-0.586811*G-0.114350*B
+          Y =  0.298839f*R+0.586811f*G+0.114350f*B
+          C1= -0.298839f*R-0.586811f*G+0.88600*B
+          C2=  0.70100*R-0.586811f*G-0.114350f*B
 
         YCC is scaled by 1.3584.  C1 zero is 156 and C2 is at 137.
       */
@@ -1444,7 +1444,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       /*
         Initialize YIQ tables:
 
-          Y = 0.298839*R+0.586811*G+0.114350*B
+          Y = 0.298839f*R+0.586811f*G+0.114350f*B
           I = 0.595716*R-0.274453*G-0.321263*B
           Q = 0.211456*R-0.522591*G+0.311135*B
 
@@ -1459,15 +1459,15 @@ static MagickBooleanType sRGBTransformImage(Image *image,
 #endif
       for (i=0; i <= (ssize_t) MaxMap; i++)
       {
-        x_map[i].x=0.298839*i;
-        y_map[i].x=0.586811*i;
-        z_map[i].x=0.114350*i;
-        x_map[i].y=0.595716*i;
-        y_map[i].y=(-0.274453)*i;
-        z_map[i].y=(-0.321263)*i;
-        x_map[i].z=0.211456*i;
-        y_map[i].z=(-0.522591)*i;
-        z_map[i].z=0.311135*i;
+        x_map[i].x=(MagickRealType) (0.298839f*(float) i);
+        y_map[i].x=(MagickRealType) (0.586811f*(float) i);
+        z_map[i].x=(MagickRealType) (0.114350f*(float) i);
+        x_map[i].y=(MagickRealType) (0.595716*(float) i);
+        y_map[i].y=(MagickRealType) (-0.274453f*(float) i);
+        z_map[i].y=(MagickRealType) (-0.321263f*(float) i);
+        x_map[i].z=(MagickRealType) (0.211456f*(float) i);
+        y_map[i].z=(MagickRealType) (-0.522591f*(float) i);
+        z_map[i].z=(MagickRealType) (0.311135f*(float) i);
       }
       break;
     }
@@ -1476,7 +1476,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       /*
         Initialize YPbPr tables (ITU-R BT.601):
 
-          Y =  0.2988390*R+0.5868110*G+0.1143500*B
+          Y =  0.298839f0*R+0.586811f0*G+0.114350f0*B
           Pb= -0.1687367*R-0.3312640*G+0.5000000*B
           Pr=  0.5000000*R-0.4186880*G-0.0813120*B
 
@@ -1491,15 +1491,15 @@ static MagickBooleanType sRGBTransformImage(Image *image,
 #endif
       for (i=0; i <= (ssize_t) MaxMap; i++)
       {
-        x_map[i].x=0.298839*i;
-        y_map[i].x=0.586811*i;
-        z_map[i].x=0.114350*i;
-        x_map[i].y=(-0.1687367)*i;
-        y_map[i].y=(-0.331264)*i;
-        z_map[i].y=0.500000*i;
-        x_map[i].z=0.500000*i;
-        y_map[i].z=(-0.418688)*i;
-        z_map[i].z=(-0.081312)*i;
+        x_map[i].x=(MagickRealType) (0.298839f*(float) i);
+        y_map[i].x=(MagickRealType) (0.586811f*(float) i);
+        z_map[i].x=(MagickRealType) (0.114350f*(float) i);
+        x_map[i].y=(MagickRealType) (-0.1687367f*(float) i);
+        y_map[i].y=(MagickRealType) (-0.331264*(float) i);
+        z_map[i].y=(MagickRealType) (0.500000f*(float) i);
+        x_map[i].z=(MagickRealType) (0.500000f*(float) i);
+        y_map[i].z=(MagickRealType) (-0.418688f*(float) i);
+        z_map[i].z=(MagickRealType) (-0.081312f*(float) i);
       }
       break;
     }
@@ -1508,7 +1508,7 @@ static MagickBooleanType sRGBTransformImage(Image *image,
       /*
         Initialize YUV tables:
 
-          Y =  0.298839*R+0.586811*G+0.114350*B
+          Y =  0.298839f*R+0.586811f*G+0.114350f*B
           U = -0.147130*R-0.288860*G+0.436000*B
           V =  0.615000*R-0.514990*G-0.100010*B
 
@@ -1523,15 +1523,15 @@ static MagickBooleanType sRGBTransformImage(Image *image,
 #endif
       for (i=0; i <= (ssize_t) MaxMap; i++)
       {
-        x_map[i].x=0.298839*i;
-        y_map[i].x=0.586811*i;
-        z_map[i].x=0.114350*i;
-        x_map[i].y=(-0.147130)*i;
-        y_map[i].y=(-0.288860)*i;
-        z_map[i].y=0.436000*i;
-        x_map[i].z=0.615000*i;
-        y_map[i].z=(-0.514990)*i;
-        z_map[i].z=(-0.100001)*i;
+        x_map[i].x=(MagickRealType) (0.298839f*(float) i);
+        y_map[i].x=(MagickRealType) (0.586811f*(float) i);
+        z_map[i].x=(MagickRealType) (0.114350f*(float) i);
+        x_map[i].y=(MagickRealType) (-0.147130f*(float) i);
+        y_map[i].y=(MagickRealType) (-0.288860f*(float) i);
+        z_map[i].y=(MagickRealType) (0.436000f*(float) i);
+        x_map[i].z=(MagickRealType) (0.615000f*(float) i);
+        y_map[i].z=(MagickRealType) (-0.514990f*(float) i);
+        z_map[i].z=(MagickRealType) (-0.100001f*(float) i);
       }
       break;
     }
@@ -3508,9 +3508,12 @@ static MagickBooleanType TransformsRGBImage(Image *image,
             }
           else
             {
-              pixel.red=EncodesRGBGamma(ScaleMapToQuantum(pixel.red));
-              pixel.green=EncodesRGBGamma(ScaleMapToQuantum(pixel.green));
-              pixel.blue=EncodesRGBGamma(ScaleMapToQuantum(pixel.blue));
+              pixel.red=EncodesRGBGamma((MagickRealType)
+                ScaleMapToQuantum(pixel.red));
+              pixel.green=EncodesRGBGamma((MagickRealType)
+                ScaleMapToQuantum(pixel.green));
+              pixel.blue=EncodesRGBGamma((MagickRealType)
+                ScaleMapToQuantum(pixel.blue));
             }
           SetPixelRed(image,ClampToQuantum(pixel.red),q);
           SetPixelGreen(image,ClampToQuantum(pixel.green),q);
@@ -3573,9 +3576,12 @@ static MagickBooleanType TransformsRGBImage(Image *image,
           }
         else
           {
-            pixel.red=EncodesRGBGamma(ScaleMapToQuantum(pixel.red));
-            pixel.green=EncodesRGBGamma(ScaleMapToQuantum(pixel.green));
-            pixel.blue=EncodesRGBGamma(ScaleMapToQuantum(pixel.blue));
+            pixel.red=EncodesRGBGamma((MagickRealType)
+              ScaleMapToQuantum(pixel.red));
+            pixel.green=EncodesRGBGamma((MagickRealType)
+              ScaleMapToQuantum(pixel.green));
+            pixel.blue=EncodesRGBGamma((MagickRealType)
+              ScaleMapToQuantum(pixel.blue));
           }
         image->colormap[i].red=(double) ClampToQuantum(pixel.red);
         image->colormap[i].green=(double) ClampToQuantum(pixel.green);
index 99ad303bd6e5f815a6929465f16ce9e309944e55..4ec1dad5d4efd2e6dd3c11df6e15c335db33c2ad 100644 (file)
@@ -267,7 +267,7 @@ static void HCLComposite(const double hue,const double chroma,const double luma,
                 r=c;
                 b=x;
               }
-  m=luma-(0.298839*r+0.586811*g+0.114350*b);
+  m=luma-(0.298839f*r+0.586811f*g+0.114350f*b);
   /*
     Choose saturation strategy to clip it into the RGB cube; hue and luma are
     preserved and chroma may be changed.
@@ -325,7 +325,7 @@ static void CompositeHCL(const double red,const double green,const double blue,
           h=((r-g)/c)+4.0;
   *hue=(h/6.0);
   *chroma=QuantumScale*c;
-  *luma=QuantumScale*(0.298839*r+0.586811*g+0.114350*b);
+  *luma=QuantumScale*(0.298839f*r+0.586811f*g+0.114350f*b);
 }
 
 static MagickBooleanType CompositeOverImage(Image *image,
index 4437c79eff11296b257ddd67d613d69bb96c7dab..75420331734c44354c9c6ecd9fc303fdd683c3ab 100644 (file)
@@ -723,8 +723,8 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
       double
         luma;
 
-      luma=0.21267*image->colormap[i].red+0.71526*image->colormap[i].green+
-        0.07217*image->colormap[i].blue;
+      luma=0.21267f*image->colormap[i].red+0.71526*image->colormap[i].green+
+        0.07217f*image->colormap[i].blue;
       image->colormap[i].red=luma+color_correction.saturation*cdl_map[
         ScaleQuantumToMap(ClampToQuantum(image->colormap[i].red))].red-luma;
       image->colormap[i].green=luma+color_correction.saturation*cdl_map[
@@ -763,7 +763,7 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
       }
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      luma=0.21267*GetPixelRed(image,q)+0.71526*GetPixelGreen(image,q)+0.07217*
+      luma=0.21267f*GetPixelRed(image,q)+0.71526*GetPixelGreen(image,q)+0.07217f*
         GetPixelBlue(image,q);
       SetPixelRed(image,ClampToQuantum(luma+color_correction.saturation*
         (cdl_map[ScaleQuantumToMap(GetPixelRed(image,q))].red-luma)),q);
index aa9fc31aef698adfb7495d23f6e524590fde5ca9..fe226dddcea121047bfbedaf32cf67adb5ec3894 100644 (file)
@@ -1727,7 +1727,7 @@ static double FxGetSymbol(FxInfo *fx_info,const PixelChannel channel,
           double
             luminence;
 
-          luminence=0.21267*pixel.red+0.71516*pixel.green+0.07217*pixel.blue;
+          luminence=0.21267f*pixel.red+0.71516f*pixel.green+0.07217f*pixel.blue;
           return(QuantumScale*luminence);
         }
       break;
index 64608bc357b787c3ac8b966f821624ab5259a734..8b89d27392368ef538b67b8804419cb4d9f81336 100644 (file)
@@ -145,7 +145,7 @@ MagickPrivate void ConvertHCLToRGB(const double hue,const double chroma,
                 r=c;
                 b=x;
               }
-  m=luma-(0.298839*r+0.586811*g+0.114350*b);
+  m=luma-(0.298839f*r+0.586811f*g+0.114350f*b);
   /*
     Choose saturation strategy to clip it into the RGB cube; hue and luma are
     preserved and chroma may be changed.
@@ -504,7 +504,7 @@ MagickPrivate void ConvertRGBToHCL(const double red,const double green,
           h=((r-g)/c)+4.0;
   *hue=(h/6.0);
   *chroma=QuantumScale*c;
-  *luma=QuantumScale*(0.298839*r+0.586811*g+0.114350*b);
+  *luma=QuantumScale*(0.298839f*r+0.586811f*g+0.114350f*b);
 }
 \f
 /*
index 090606d5badafe0aad5cb7a5a457e22618a0931a..0173d3fa880dc171458ccc4b3c3ae48661a25034 100644 (file)
@@ -32,18 +32,18 @@ extern "C" {
 
 #undef index
 
-static inline double DecodesRGBGamma(const double pixel)
+static inline MagickRealType DecodesRGBGamma(const MagickRealType pixel)
 {
   if (pixel <= (0.0404482362771076*QuantumRange))
-    return(pixel/12.92);
-  return(QuantumRange*pow((QuantumScale*pixel+0.055)/1.055,2.4));
+    return(pixel/12.92f);
+  return(QuantumRange*pow((double) (QuantumScale*pixel+0.055)/1.055,2.4));
 }
 
-static inline double EncodesRGBGamma(const double pixel)
+static inline MagickRealType EncodesRGBGamma(const MagickRealType pixel)
 {
   if (pixel <= (0.0031306684425005883*QuantumRange))
-    return(12.92*pixel);
-  return(QuantumRange*(1.055*pow(QuantumScale*pixel,1.0/2.4)-0.055));
+    return(12.92f*pixel);
+  return(QuantumRange*(1.055*pow((double) QuantumScale*pixel,1.0/2.4)-0.055));
 }
 
 static inline Quantum GetPixela(const Image *restrict image,
@@ -194,8 +194,8 @@ static inline PixelTrait GetPixelIndexTraits(const Image *restrict image)
   return(image->channel_map[IndexPixelChannel].traits);
 }
 
-static inline double GetPixelInfoChannel(const PixelInfo *restrict pixel_info,
-  const PixelChannel channel)
+static inline MagickRealType GetPixelInfoChannel(
+  const PixelInfo *restrict pixel_info,const PixelChannel channel)
 {
   switch (channel)
   {
@@ -205,13 +205,14 @@ static inline double GetPixelInfoChannel(const PixelInfo *restrict pixel_info,
     case BlackPixelChannel: return(pixel_info->black);
     case AlphaPixelChannel: return(pixel_info->alpha);
     case IndexPixelChannel: return(pixel_info->index);
-    default: return(0.0);
+    default: return((MagickRealType) 0.0);
   }
 }
 
-static inline double GetPixelInfoIntensity(const PixelInfo *restrict pixel_info)
+static inline MagickRealType GetPixelInfoIntensity(
+  const PixelInfo *restrict pixel_info)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
@@ -219,17 +220,18 @@ static inline double GetPixelInfoIntensity(const PixelInfo *restrict pixel_info)
   if (pixel_info->colorspace == GRAYColorspace)
     return(pixel_info->red);
   if (pixel_info->colorspace != sRGBColorspace)
-    return(0.298839*pixel_info->red+0.586811*pixel_info->green+
-      0.114350*pixel_info->blue);
+    return(0.298839f*pixel_info->red+0.586811f*pixel_info->green+
+      0.114350f*pixel_info->blue);
   red=DecodesRGBGamma(pixel_info->red);
   green=DecodesRGBGamma(pixel_info->green);
   blue=DecodesRGBGamma(pixel_info->blue);
-  return(0.298839*red+0.586811*green+0.114350*blue);
+  return(0.298839f*red+0.586811f*green+0.114350f*blue);
 }
 
-static inline double GetPixelInfoLuminance(const PixelInfo *restrict pixel_info)
+static inline MagickRealType GetPixelInfoLuminance(
+  const PixelInfo *restrict pixel_info)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
@@ -237,35 +239,35 @@ static inline double GetPixelInfoLuminance(const PixelInfo *restrict pixel_info)
   if (pixel_info->colorspace == GRAYColorspace)
     return(pixel_info->red);
   if (pixel_info->colorspace != sRGBColorspace)
-    return(0.21267*pixel_info->red+0.71516*pixel_info->green+
-      0.07217*pixel_info->blue);
+    return(0.21267f*pixel_info->red+0.71516f*pixel_info->green+
+      0.07217f*pixel_info->blue);
   red=DecodesRGBGamma(pixel_info->red);
   green=DecodesRGBGamma(pixel_info->green);
   blue=DecodesRGBGamma(pixel_info->blue);
-  return(0.21267*red+0.71516*green+0.07217*blue);
+  return(0.21267f*red+0.71516f*green+0.07217f*blue);
 }
 
-static inline double GetPixelIntensity(const Image *restrict image,
+static inline MagickRealType GetPixelIntensity(const Image *restrict image,
   const Quantum *restrict pixel)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
 
   if (image->colorspace == GRAYColorspace)
-    return((double) pixel[image->channel_map[GrayPixelChannel].offset]);
+    return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
   if (image->colorspace != sRGBColorspace)
-    return(0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
-      0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
-      0.114350*pixel[image->channel_map[BluePixelChannel].offset]);
-  red=DecodesRGBGamma((double)
+    return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
+      0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
+      0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
+  red=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[RedPixelChannel].offset]);
-  green=DecodesRGBGamma((double)
+  green=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[GreenPixelChannel].offset]);
-  blue=DecodesRGBGamma((double)
+  blue=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[BluePixelChannel].offset]);
-  return(0.298839*red+0.586811*green+0.114350*blue);
+  return(0.298839f*red+0.586811f*green+0.114350f*blue);
 }
 
 static inline Quantum GetPixelL(const Image *restrict image,
@@ -274,27 +276,27 @@ static inline Quantum GetPixelL(const Image *restrict image,
   return(pixel[image->channel_map[LPixelChannel].offset]);
 }
 
-static inline double GetPixelLuminance(const Image *restrict image,
+static inline MagickRealType GetPixelLuminance(const Image *restrict image,
   const Quantum *restrict pixel)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
 
   if (image->colorspace == GRAYColorspace)
-    return((double) pixel[image->channel_map[GrayPixelChannel].offset]);
+    return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
   if (image->colorspace != sRGBColorspace)
-    return(0.298839*pixel[image->channel_map[RedPixelChannel].offset]+
-      0.586811*pixel[image->channel_map[GreenPixelChannel].offset]+
-      0.114350*pixel[image->channel_map[BluePixelChannel].offset]);
-  red=DecodesRGBGamma((double)
+    return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
+      0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
+      0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
+  red=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[RedPixelChannel].offset]);
-  green=DecodesRGBGamma((double)
+  green=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[GreenPixelChannel].offset]);
-  blue=DecodesRGBGamma((double)
+  blue=DecodesRGBGamma((MagickRealType)
     pixel[image->channel_map[BluePixelChannel].offset]);
-  return(0.21267*red+0.71516*green+0.07217*blue);
+  return(0.21267f*red+0.71516f*green+0.07217f*blue);
 }
 
 static inline Quantum GetPixelMagenta(const Image *restrict image,
@@ -353,23 +355,23 @@ static inline PixelTrait GetPixelRedTraits(const Image *restrict image)
 static inline void GetPixelInfoPixel(const Image *restrict image,
   const Quantum *restrict pixel,PixelInfo *restrict pixel_info)
 {
-  pixel_info->red=(double)
+  pixel_info->red=(MagickRealType)
     pixel[image->channel_map[RedPixelChannel].offset];
-  pixel_info->green=(double)
+  pixel_info->green=(MagickRealType)
     pixel[image->channel_map[GreenPixelChannel].offset];
-  pixel_info->blue=(double)
+  pixel_info->blue=(MagickRealType)
     pixel[image->channel_map[BluePixelChannel].offset];
-  pixel_info->black=0.0;
+  pixel_info->black=0.0f;
   if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
-    pixel_info->black=(double)
+    pixel_info->black=(MagickRealType)
       pixel[image->channel_map[BlackPixelChannel].offset];
-  pixel_info->alpha=OpaqueAlpha;
+  pixel_info->alpha=(MagickRealType) OpaqueAlpha;
   if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
-    pixel_info->alpha=(double)
+    pixel_info->alpha=(MagickRealType)
       pixel[image->channel_map[AlphaPixelChannel].offset];
-  pixel_info->index=0.0;
+  pixel_info->index=0.0f;
   if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
-    pixel_info->index=(double)
+    pixel_info->index=(MagickRealType)
       pixel[image->channel_map[IndexPixelChannel].offset];
 }
 
@@ -401,22 +403,22 @@ static inline PixelTrait GetPixelYellowTraits(const Image *restrict image)
   return(image->channel_map[YellowPixelChannel].traits);
 }
 
-static inline double AbsolutePixelValue(const double x)
+static inline MagickRealType AbsolutePixelValue(const MagickRealType x)
 {
-  return(x < 0.0 ? -x : x);
+  return(x < 0.0f ? -x : x);
 }
 
 static inline MagickBooleanType IsPixelEquivalent(const Image *restrict image,
   const Quantum *restrict p,const PixelInfo *restrict q)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
 
-  red=(double) p[image->channel_map[RedPixelChannel].offset];
-  green=(double) p[image->channel_map[GreenPixelChannel].offset];
-  blue=(double) p[image->channel_map[BluePixelChannel].offset];
+  red=(MagickRealType) p[image->channel_map[RedPixelChannel].offset];
+  green=(MagickRealType) p[image->channel_map[GreenPixelChannel].offset];
+  blue=(MagickRealType) p[image->channel_map[BluePixelChannel].offset];
   if ((AbsolutePixelValue(red-q->red) < MagickEpsilon) &&
       (AbsolutePixelValue(green-q->green) < MagickEpsilon) &&
       (AbsolutePixelValue(blue-q->blue) < MagickEpsilon))
@@ -427,14 +429,14 @@ static inline MagickBooleanType IsPixelEquivalent(const Image *restrict image,
 static inline MagickBooleanType IsPixelGray(const Image *restrict image,
   const Quantum *restrict pixel)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
 
-  red=(double) pixel[image->channel_map[RedPixelChannel].offset];
-  green=(double) pixel[image->channel_map[GreenPixelChannel].offset];
-  blue=(double) pixel[image->channel_map[BluePixelChannel].offset];
+  red=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset];
+  green=(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset];
+  blue=(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset];
   if ((AbsolutePixelValue(red-green) < MagickEpsilon) &&
       (AbsolutePixelValue(green-blue) < MagickEpsilon))
     return(MagickTrue);
@@ -475,17 +477,17 @@ static inline MagickBooleanType IsPixelInfoEquivalent(
 static inline MagickBooleanType IsPixelMonochrome(const Image *restrict image,
   const Quantum *restrict pixel)
 {
-  double
+  MagickRealType
     blue,
     green,
     red;
 
-  red=(double) pixel[image->channel_map[RedPixelChannel].offset];
+  red=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset];
   if ((AbsolutePixelValue(red) >= MagickEpsilon) ||
       (AbsolutePixelValue(red-QuantumRange) >= MagickEpsilon))
     return(MagickFalse);
-  green=(double) pixel[image->channel_map[GreenPixelChannel].offset];
-  blue=(double) pixel[image->channel_map[BluePixelChannel].offset];
+  green=(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset];
+  blue=(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset];
   if ((AbsolutePixelValue(red-green) < MagickEpsilon) &&
       (AbsolutePixelValue(green-blue) < MagickEpsilon))
     return(MagickTrue);
index 91a4ae3f898a41de32ba1ed09ff8575b27b26c90..a3814ce25558351da503739006f3128a80e20899 100644 (file)
@@ -606,7 +606,7 @@ static inline double XPixelIntensity(const XColor *pixel)
   red=DecodesRGBGamma((double) pixel->red);
   green=DecodesRGBGamma((double) pixel->green);
   blue=DecodesRGBGamma((double) pixel->blue);
-  return(0.298839*red+0.586811*green+0.114350*blue);
+  return(0.298839f*red+0.586811f*green+0.114350f*blue);
 }
 
 #endif
index fb3c224ced8a86e4320dee8a57eca7193bda9bd3..7584f3a3fee11600fb533dd0c266b9e74648089f 100644 (file)
@@ -7701,7 +7701,7 @@ static inline double DiversityPixelIntensity(
   double
     intensity;
 
-  intensity=0.298839*pixel->red+0.586811*pixel->green+0.114350*pixel->blue;
+  intensity=0.298839f*pixel->red+0.586811f*pixel->green+0.114350f*pixel->blue;
   return(intensity);
 }
 
index 3e201a0e79b0148acab7589a5e5e66bb064a76ef..707f83e84e42cfdffa767f2a4bd39cf1d5c1edb5 100644 (file)
@@ -37,7 +37,7 @@ testReadWrite( 'BMP:input.bmp',
   'BMP:output.bmp',
   q//,
   '4db1c9f8cf10c1a9a7e80397b4cf060d2d31caae13ba712712e6341fb96bd6b0',
-  'ae2007d0e05933a72294a6f8c7b59fc54d5fa3039f0f13bf8d65d05044ef2f39',
+  '5365605c69ea58eb07b9b043e3561f2aca5532e2f9054da1b7a80dc2aa515892',
   '5365605c69ea58eb07b9b043e3561f2aca5532e2f9054da1b7a80dc2aa515892');
 
 print("Microsoft Windows 24-bit bitmap image file ...\n");
@@ -46,7 +46,7 @@ testReadWrite( 'BMP:input.bmp24',
   'BMP:output.bmp24',
   q//,
   '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33',
-  '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33',
+  'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3',
   'e7d406ec41fe69ba2bd88dd59e5eb17a83f17c0a99519def02c020041144f5b3');
 
 print("ZSoft IBM PC multi-page Paintbrush file ...\n");