]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 3 Oct 2011 14:00:35 +0000 (14:00 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 3 Oct 2011 14:00:35 +0000 (14:00 +0000)
MagickCore/fx.c
MagickWand/magick-image.c
PerlMagick/Magick.xs

index 20eef6582f0f0bb8377b7d911921450c57eb1089..114ac84107e4b2a292c2f1e06788aa433d953d96 100644 (file)
@@ -742,8 +742,8 @@ MagickExport Image *ColorizeImage(const Image *image,const char *blend,
   /*
     Determine RGB values of the pen color.
   */
-  flags=ParseGeometry(blend,&geometry_info);
   GetPixelInfo(image,&pixel);
+  flags=ParseGeometry(blend,&geometry_info);
   pixel.red=geometry_info.rho;
   pixel.green=geometry_info.rho;
   pixel.blue=geometry_info.rho;
@@ -5097,21 +5097,21 @@ MagickExport Image *SwirlImage(const Image *image,double degrees,
 %
 %  The format of the TintImage method is:
 %
-%      Image *TintImage(const Image *image,const char *opacity,
+%      Image *TintImage(const Image *image,const char *blend,
 %        const PixelInfo *tint,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %    o image: the image.
 %
-%    o opacity: A color value used for tinting.
+%    o blend: A color value used for tinting.
 %
 %    o tint: A color value used for tinting.
 %
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport Image *TintImage(const Image *image,const char *opacity,
+MagickExport Image *TintImage(const Image *image,const char *blend,
   const PixelInfo *tint,ExceptionInfo *exception)
 {
 #define TintImageTag  "Tint/Image"
@@ -5168,26 +5168,25 @@ MagickExport Image *TintImage(const Image *image,const char *opacity,
     Determine RGB values of the color.
   */
   GetPixelInfo(image,&pixel);
-  flags=ParseGeometry(opacity,&geometry_info);
+  flags=ParseGeometry(blend,&geometry_info);
   pixel.red=geometry_info.rho;
   pixel.green=geometry_info.rho;
   pixel.blue=geometry_info.rho;
-  pixel.black=geometry_info.rho;
   pixel.alpha=OpaqueAlpha;
   if ((flags & SigmaValue) != 0)
     pixel.green=geometry_info.sigma;
   if ((flags & XiValue) != 0)
     pixel.blue=geometry_info.xi;
+  if ((flags & PsiValue) != 0)
+    pixel.alpha=geometry_info.psi;
   if (image->colorspace == CMYKColorspace)
     {
+      pixel.black=geometry_info.rho;
       if ((flags & PsiValue) != 0)
         pixel.black=geometry_info.psi;
       if ((flags & ChiValue) != 0)
         pixel.alpha=geometry_info.chi;
     }
-  else
-    if ((flags & PsiValue) != 0)
-      pixel.alpha=geometry_info.psi;
   intensity=(MagickRealType) GetPixelInfoIntensity(tint);
   color_vector.red=(MagickRealType) (pixel.red*tint->red/100.0-intensity);
   color_vector.green=(MagickRealType) (pixel.green*tint->green/100.0-intensity);
index 9cfdd0b47e301fe0bd167f7321860e94e586c90c..8050cc1eeaa8b9a60bdf76111b122ff425fe8762 100644 (file)
@@ -1457,9 +1457,6 @@ WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
   PixelInfo
     target;
 
-  Quantum
-    virtual_pixel[MaxPixelChannels];
-
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
@@ -1481,13 +1478,7 @@ WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
       PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
       PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
       PixelGetAlphaQuantum(blend)));
-  PixelGetQuantumPixel(wand->images,colorize,virtual_pixel);
-  GetPixelInfo(wand->images,&target);
-  target.red=virtual_pixel[RedPixelChannel];
-  target.green=virtual_pixel[GreenPixelChannel];
-  target.blue=virtual_pixel[BluePixelChannel];
-  target.black=virtual_pixel[BlackPixelChannel];
-  target.alpha=virtual_pixel[AlphaPixelChannel];
+  target=PixelGetPixel(tint);
   colorize_image=ColorizeImage(wand->images,percent_blend,&target,
     wand->exception);
   if (colorize_image == (Image *) NULL)
@@ -11281,7 +11272,7 @@ WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
 %  The format of the MagickTintImage method is:
 %
 %      MagickBooleanType MagickTintImage(MagickWand *wand,
-%        const PixelWand *tint,const PixelWand *alpha)
+%        const PixelWand *tint,const PixelWand *blend)
 %
 %  A description of each parameter follows:
 %
@@ -11293,10 +11284,10 @@ WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
-  const PixelWand *tint,const PixelWand *alpha)
+  const PixelWand *tint,const PixelWand *blend)
 {
   char
-    percent_opaque[MaxTextExtent];
+    percent_blend[MaxTextExtent];
 
   Image
     *tint_image;
@@ -11311,22 +11302,22 @@ WandExport MagickBooleanType MagickTintImage(MagickWand *wand,
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
   if (wand->images->colorspace != CMYKColorspace)
-    (void) FormatLocaleString(percent_opaque,MaxTextExtent,
+    (void) FormatLocaleString(percent_blend,MaxTextExtent,
       "%g,%g,%g,%g",(double) (100.0*QuantumScale*
-      PixelGetRedQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetGreenQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetBlueQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetAlphaQuantum(alpha)));
+      PixelGetRedQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetGreenQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetBlueQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetAlphaQuantum(blend)));
   else
-    (void) FormatLocaleString(percent_opaque,MaxTextExtent,
+    (void) FormatLocaleString(percent_blend,MaxTextExtent,
       "%g,%g,%g,%g,%g",(double) (100.0*QuantumScale*
-      PixelGetCyanQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetMagentaQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetYellowQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetBlackQuantum(alpha)),(double) (100.0*QuantumScale*
-      PixelGetAlphaQuantum(alpha)));
+      PixelGetCyanQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetMagentaQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetYellowQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetBlackQuantum(blend)),(double) (100.0*QuantumScale*
+      PixelGetAlphaQuantum(blend)));
   target=PixelGetPixel(tint);
-  tint_image=TintImage(wand->images,percent_opaque,&target,wand->exception);
+  tint_image=TintImage(wand->images,percent_blend,&target,wand->exception);
   if (tint_image == (Image *) NULL)
     return(MagickFalse);
   ReplaceImageInList(&wand->images,tint_image);
index 91b0400d1b2a3d126913e2b6046d91015ffc4dda..c99ca4da4447deedef3de132398df47f6cc7bc1b 100644 (file)
@@ -428,7 +428,7 @@ static struct
     { "Thumbnail", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference} } },
     { "Strip", },
-    { "Tint", { {"fill", StringReference}, {"opacity", StringReference} } },
+    { "Tint", { {"fill", StringReference}, {"blend", StringReference} } },
     { "Channel", { {"channel", MagickChannelOptions} } },
     { "Splice", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference}, {"x", IntegerReference},