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;
}
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;
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);
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;
(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);
}
%
% 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,
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;
}
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);
}
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 *),
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--;
% 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);
(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));
}
\f
/*
(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);
/*
Remove a mask.
*/
- (void) SetImageMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+ exception);
break;
}
/*
}
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)
/*
Remove a mask.
*/
- (void) SetImageMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL,
+ exception);
break;
}
/*
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;
}
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)
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);
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;
}
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;
}
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;
}
}
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;
}
}
MAGICK_VERSION=7.0.0-0
-MAGICK_SVN_REVISION=19161:19162
+MAGICK_SVN_REVISION=19272M
# Substitute library versioning