]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 14 Oct 2012 14:57:47 +0000 (14:57 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 14 Oct 2012 14:57:47 +0000 (14:57 +0000)
MagickCore/colorspace-private.h
MagickCore/composite-private.h
MagickCore/composite.c
MagickCore/quantum-private.h

index 1b697f02d7df7415f4379ac34a68cf0d7a32ce95..efe583c79b24c9d8de1d55ffac619cff1e830598 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 
 static inline void ConvertRGBToCMYK(PixelInfo *pixel)
 {
-  double
+  MagickRealType
     black,
     blue,
     cyan,
@@ -53,20 +53,20 @@ static inline void ConvertRGBToCMYK(PixelInfo *pixel)
   if ((fabs(red) < MagickEpsilon) && (fabs(green) < MagickEpsilon) &&
       (fabs(blue) < MagickEpsilon))
     {
-      pixel->black=(double) QuantumRange;
+      pixel->black=(MagickRealType) QuantumRange;
       return;
     }
-  cyan=(double) (1.0-red);
-  magenta=(double) (1.0-green);
-  yellow=(double) (1.0-blue);
+  cyan=(MagickRealType) (1.0-red);
+  magenta=(MagickRealType) (1.0-green);
+  yellow=(MagickRealType) (1.0-blue);
   black=cyan;
   if (magenta < black)
     black=magenta;
   if (yellow < black)
     black=yellow;
-  cyan=(double) ((cyan-black)/(1.0-black));
-  magenta=(double) ((magenta-black)/(1.0-black));
-  yellow=(double) ((yellow-black)/(1.0-black));
+  cyan=(MagickRealType) ((cyan-black)/(1.0-black));
+  magenta=(MagickRealType) ((magenta-black)/(1.0-black));
+  yellow=(MagickRealType) ((yellow-black)/(1.0-black));
   pixel->colorspace=CMYKColorspace;
   pixel->red=QuantumRange*cyan;
   pixel->green=QuantumRange*magenta;
index 3963e14e610c28aa59fb4e346c7fe4ebd5b4882f..380431c1c6a1032f3edfbf1393f496bb8106b691 100644 (file)
@@ -45,8 +45,7 @@ static inline double MagickOver_(const double p,
 }
 
 static inline void CompositePixelOver(const Image *image,const PixelInfo *p,
-  const double alpha,const Quantum *q,const double beta,
-  Quantum *composite)
+  const double alpha,const Quantum *q,const double beta,Quantum *composite)
 {
   double
     Da,
@@ -113,8 +112,7 @@ static inline void CompositePixelOver(const Image *image,const PixelInfo *p,
 }
 
 static inline void CompositePixelInfoOver(const PixelInfo *p,
-  const double alpha,const PixelInfo *q,const double beta,
-  PixelInfo *composite)
+  const double alpha,const PixelInfo *q,const double beta,PixelInfo *composite)
 {
   double
     Da,
@@ -147,8 +145,7 @@ static inline double RoundToUnity(const double value)
 }
 
 static inline void CompositePixelInfoPlus(const PixelInfo *p,
-  const double alpha,const PixelInfo *q,const double beta,
-  PixelInfo *composite)
+  const double alpha,const PixelInfo *q,const double beta,PixelInfo *composite)
 {
   double
     Da,
@@ -171,25 +168,24 @@ static inline void CompositePixelInfoPlus(const PixelInfo *p,
 }
 
 static inline void CompositePixelInfoAreaBlend(const PixelInfo *p,
-  const double alpha,const PixelInfo *q,const double beta,
-  const double area,PixelInfo *composite)
+  const double alpha,const PixelInfo *q,const double beta,const double area,
+  PixelInfo *composite)
 {
   /*
     Blend pixel colors p and q by the amount given and area.
   */
-  CompositePixelInfoPlus(p,(double) (1.0-area)*alpha,q,(double)
-    (area*beta),composite);
+  CompositePixelInfoPlus(p,(double) (1.0-area)*alpha,q,(double) (area*beta),
+    composite);
 }
 
 static inline void CompositePixelInfoBlend(const PixelInfo *p,
-  const double alpha,const PixelInfo *q,const double beta,
-  PixelInfo *composite)
+  const double alpha,const PixelInfo *q,const double beta,PixelInfo *composite)
 {
   /*
     Blend pixel colors p and q by the amount given.
   */
-  CompositePixelInfoPlus(p,(double) (alpha*p->alpha),q,(double)
-    (beta*q->alpha),composite);
+  CompositePixelInfoPlus(p,(double) (alpha*p->alpha),q,(double) (beta*q->alpha),
+    composite);
 }
 
 #if defined(__cplusplus) || defined(c_plusplus)
