diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp
index 28bf6f0..4a25742 100644
--- a/Magick++/lib/Image.cpp
+++ b/Magick++/lib/Image.cpp
@@ -1095,9 +1095,10 @@
GetPPException;
if (mask_.isValid())
- SetImageMask(image(),mask_.constImage(),exceptionInfo);
+ SetImageMask(image(),ReadPixelMask,mask_.constImage(),exceptionInfo);
else
- SetImageMask(image(),(MagickCore::Image *) NULL,exceptionInfo);
+ SetImageMask(image(),ReadPixelMask,(MagickCore::Image *) NULL,
+ exceptionInfo);
ThrowImageException;
}
diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h
index 964d1f5..e6ff878 100644
--- a/Magick++/lib/Magick++/Include.h
+++ b/Magick++/lib/Magick++/Include.h
@@ -968,6 +968,11 @@
using MagickCore::RGBAQuantum;
using MagickCore::CMYKQuantum;
+ // Pixel mask types
+ using MagickCore::UndefinedPixelMask;
+ using MagickCore::ReadPixelMask;
+ using MagickCore::WritePixelMask;
+
// Rendering intents
using MagickCore::RenderingIntent;
using MagickCore::UndefinedIntent;
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 453fb3e..f767820 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -1428,7 +1428,7 @@
exception);
clone_info->clip_mask=(char *) NULL;
status=NegateImage(clip_mask,MagickFalse,exception);
- (void) SetImageMask(image,clip_mask,exception);
+ (void) SetImageMask(image,ReadPixelMask,clip_mask,exception);
clip_mask=DestroyImage(clip_mask);
status&=DrawImage(image,clone_info,exception);
clone_info=DestroyDrawInfo(clone_info);
@@ -2262,7 +2262,8 @@
if (graphic_context[n]->clip_mask != (char *) NULL)
if (LocaleCompare(graphic_context[n]->clip_mask,
graphic_context[n-1]->clip_mask) != 0)
- (void) SetImageMask(image,(Image *) NULL,exception);
+ (void) SetImageMask(image,ReadPixelMask,(Image *) NULL,
+ exception);
graphic_context[n]=DestroyDrawInfo(graphic_context[n]);
n--;
break;
diff --git a/MagickCore/image.c b/MagickCore/image.c
index e5c4c40..8a20570 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -747,7 +747,7 @@
(void) NegateImage(clip_mask,MagickFalse,exception);
(void) FormatLocaleString(clip_mask->magick_filename,MagickPathExtent,
"8BIM:1999,2998:%s\nPS",pathname);
- (void) SetImageMask(image,clip_mask,exception);
+ (void) SetImageMask(image,ReadPixelMask,clip_mask,exception);
clip_mask=DestroyImage(clip_mask);
return(MagickTrue);
}
@@ -2899,20 +2899,22 @@
%
% The format of the SetImageMask method is:
%
-% MagickBooleanType SetImageMask(Image *image,const Image *mask,
-% ExceptionInfo *exception)
+% MagickBooleanType SetImageMask(Image *image,const PixelMask type,
+% const Image *mask,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o image: the image.
%
+% o type: the mask type, ReadPixelMask or WritePixelMask.
+%
% o mask: the image mask.
%
% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport MagickBooleanType SetImageMask(Image *image,const Image *mask,
- ExceptionInfo *exception)
+MagickExport MagickBooleanType SetImageMask(Image *image,const PixelMask type,
+ const Image *mask,ExceptionInfo *exception)
{
CacheView
*mask_view,
@@ -2933,10 +2935,18 @@
assert(image->signature == MagickCoreSignature);
if (mask == (const Image *) NULL)
{
- image->read_mask=MagickFalse;
+ switch (type)
+ {
+ case WritePixelMask: image->write_mask=MagickFalse; break;
+ default: image->read_mask=MagickFalse; break;
+ }
return(SyncImagePixelCache(image,exception));
}
- image->read_mask=MagickTrue;
+ switch (type)
+ {
+ case WritePixelMask: image->write_mask=MagickTrue; break;
+ default: image->read_mask=MagickTrue; break;
+ }
if (SyncImagePixelCache(image,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
@@ -2968,7 +2978,19 @@
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- SetPixelReadMask(image,ClampToQuantum(GetPixelIntensity(mask,p)),q);
+ switch (type)
+ {
+ case WritePixelMask:
+ {
+ SetPixelWriteMask(image,ClampToQuantum(GetPixelIntensity(mask,p)),q);
+ break;
+ }
+ default:
+ {
+ SetPixelReadMask(image,ClampToQuantum(GetPixelIntensity(mask,p)),q);
+ break;
+ }
+ }
p+=GetPixelChannels(mask);
q+=GetPixelChannels(image);
}
diff --git a/MagickCore/image.h b/MagickCore/image.h
index 6d13fc1..56b6f68 100644
--- a/MagickCore/image.h
+++ b/MagickCore/image.h
@@ -546,7 +546,7 @@
SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
- SetImageMask(Image *,const Image *,ExceptionInfo *),
+ SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *),
SetImageStorageClass(Image *,const ClassType,ExceptionInfo *),
StripImage(Image *,ExceptionInfo *),
SyncImage(Image *,ExceptionInfo *),
diff --git a/MagickWand/drawing-wand.c b/MagickWand/drawing-wand.c
index b6d029a..8becee0 100644
--- a/MagickWand/drawing-wand.c
+++ b/MagickWand/drawing-wand.c
@@ -6822,7 +6822,8 @@
if (CurrentContext->clip_mask != (char *) NULL)
if (LocaleCompare(CurrentContext->clip_mask,
wand->graphic_context[wand->index-1]->clip_mask) != 0)
- (void) SetImageMask(wand->image,(Image *) NULL);
+ (void) SetImageMask(wand->image,ReadPixelMask,(Image *) NULL,
+ wand->exception);
#endif
CurrentContext=DestroyDrawInfo(CurrentContext);
wand->index--;
diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c
index 10a0fb2..3480e4a 100644
--- a/MagickWand/magick-image.c
+++ b/MagickWand/magick-image.c
@@ -9142,17 +9142,19 @@
% The format of the MagickSetImageMask method is:
%
% MagickBooleanType MagickSetImageMask(MagickWand *wand,
-% const MagickWand *clip_mask)
+% const PixelMask type,const MagickWand *clip_mask)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
+% o type: type of mask, ReadPixelMask or WritePixelMask.
+%
% o clip_mask: the clip_mask wand.
%
*/
WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
- const MagickWand *clip_mask)
+ const PixelMask type,const MagickWand *clip_mask)
{
assert(wand != (MagickWand *) NULL);
assert(wand->signature == MagickWandSignature);
@@ -9164,7 +9166,7 @@
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
if (clip_mask->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
- return(SetImageMask(wand->images,clip_mask->images,wand->exception));
+ return(SetImageMask(wand->images,type,clip_mask->images,wand->exception));
}
/*
diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c
index 5a70a2c..8003e15 100644
--- a/MagickWand/mogrify.c
+++ b/MagickWand/mogrify.c
@@ -1057,7 +1057,8 @@
(void) SyncImageSettings(mogrify_info,*image,exception);
if (*option == '+')
{
- (void) SetImageMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+ exception);
break;
}
(void) ClipImage(*image,exception);
@@ -1086,7 +1087,8 @@
/*
Remove a mask.
*/
- (void) SetImageMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+ exception);
break;
}
/*
@@ -1120,7 +1122,7 @@
}
mask_view=DestroyCacheView(mask_view);
mask_image->alpha_trait=BlendPixelTrait;
- (void) SetImageMask(*image,mask_image,exception);
+ (void) SetImageMask(*image,ReadPixelMask,mask_image,exception);
break;
}
if (LocaleCompare("clip-path",option+1) == 0)
@@ -2111,7 +2113,8 @@
/*
Remove a mask.
*/
- (void) SetImageMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+ exception);
break;
}
/*
@@ -2120,7 +2123,7 @@
mask=GetImageCache(mogrify_info,argv[i+1],exception);
if (mask == (Image *) NULL)
break;
- (void) SetImageMask(*image,mask,exception);
+ (void) SetImageMask(*image,ReadPixelMask,mask,exception);
mask=DestroyImage(mask);
break;
}
diff --git a/MagickWand/operation.c b/MagickWand/operation.c
index f2bfd74..76b3da6 100644
--- a/MagickWand/operation.c
+++ b/MagickWand/operation.c
@@ -1986,7 +1986,7 @@
if (IfNormalOp)
(void) ClipImage(_image,_exception);
else /* "+mask" remove the write mask */
- (void) SetImageMask(_image,(Image *) NULL,_exception);
+ (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL,_exception);
break;
}
if (LocaleCompare("clip-mask",option+1) == 0)
@@ -2009,7 +2009,7 @@
if (IfPlusOp) {
/* use "+clip-mask" Remove the write mask for -clip-path */
- (void) SetImageMask(_image,(Image *) NULL,_exception);
+ (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL,_exception);
break;
}
mask_image=GetImageCache(_image_info,arg1,_exception);
@@ -2041,7 +2041,7 @@
mask_view=DestroyCacheView(mask_view);
mask_image->alpha_trait=BlendPixelTrait;
(void) SetImageColorspace(_image,GRAYColorspace,_exception);
- (void) SetImageMask(_image,mask_image,_exception);
+ (void) SetImageMask(_image,ReadPixelMask,mask_image,_exception);
mask_image=DestroyImage(mask_image);
break;
}
@@ -2746,14 +2746,15 @@
if (IfPlusOp)
{ /* Remove a mask. */
- (void) SetImageMask(_image,(Image *) NULL,_exception);
+ (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL,
+ _exception);
break;
}
/* Set the image mask. */
mask=GetImageCache(_image_info,arg1,_exception);
if (mask == (Image *) NULL)
break;
- (void) SetImageMask(_image,mask,_exception);
+ (void) SetImageMask(_image,ReadPixelMask,mask,_exception);
mask=DestroyImage(mask);
break;
}
diff --git a/coders/msl.c b/coders/msl.c
index a2fa229..6f024a5 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -6021,8 +6021,8 @@
exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageMask(msl_info->image[n],msl_info->image[j],
- exception);
+ SetImageMask(msl_info->image[n],ReadPixelMask,
+ msl_info->image[j],exception);
break;
}
}
@@ -6039,8 +6039,8 @@
exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageMask(msl_info->image[n],msl_info->image[j],
- exception);
+ SetImageMask(msl_info->image[n],ReadPixelMask,
+ msl_info->image[j],exception);
break;
}
}
diff --git a/configure b/configure
index 2c7af40..de94746 100755
--- a/configure
+++ b/configure
@@ -4379,7 +4379,7 @@
MAGICK_VERSION=7.0.0-0
-MAGICK_SVN_REVISION=19161:19162
+MAGICK_SVN_REVISION=19272M
# Substitute library versioning