]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 7 Jun 2015 14:07:19 +0000 (14:07 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 7 Jun 2015 14:07:19 +0000 (14:07 +0000)
13 files changed:
MagickCore/channel.c
MagickCore/fx.c
MagickCore/image.c
MagickCore/montage.c
MagickCore/pixel.c
MagickCore/pixel.h
MagickWand/compare.c
MagickWand/magick-image.c
MagickWand/magick-image.h
MagickWand/mogrify.c
MagickWand/operation.c
PerlMagick/Magick.xs
PerlMagick/quantum/quantum.xs.in

index ccb878212469783d4cc25ac46096c2594bdf44e1..4f78c94d6bd7008eba58b895b04f4c1302c5e4b6 100644 (file)
@@ -274,7 +274,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
         Image
           *canvas;
 
-        SetPixelChannelMask(destination_image,channel_mask);
+        (void) SetPixelChannelMask(destination_image,channel_mask);
         if ((channel_op == ExtractChannelOp) && (channels == 1))
           (void) SetImageColorspace(destination_image,GRAYColorspace,exception);
         status=SetImageStorageClass(destination_image,DirectClass,exception);
@@ -424,7 +424,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
     if (status == MagickFalse)
       break;
   }
-  SetPixelChannelMask(destination_image,channel_mask);
+  (void) SetPixelChannelMask(destination_image,channel_mask);
   if ((channel_op == ExtractChannelOp) && (channels == 1))
     (void) SetImageColorspace(destination_image,GRAYColorspace,exception);
   status=SetImageStorageClass(destination_image,DirectClass,exception);