index 4ec1dad5d4efd2e6dd3c11df6e15c335db33c2ad..8c2256c019f2b8016b9e8b46768c321c52565381 100644 (file)
@@ -191,8 +191,7 @@ static inline double MagickMax(const double x,const double y)
   return(y);
 }
 
-static inline double ConvertHueToRGB(double m1,
-  double m2,double hue)
+static inline double ConvertHueToRGB(double m1,double m2,double hue)
 {
   if (hue < 0.0)
     hue+=1.0;
@@ -736,15 +735,15 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
       const char
         *value;
 
-      PixelInfo
-        pixel;
-
       double
         angle_range,
         angle_start,
         height,
         width;
 
+      PixelInfo
+        pixel;
+
       ResampleFilter
         *resample_filter;
 
@@ -1050,21 +1049,19 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
             Displace the offset.
           */
           offset.x=(horizontal_scale*(GetPixelRed(composite_image,p)-
-            (((double) QuantumRange+1.0)/2.0)))/(((double)
-            QuantumRange+1.0)/2.0)+center.x+((compose == DisplaceCompositeOp) ?
-            x : 0);
-          offset.y=(vertical_scale*(GetPixelGreen(composite_image,p)-
-            (((double) QuantumRange+1.0)/2.0)))/(((double)
-            QuantumRange+1.0)/2.0)+center.y+((compose == DisplaceCompositeOp) ?
-            y : 0);
+            (((double) QuantumRange+1.0)/2.0)))/(((double) QuantumRange+1.0)/
+            2.0)+center.x+((compose == DisplaceCompositeOp) ? x : 0);
+          offset.y=(vertical_scale*(GetPixelGreen(composite_image,p)-(((double)
+            QuantumRange+1.0)/2.0)))/(((double) QuantumRange+1.0)/2.0)+center.y+
+            ((compose == DisplaceCompositeOp) ? y : 0);
           (void) InterpolatePixelInfo(image,image_view,
             UndefinedInterpolatePixel,(double) offset.x,(double) offset.y,
             &pixel,exception);
           /*
             Mask with the 'invalid pixel mask' in alpha channel.
           */
-          pixel.alpha=(double) QuantumRange*(1.0-(1.0-QuantumScale*
-            pixel.alpha)*(1.0-QuantumScale*GetPixelAlpha(composite_image,p)));
+          pixel.alpha=(double) QuantumRange*(1.0-(1.0-QuantumScale*pixel.alpha)*
+            (1.0-QuantumScale*GetPixelAlpha(composite_image,p)));
           SetPixelInfoPixel(destination_image,&pixel,q);
           p+=GetPixelChannels(composite_image);
           q+=GetPixelChannels(destination_image);
index 86a7fa5e3a7402def41a1a4f82062fdfaf5ae17c..2591610135330b09500e15c70ab1172d81eceebb 100644 (file)
@@ -311,7 +311,7 @@ static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
 #endif
 }
 
-static inline Quantum ScaleMapToQuantum(const double value)
+static inline Quantum ScaleMapToQuantum(const MagickRealType value)
 {
   if (value <= 0.0)
     return((Quantum) 0);
@@ -414,7 +414,7 @@ static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
 #endif
 }
 
-static inline Quantum ScaleMapToQuantum(const double value)
+static inline Quantum ScaleMapToQuantum(const MagickRealType value)
 {
   if (value <= 0.0)
     return((Quantum) 0);
@@ -503,7 +503,7 @@ static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
   return((Quantum) value);
 }
 
-static inline Quantum ScaleMapToQuantum(const double value)
+static inline Quantum ScaleMapToQuantum(const MagickRealType value)
 {
   if (value <= 0.0)
     return((Quantum) 0);
@@ -586,7 +586,7 @@ static inline Quantum ScaleLongLongToQuantum(const MagickSizeType value)
   return((Quantum) (18446744073709551615.0*value));
 }
 
-static inline Quantum ScaleMapToQuantum(const double value)
+static inline Quantum ScaleMapToQuantum(const MagickRealType value)
 {
   if (value <= 0.0)
     return((Quantum) 0);