From: cristy Date: Sun, 7 Jun 2015 14:07:19 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~934 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcd59345f8bbe67289229b663d9bb487cc620e13;p=imagemagick --- diff --git a/MagickCore/channel.c b/MagickCore/channel.c index ccb878212..4f78c94d6 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -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); diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 833927b4a..35c95e499 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -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) diff --git a/MagickCore/image.c b/MagickCore/image.c index 8376ec44b..877a85a64 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -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)); } /* diff --git a/MagickCore/montage.c b/MagickCore/montage.c index 483008f58..32d2b9cb7 100644 --- a/MagickCore/montage.c +++ b/MagickCore/montage.c @@ -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); } } /* diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 64b1e3acc..a98ab9199 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -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); } /* diff --git a/MagickCore/pixel.h b/MagickCore/pixel.h index b150f1347..14edf2266 100644 --- a/MagickCore/pixel.h +++ b/MagickCore/pixel.h @@ -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) } diff --git a/MagickWand/compare.c b/MagickWand/compare.c index 9c97e2a9a..58fef3df3 100644 --- a/MagickWand/compare.c +++ b/MagickWand/compare.c @@ -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) diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 1b01ebf61..2f5a4302c 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -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)); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% M a g i c k S e t I m a g e M a s k % % % % % % % diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h index eebddab3c..a0330f8f1 100644 --- a/MagickWand/magick-image.h +++ b/MagickWand/magick-image.h @@ -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 *); diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 6c02143a5..d2918ba12 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -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) diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 8b102cb3e..f23f11867 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -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) diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index 6ab79f49b..8abbbf2ea 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -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", diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index 57cee8c0f..11a8d9740 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -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",