index 833927b4a80556cf73c872b6aa9fe94ed65ae8a5..35c95e4994c5351574b258fe805eedbe2f6c0a7b 100644 (file)
@@ -1122,7 +1122,7 @@ static double FxChannelStatistics(FxInfo *fx_info,Image *image,
         {
           channel=(PixelChannel) option;
           channel_mask=(ChannelType) (channel_mask | (1 << channel));
-          SetPixelChannelMask(image,channel_mask);
+          (void) SetPixelChannelMask(image,channel_mask);
         }
     }
   (void) FormatLocaleString(key,MagickPathExtent,"%p.%.20g.%s",(void *) image,
@@ -1131,7 +1131,7 @@ static double FxChannelStatistics(FxInfo *fx_info,Image *image,
   if (value != (const char *) NULL)
     {
       if (channel_mask != UndefinedChannel)
-        SetPixelChannelMask(image,channel_mask);
+        (void) SetPixelChannelMask(image,channel_mask);
       return(QuantumScale*StringToDouble(value,(char **) NULL));
     }
   (void) DeleteNodeFromSplayTree(fx_info->symbols,key);
@@ -1199,7 +1199,7 @@ static double FxChannelStatistics(FxInfo *fx_info,Image *image,
         standard_deviation);
     }
   if (channel_mask != UndefinedChannel)
-    SetPixelChannelMask(image,channel_mask);
+    (void) SetPixelChannelMask(image,channel_mask);
   (void) AddValueToSplayTree(fx_info->symbols,ConstantString(key),
     ConstantString(statistic));
   return(QuantumScale*StringToDouble(statistic,(char **) NULL));
@@ -4343,7 +4343,7 @@ MagickExport Image *ShadowImage(const Image *image,const double alpha,
   border_image=DestroyImage(border_image);
   if (shadow_image == (Image *) NULL)
     return((Image *) NULL);
-  SetPixelChannelMask(shadow_image,channel_mask);
+  (void) SetPixelChannelMask(shadow_image,channel_mask);
   if (shadow_image->page.width == 0)
     shadow_image->page.width=shadow_image->columns;
   if (shadow_image->page.height == 0)
index 8376ec44b3d3ed9eeb5e5fd8c95b5d3ee27e996d..877a85a64ca3c1a8579690bae002c1fa7b639cc8 100644 (file)
@@ -2146,13 +2146,7 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image,
 MagickExport ChannelType SetImageChannelMask(Image *image,
   const ChannelType channel_mask)
 {
-  ChannelType
-    mask;
-
-  mask=image->channel_mask;
-  image->channel_mask=channel_mask;
-  SetPixelChannelMask(image,channel_mask);
-  return(mask);
+  return(SetPixelChannelMask(image,channel_mask));
 }
 \f
 /*
index 483008f5820f5f4782bf63da817c3f22fa884d53..32d2b9cb769d4281dc5750e79cf0199679c3e732 100644 (file)
@@ -743,9 +743,9 @@ MagickExport Image *MontageImageList(const ImageInfo *image_info,
           if ((montage_info->frame != (char *) NULL) &&
               (image->compose == DstOutCompositeOp))
             {
-              SetPixelChannelMask(image,AlphaChannel);
+              (void) SetPixelChannelMask(image,AlphaChannel);
               (void) NegateImage(image,MagickFalse,exception);
-              SetPixelChannelMask(image,DefaultChannels);
+              (void) SetPixelChannelMask(image,DefaultChannels);
             }
         }
       /*
index 64b1e3acc9889a01653aef9fbab50341e240d776..a98ab9199a11f8684d29d1a3804c3a50ffd9dfd3 100644 (file)
@@ -6242,7 +6242,8 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p,
 %
 %  The format of the SetPixelChannelMask method is:
 %
-%      void SetPixelChannelMask(Image *image,const ChannelType channel_mask)
+%      ChannelType SetPixelChannelMask(Image *image,
+%        const ChannelType channel_mask)
 %
 %  A description of each parameter follows:
 %
@@ -6251,17 +6252,23 @@ MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p,
 %    o channel_mask: the channel mask.
 %
 */
-MagickExport void SetPixelChannelMask(Image *image,
+MagickExport ChannelType SetPixelChannelMask(Image *image,
   const ChannelType channel_mask)
 {
 #define GetChannelBit(mask,bit)  (((size_t) (mask) >> (size_t) (bit)) & 0x01)
 
+  ChannelType
+    mask;
+
   register ssize_t
     i;
 
+  assert(image != (Image *) NULL);
+  assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(PixelEvent,GetMagickModule(),"%s[%08x]",
       image->filename,channel_mask);
+  mask=image->channel_mask;
   image->channel_mask=channel_mask;
   for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
   {
@@ -6297,6 +6304,7 @@ MagickExport void SetPixelChannelMask(Image *image,
     SetPixelChannelTraits(image,WriteMaskPixelChannel,CopyPixelTrait);
   if (image->debug != MagickFalse)
     LogPixelChannels(image);
+  return(mask);
 }
 \f
 /*
index b150f1347f092883896fe6abddaace0e7c10d9d9..14edf2266ae93ab3db4cd7d2091afe36afdd8f49 100644 (file)
@@ -208,6 +208,9 @@ typedef struct _CacheView
 /*
   Pixel method declarations.
 */
+extern MagickExport ChannelType
+  SetPixelChannelMask(Image *,const ChannelType);
+
 extern MagickExport MagickBooleanType
   ExportImagePixels(Image *,const ssize_t,const ssize_t,const size_t,
     const size_t,const char *,const StorageType,void *,ExceptionInfo *),
@@ -248,8 +251,7 @@ extern MagickExport MagickRealType
 extern MagickExport void
   ConformPixelInfo(Image *,const PixelInfo *,PixelInfo *,ExceptionInfo *),
   GetPixelInfo(const Image *,PixelInfo *),
-  InitializePixelChannelMap(Image *),
-  SetPixelChannelMask(Image *,const ChannelType);
+  InitializePixelChannelMap(Image *);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index 9c97e2a9a27f504eedc54fe8ae11052d6cee2ed2..58fef3df38e788a5dba7688a464b552607ad21a2 100644 (file)
@@ -392,7 +392,7 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info,
             if (channel < 0)
               ThrowCompareException(OptionError,"UnrecognizedChannelType",
                 argv[i]);
-            SetPixelChannelMask(image,(ChannelType) channel);
+            (void) SetPixelChannelMask(image,(ChannelType) channel);
             break;
           }
         if (LocaleCompare("colorspace",option+1) == 0)
index 1b01ebf61499c85b2a704b2cac638808fff714d1..2f5a4302c9c24bbf728b80265a04789922446416 100644 (file)
@@ -8988,7 +8988,42 @@ WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k S e t I m a g e C l i p M a s k                               %
+%   M a g i c k S e t I m a g e C h a n n e l M a s k                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickSetImageChannelMask() sets image channel mask.
+%
+%  The format of the MagickSetImageChannelMask method is:
+%
+%      ChannelType MagickSetImageChannelMask(MagickWand *wand,
+%        const ChannelType channel_mask)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o channel_mask: the channel_mask wand.
+%
+*/
+WandExport ChannelType MagickSetImageChannelMask(MagickWand *wand,
+  const ChannelType channel_mask)
+{
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (IfMagickTrue(wand->debug))
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  return(SetImageChannelMask(wand->images,channel_mask));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   M a g i c k S e t I m a g e M a s k                                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
index eebddab3c313e918ddb4b3b3a500ca01877ef258..a0330f8f1221300373cac6aee52a98d69d2f2ee4 100644 (file)
@@ -26,6 +26,9 @@ extern "C" {
 extern WandExport ChannelFeatures
   *MagickGetImageFeatures(MagickWand *,const size_t);
 
+extern WandExport ChannelType
+   MagickSetImageChannelMask(MagickWand *,const ChannelType);
+
 extern WandExport ChannelStatistics
   *MagickGetImageStatistics(MagickWand *);
 
index 6c02143a562bb3205e0fc0896f5f67edea4b171d..d2918ba12d298480f5efcff489cb472bcf0b3fd4 100644 (file)
@@ -1020,11 +1020,11 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             (void) SyncImageSettings(mogrify_info,*image,exception);
             if (*option == '+')
               {
-                SetPixelChannelMask(*image,DefaultChannels);
+                (void) SetPixelChannelMask(*image,DefaultChannels);
                 break;
               }
             channel=(ChannelType) ParseChannelOption(argv[i+1]);
-            SetPixelChannelMask(*image,channel);
+            (void) SetPixelChannelMask(*image,channel);
             break;
           }
         if (LocaleCompare("charcoal",option+1) == 0)
index 8b102cb3effee820aabe815575d908dd04b70100..f23f11867c2cb0d59ba3787bc297a287ad283612 100644 (file)
@@ -1945,14 +1945,14 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
         {
           if (IfPlusOp)
             {
-              SetPixelChannelMask(_image,DefaultChannels);
+              (void) SetPixelChannelMask(_image,DefaultChannels);
               break;
             }
           parse=ParseChannelOption(arg1);
           if (parse < 0)
             CLIWandExceptArgBreak(OptionError,"UnrecognizedIntensityMethod",
               option,arg1);
-          SetPixelChannelMask(_image,(ChannelType) parse);
+          (void) SetPixelChannelMask(_image,(ChannelType) parse);
           break;
         }
       if (LocaleCompare("charcoal",option+1) == 0)
index 6ab79f49b53054d821845d0f81b270f53159508c..8abbbf2eaa7db0e3d4b3edb41c9baea96620212a 100644 (file)
@@ -3343,7 +3343,7 @@ Compare(ref,...)
                     "UnrecognizedType",SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMask(image,(ChannelType) option);
+              (void) SetPixelChannelMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -6468,7 +6468,7 @@ GetPixel(ref,...)
                     SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMask(image,(ChannelType) option);
+              (void) SetPixelChannelMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
index 57cee8c0f32b1443effe33c8a0062b35e6ab0c38..11a8d974002596bfcbd2d073368fcbe9a404acf5 100644 (file)
@@ -3343,7 +3343,7 @@ Compare(ref,...)
                     "UnrecognizedType",SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMask(image,(ChannelType) option);
+              (void) SetPixelChannelMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -6468,7 +6468,7 @@ GetPixel(ref,...)
                     SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMask(image,(ChannelType) option);
+              (void) SetPixelChannelMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",