if( clipMask_.isValid() )
{
// Set clip mask
- SetImageClipMask( image(), clipMask_.constImage(), &exceptionInfo );
+ SetImageMask( image(), clipMask_.constImage(), &exceptionInfo );
}
else
{
// Unset existing clip mask
- SetImageClipMask( image(), 0, &exceptionInfo );
+ SetImageMask( image(), 0, &exceptionInfo );
}
throwException( exceptionInfo );
(void) DestroyExceptionInfo( &exceptionInfo );
using MagickCore::SeparateImage;
using MagickCore::SetClientName;
using MagickCore::SetGeometry;
+ using MagickCore::SetImageAlpha;
using MagickCore::SetImageBackgroundColor;
using MagickCore::SetImageDepth;
- using MagickCore::SetImageClipMask;
- using MagickCore::SetImageDepth;
using MagickCore::SetImageExtent;
using MagickCore::SetImageInfo;
using MagickCore::SetImageInfoFile;
- using MagickCore::SetImageAlpha;
+ using MagickCore::SetImageMask;
using MagickCore::SetImageOption;
using MagickCore::SetImageProfile;
using MagickCore::SetImageProperty;
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
if ((traits == UndefinedPixelTrait) ||
- (channel == IndexPixelChannel))
+ (channel == IndexPixelChannel) || (channel == MaskPixelChannel))
continue;
if (depth_map[ScaleQuantumToMap(p[i])] > current_depth[id])
current_depth[id]=depth_map[ScaleQuantumToMap(p[i])];
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
- if ((traits == UndefinedPixelTrait) ||
- (channel == IndexPixelChannel))
+ if ((traits == UndefinedPixelTrait) || (channel == IndexPixelChannel) ||
+ (channel == MaskPixelChannel))
continue;
while (current_depth[id] < MAGICKCORE_QUANTUM_DEPTH)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
if ((traits == UndefinedPixelTrait) ||
- (channel == IndexPixelChannel))
+ (channel == IndexPixelChannel) || (channel == MaskPixelChannel))
continue;
q[i]=depth_map[ScaleQuantumToMap(q[i])];
}
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
- if ((traits == UndefinedPixelTrait) || (channel == IndexPixelChannel))
+ if ((traits == UndefinedPixelTrait) || (channel == IndexPixelChannel) ||
+ (channel == MaskPixelChannel))
continue;
q[i]=ScaleAnyToQuantum(ScaleQuantumToAny(q[i],range),range);
}
colorspace;
MagickBooleanType
- matte;
+ matte,
+ masky;
size_t
columns,
% %
% %
% %
-+ C l i p P i x e l C a c h e N e x u s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ClipPixelCacheNexus() clips the cache nexus as defined by the image clip
-% mask. It returns MagickTrue if the pixel region is clipped, otherwise
-% MagickFalse.
-%
-% The format of the ClipPixelCacheNexus() method is:
-%
-% MagickBooleanType ClipPixelCacheNexus(Image *image,NexusInfo *nexus_info,
-% ExceptionInfo *exception)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-% o nexus_info: the cache nexus to clip.
-%
-% o exception: return any errors or warnings in this structure.
-%
-*/
-static MagickBooleanType ClipPixelCacheNexus(Image *image,
- NexusInfo *nexus_info,ExceptionInfo *exception)
-{
- CacheInfo
- *cache_info;
-
- MagickSizeType
- number_pixels;
-
- NexusInfo
- **clip_nexus,
- **image_nexus;
-
- register const Quantum
- *restrict p,
- *restrict r;
-
- register Quantum
- *restrict q;
-
- register ssize_t
- x;
-
- /*
- Clip the image as defined by the clipping mask.
- */
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- if (image->clip_mask == (Image *) NULL)
- return(MagickFalse);
- cache_info=(CacheInfo *) image->cache;
- if (cache_info == (Cache) NULL)
- return(MagickFalse);
- image_nexus=AcquirePixelCacheNexus(1);
- clip_nexus=AcquirePixelCacheNexus(1);
- if ((image_nexus == (NexusInfo **) NULL) ||
- (clip_nexus == (NexusInfo **) NULL))
- ThrowBinaryException(CacheError,"UnableToGetCacheNexus",image->filename);
- p=(const Quantum *) GetAuthenticPixelCacheNexus(image,nexus_info->region.x,
- nexus_info->region.y,nexus_info->region.width,nexus_info->region.height,
- image_nexus[0],exception);
- q=nexus_info->pixels;
- r=GetVirtualPixelsFromNexus(image->clip_mask,MaskVirtualPixelMethod,
- nexus_info->region.x,nexus_info->region.y,nexus_info->region.width,
- nexus_info->region.height,clip_nexus[0],exception);
- number_pixels=(MagickSizeType) nexus_info->region.width*
- nexus_info->region.height;
- for (x=0; x < (ssize_t) number_pixels; x++)
- {
- register ssize_t
- i;
-
- if ((p == (const Quantum *) NULL) || (r == (const Quantum *) NULL))
- break;
- if (GetPixelIntensity(image->clip_mask,r) > ((Quantum) QuantumRange/2))
- for (i=0; i < (ssize_t) image->number_channels; i++)
- {
- PixelChannel
- channel;
-
- PixelTrait
- traits;
-
- channel=GetPixelChannelMapChannel(image,i);
- traits=GetPixelChannelMapTraits(image,channel);
- if (traits == UndefinedPixelTrait)
- continue;
- q[i]=p[i];
- }
- p+=GetPixelChannels(image);
- q+=GetPixelChannels(image);
- r+=GetPixelChannels(image->clip_mask);
- }
- clip_nexus=DestroyPixelCacheNexus(clip_nexus,1);
- image_nexus=DestroyPixelCacheNexus(image_nexus,1);
- if (x < (ssize_t) number_pixels)
- return(MagickFalse);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
+ C l o n e P i x e l C a c h e %
% %
% %
if ((image->storage_class != cache_info->storage_class) ||
(image->colorspace != cache_info->colorspace) ||
(image->matte != cache_info->matte) ||
+ (image->masky != cache_info->masky) ||
(image->columns != cache_info->columns) ||
(image->rows != cache_info->rows) ||
(image->number_channels != cache_info->number_channels) ||
% %
% %
% %
-+ M a s k P i x e l C a c h e N e x u s %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% MaskPixelCacheNexus() masks the cache nexus as defined by the image mask.
-% The method returns MagickTrue if the pixel region is masked, otherwise
-% MagickFalse.
-%
-% The format of the MaskPixelCacheNexus() method is:
-%
-% MagickBooleanType MaskPixelCacheNexus(Image *image,
-% NexusInfo *nexus_info,ExceptionInfo *exception)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-% o nexus_info: the cache nexus to clip.
-%
-% o exception: return any errors or warnings in this structure.
-%
-*/
-static MagickBooleanType MaskPixelCacheNexus(Image *image,NexusInfo *nexus_info,
- ExceptionInfo *exception)
-{
- CacheInfo
- *cache_info;
-
- MagickSizeType
- number_pixels;
-
- NexusInfo
- **clip_nexus,
- **image_nexus;
-
- register const Quantum
- *restrict p,
- *restrict r;
-
- register Quantum
- *restrict q;
-
- register ssize_t
- x;
-
- /*
- Prevent updates to image pixels specified by the mask.
- */
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- if (image->mask == (Image *) NULL)
- return(MagickFalse);
- cache_info=(CacheInfo *) image->cache;
- if (cache_info == (Cache) NULL)
- return(MagickFalse);
- image_nexus=AcquirePixelCacheNexus(1);
- clip_nexus=AcquirePixelCacheNexus(1);
- if ((image_nexus == (NexusInfo **) NULL) ||
- (clip_nexus == (NexusInfo **) NULL))
- ThrowBinaryException(CacheError,"UnableToGetCacheNexus",image->filename);
- p=(const Quantum *) GetAuthenticPixelCacheNexus(image,
- nexus_info->region.x,nexus_info->region.y,nexus_info->region.width,
- nexus_info->region.height,image_nexus[0],exception);
- q=nexus_info->pixels;
- r=GetVirtualPixelsFromNexus(image->mask,MaskVirtualPixelMethod,
- nexus_info->region.x,nexus_info->region.y,nexus_info->region.width,
- nexus_info->region.height,clip_nexus[0],exception);
- number_pixels=(MagickSizeType) nexus_info->region.width*
- nexus_info->region.height;
- for (x=0; x < (ssize_t) number_pixels; x++)
- {
- MagickRealType
- alpha,
- Da,
- gamma,
- Sa;
-
- register ssize_t
- i;
-
- if ((p == (const Quantum *) NULL) || (r == (const Quantum *) NULL))
- break;
- Sa=QuantumScale*GetPixelIntensity(image->mask,r);
- Da=QuantumScale*GetPixelAlpha(image,q);
- alpha=Sa*(-Da)+Sa+Da;
- gamma=1.0/(fabs(alpha) <= MagickEpsilon ? 1.0 : alpha);
- for (i=0; i < (ssize_t) image->number_channels; i++)
- {
- MagickRealType
- Dc,
- pixel,
- Sc;
-
- PixelChannel
- channel;
-
- PixelTrait
- traits;
-
- channel=GetPixelChannelMapChannel(image,i);
- traits=GetPixelChannelMapTraits(image,channel);
- if (traits == UndefinedPixelTrait)
- continue;
- Sc=(MagickRealType) p[i];
- Dc=(MagickRealType) q[i];
- pixel=gamma*(Sa*Sc-Sa*Da*Dc+Da*Dc);
- q[i]=ClampToQuantum(pixel);
- }
- p+=GetPixelChannels(image);
- q+=GetPixelChannels(image);
- r+=GetPixelChannels(image->mask);
- }
- clip_nexus=DestroyPixelCacheNexus(clip_nexus,1);
- image_nexus=DestroyPixelCacheNexus(image_nexus,1);
- if (x < (ssize_t) number_pixels)
- return(MagickFalse);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
+ O p e n P i x e l C a c h e %
% %
% %
cache_info->storage_class=image->storage_class;
cache_info->colorspace=image->colorspace;
cache_info->matte=image->matte;
+ cache_info->masky=image->masky;
cache_info->rows=image->rows;
cache_info->columns=image->columns;
InitializePixelChannelMap(image);
if (cache_info->type == UndefinedCache)
return((Quantum *) NULL);
nexus_info->region=(*region);
- if ((cache_info->type != DiskCache) && (cache_info->type != PingCache) &&
- (image->clip_mask == (Image *) NULL) && (image->mask == (Image *) NULL))
+ if ((cache_info->type != DiskCache) && (cache_info->type != PingCache))
{
ssize_t
x,
assert(cache_info->signature == MagickSignature);
if (cache_info->type == UndefinedCache)
return(MagickFalse);
- if ((image->clip_mask != (Image *) NULL) &&
- (ClipPixelCacheNexus(image,nexus_info,exception) == MagickFalse))
- return(MagickFalse);
- if ((image->mask != (Image *) NULL) &&
- (MaskPixelCacheNexus(image,nexus_info,exception) == MagickFalse))
- return(MagickFalse);
if (IsPixelAuthentic(cache_info,nexus_info) != MagickFalse)
return(MagickTrue);
assert(cache_info->signature == MagickSignature);
i;
difference=MagickFalse;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ r+=GetPixelChannels(highlight_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
i;
difference=MagickFalse;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
reconstruct_statistics[channel].mean);
}
p+=GetPixelChannels(image);
- q+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
}
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
if (status == MagickFalse)
continue;
p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
- q=GetCacheViewVirtualPixels(reconstruct_view,0,y,
- reconstruct_image->columns,1,exception);
+ q=GetCacheViewVirtualPixels(reconstruct_view,0,y,reconstruct_image->columns,
+ 1,exception);
if ((p == (const Quantum *) NULL) || (q == (const Quantum *) NULL))
{
status=MagickFalse;
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
channel_distortion[CompositePixelChannel]=distance;
}
p+=GetPixelChannels(image);
- q+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
}
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp critical (MagickCore_GetPeakAbsoluteError)
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(reconstruct_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
offset->x=x;
offset->y=y;
}
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
*/
(void) GetOneVirtualPixel(composite_image,x-x_offset,y-y_offset,
source,exception);
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
- composite_traits=GetPixelChannelMapTraits(composite_image,
- channel);
+ composite_traits=GetPixelChannelMapTraits(composite_image,channel);
if ((traits == UndefinedPixelTrait) ||
(composite_traits == UndefinedPixelTrait))
continue;
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(composite_image);
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(composite_image); i++)
{
PixelChannel
*/
(void) GetOneVirtualPixel(composite_image,x-x_offset,y-y_offset,
source,exception);
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
break;
}
}
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(composite_image);
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
double
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(texture_image);
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(texture_image); i++)
{
PixelChannel
if (*write_info->magick == '\0')
(void) CopyMagickString(write_info->magick,image->magick,MaxTextExtent);
(void) SetImageInfo(write_info,1,sans_exception);
- if (LocaleCompare(write_info->magick,"clipmask") == 0)
- {
- if (image->clip_mask == (Image *) NULL)
- {
- (void) ThrowMagickException(exception,GetMagickModule(),
- OptionError,"NoClipPathDefined","`%s'",image->filename);
- return(MagickFalse);
- }
- image=image->clip_mask;
- (void) SetImageInfo(write_info,1,sans_exception);
- }
(void) CopyMagickString(filename,image->filename,MaxTextExtent);
(void) CopyMagickString(image->filename,write_info->filename,MaxTextExtent);
domain=CoderPolicyDomain;
}
for (x=0; x < y; x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
}
for ( ; x < (ssize_t) (image->columns-y); x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
}
for ( ; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
}
for (x=0; x < (ssize_t) raise_info->width; x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
q+=GetPixelChannels(image);
for ( ; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
}
for (x=0; x < (ssize_t) (image->rows-y); x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
}
for ( ; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
const DrawInfo *draw_info,const char *name,ExceptionInfo *exception)
{
char
- clip_mask[MaxTextExtent];
+ filename[MaxTextExtent];
+
+ Image
+ *clip_mask;
const char
*value;
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(draw_info != (const DrawInfo *) NULL);
- (void) FormatLocaleString(clip_mask,MaxTextExtent,"%s",name);
- value=GetImageArtifact(image,clip_mask);
+ (void) FormatLocaleString(filename,MaxTextExtent,"%s",name);
+ value=GetImageArtifact(image,filename);
if (value == (const char *) NULL)
return(MagickFalse);
- if (image->clip_mask == (Image *) NULL)
- {
- Image
- *clip_mask;
-
- clip_mask=CloneImage(image,image->columns,image->rows,MagickTrue,
- exception);
- if (clip_mask == (Image *) NULL)
- return(MagickFalse);
- (void) SetImageClipMask(image,clip_mask,exception);
- clip_mask=DestroyImage(clip_mask);
- }
+ clip_mask=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
+ if (clip_mask == (Image *) NULL)
+ return(MagickFalse);
(void) QueryColorCompliance("#0000",AllCompliance,
- &image->clip_mask->background_color,exception);
- image->clip_mask->background_color.alpha=(Quantum) TransparentAlpha;
- (void) SetImageBackgroundColor(image->clip_mask,exception);
+ &clip_mask->background_color,exception);
+ clip_mask->background_color.alpha=(Quantum) TransparentAlpha;
+ (void) SetImageBackgroundColor(clip_mask,exception);
if (image->debug != MagickFalse)
(void) LogMagickEvent(DrawEvent,GetMagickModule(),"\nbegin clip-path %s",
draw_info->clip_mask);
(void) QueryColorCompliance("#ffffff",AllCompliance,&clone_info->fill,
exception);
clone_info->clip_mask=(char *) NULL;
- status=DrawImage(image->clip_mask,clone_info,exception);
- status|=NegateImage(image->clip_mask,MagickFalse,exception);
+ status|=NegateImage(clip_mask,MagickFalse,exception);
+ (void) SetImageMask(image,clip_mask,exception);
+ clip_mask=DestroyImage(clip_mask);
clone_info=DestroyDrawInfo(clone_info);
+ status=DrawImage(image,clone_info,exception);
if (image->debug != MagickFalse)
(void) LogMagickEvent(DrawEvent,GetMagickModule(),"end clip-path");
return(status != 0 ? MagickTrue : MagickFalse);
if (graphic_context[n]->clip_mask != (char *) NULL)
if (LocaleCompare(graphic_context[n]->clip_mask,
graphic_context[n-1]->clip_mask) != 0)
- (void) SetImageClipMask(image,(Image *) NULL,exception);
+ image->masky=MagickFalse;
graphic_context[n]=DestroyDrawInfo(graphic_context[n]);
n--;
break;
break;
center=(ssize_t) GetPixelChannels(image)*(width-j)*
((width-j)/2L)+GetPixelChannels(image)*((width-j)/2L);
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(blur_image);
+ r+=GetPixelChannels(edge_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
break;
center=(ssize_t) GetPixelChannels(image)*(width-j)*
((width-j)/2L)+GetPixelChannels(image)*((width-j)/2);
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(sharp_image);
+ r+=GetPixelChannels(edge_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(blur_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(blur_image,p) != 0)
+ {
+ p+=GetPixelChannels(blur_image);
+ q+=GetPixelChannels(blur_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(blur_image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(convolve_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(blur_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
if (step >= n)
step=n-1;
}
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(blur_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(blur_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
shade=distance/sqrt((double) normal_distance);
}
}
+ if (GetPixelMask(image,pre) != 0)
+ {
+ pre+=GetPixelChannels(image);
+ center+=GetPixelChannels(image);
+ post+=GetPixelChannels(image);
+ q+=GetPixelChannels(shade_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(unsharp_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(clut_image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(enhance_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
- if (IsPixelGray(image,q) != MagickFalse)
+ if ((GetPixelMask(image,q) != 0) ||
+ (IsPixelGray(image,q) != MagickFalse))
{
q+=GetPixelChannels(image);
continue;
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(noise_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(colorize_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(fx_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
/*
Determine if the pixel is within an ellipse.
*/
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(implode_image);
+ continue;
+ }
delta.x=scale.x*(double) (x-center.x);
distance=delta.x*delta.x+delta.y*delta.y;
if (distance >= (radius*radius))
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ if (GetPixelMask(morph_image,p) != 0)
+ {
+ p+=GetPixelChannels(morph_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(morph_image); i++)
{
PixelChannel
channel;
register ssize_t
i;
+ if (GetPixelMask(random_image,q) != 0)
+ {
+ q+=GetPixelChannels(random_image);
+ continue;
+ }
value=GetPseudoRandomValue(random_info[id]);
for (i=0; i < (ssize_t) GetPixelChannels(random_image); i++)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
/*
Determine if the pixel is within an ellipse.
*/
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(swirl_image);
+ continue;
+ }
delta.x=scale.x*(double) (x-center.x);
distance=delta.x*delta.x+delta.y*delta.y;
if (distance >= (radius*radius))
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(tint_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
image->resolution.y=DefaultResolution;
image->units=PixelsPerInchResolution;
GetTimerInfo(&image->timer);
- image->ping=MagickFalse;
image->cache=AcquirePixelCache(0);
image->channel_mask=DefaultChannels;
image->channel_map=AcquirePixelChannelMap();
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(append_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
(void) NegateImage(clip_mask,MagickFalse,exception);
(void) FormatLocaleString(clip_mask->magick_filename,MaxTextExtent,
"8BIM:1999,2998:%s\nPS",pathname);
- (void) SetImageClipMask(image,clip_mask,exception);
+ (void) SetImageMask(image,clip_mask,exception);
clip_mask=DestroyImage(clip_mask);
return(MagickTrue);
}
clone_image->number_meta_channels=image->number_meta_channels;
clone_image->metacontent_extent=image->metacontent_extent;
clone_image->colorspace=image->colorspace;
+ clone_image->masky=image->masky;
clone_image->matte=image->matte;
clone_image->columns=image->columns;
clone_image->rows=image->rows;
clone_image->next=image->next;
clone_image->previous=image->previous;
clone_image->list=NewImageList();
- clone_image->clip_mask=NewImageList();
- clone_image->mask=NewImageList();
if (detach == MagickFalse)
clone_image->blob=ReferenceBlob(image->blob);
else
(void) CloneString(&clone_image->montage,image->montage);
if (image->directory != (char *) NULL)
(void) CloneString(&clone_image->directory,image->directory);
- if (image->clip_mask != (Image *) NULL)
- clone_image->clip_mask=CloneImage(image->clip_mask,0,0,MagickTrue,
- exception);
- if (image->mask != (Image *) NULL)
- clone_image->mask=CloneImage(image->mask,0,0,MagickTrue,exception);
clone_image->cache=ReferencePixelCache(image->cache);
return(clone_image);
}
- if ((columns == image->columns) && (rows == image->rows))
- {
- if (image->clip_mask != (Image *) NULL)
- clone_image->clip_mask=CloneImage(image->clip_mask,0,0,MagickTrue,
- exception);
- if (image->mask != (Image *) NULL)
- clone_image->mask=CloneImage(image->mask,0,0,MagickTrue,exception);
- }
scale=(MagickRealType) columns/(MagickRealType) image->columns;
clone_image->page.width=(size_t) floor(scale*image->page.width+0.5);
clone_image->page.x=(ssize_t) ceil(scale*image->page.x-0.5);
*/
DestroyImagePixels(image);
image->channel_map=DestroyPixelChannelMap(image->channel_map);
- if (image->clip_mask != (Image *) NULL)
- image->clip_mask=DestroyImage(image->clip_mask);
- if (image->mask != (Image *) NULL)
- image->mask=DestroyImage(image->mask);
if (image->montage != (char *) NULL)
image->montage=DestroyString(image->montage);
if (image->directory != (char *) NULL)
% %
% %
% %
-% G e t I m a g e C l i p M a s k %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% GetImageClipMask() returns the clip path associated with the image.
-%
-% The format of the GetImageClipMask method is:
-%
-% Image *GetImageClipMask(const Image *image,ExceptionInfo *exception)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-*/
-MagickExport Image *GetImageClipMask(const Image *image,
- ExceptionInfo *exception)
-{
- assert(image != (const Image *) NULL);
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
- assert(image->signature == MagickSignature);
- if (image->clip_mask == (Image *) NULL)
- return((Image *) NULL);
- return(CloneImage(image->clip_mask,0,0,MagickTrue,exception));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% G e t I m a g e I n f o %
% %
% %
*/
MagickExport Image *GetImageMask(const Image *image,ExceptionInfo *exception)
{
- assert(image != (const Image *) NULL);
+ CacheView
+ *mask_view,
+ *image_view;
+
+ Image
+ *mask_image;
+
+ MagickBooleanType
+ status;
+
+ ssize_t
+ y;
+
+ /*
+ Get image mask.
+ */
+ assert(image != (Image *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(image->signature == MagickSignature);
- if (image->mask == (Image *) NULL)
+ mask_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
+ if (mask_image == (Image *) NULL)
return((Image *) NULL);
- return(CloneImage(image->mask,0,0,MagickTrue,exception));
+ status=MagickTrue;
+ mask_image->colorspace=GRAYColorspace;
+ mask_image->masky=MagickFalse;
+ image_view=AcquireCacheView(image);
+ mask_view=AcquireCacheView(mask_image);
+ for (y=0; y < (ssize_t) image->rows; y++)
+ {
+ register const Quantum
+ *restrict p;
+
+ register Quantum
+ *restrict q;
+
+ register ssize_t
+ x;
+
+ if (status == MagickFalse)
+ continue;
+ p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
+ q=GetCacheViewAuthenticPixels(mask_view,0,y,mask_image->columns,1,
+ exception);
+ if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
+ {
+ status=MagickFalse;
+ continue;
+ }
+ for (x=0; x < (ssize_t) image->columns; x++)
+ {
+ SetPixelGray(mask_image,GetPixelMask(image,p),q);
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(mask_image);
+ }
+ if (SyncCacheViewAuthenticPixels(mask_view,exception) == MagickFalse)
+ status=MagickFalse;
+ }
+ mask_view=DestroyCacheView(mask_view);
+ image_view=DestroyCacheView(image_view);
+ return(mask_image);
}
\f
/*
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(separate_image);
+ continue;
+ }
SetPixelChannel(separate_image,GrayPixelChannel,0,q);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelTrait
traits;
-
+
channel=GetPixelChannelMapChannel(image,i);
traits=GetPixelChannelMapTraits(image,channel);
if ((traits == UndefinedPixelTrait) ||
% %
% %
% %
-% S e t I m a g e C l i p M a s k %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% SetImageClipMask() associates a clip path with the image. The clip path
-% must be the same dimensions as the image. Set any pixel component of
-% the clip path to TransparentAlpha to prevent that corresponding image
-% pixel component from being updated when SyncAuthenticPixels() is applied.
-%
-% The format of the SetImageClipMask method is:
-%
-% MagickBooleanType SetImageClipMask(Image *image,const Image *clip_mask,
-% ExceptionInfo *exception)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-% o clip_mask: the image clip mask, NULL undefines.
-%
-% o exception: return any errors or warnings in this structure.
-%
-*/
-MagickExport MagickBooleanType SetImageClipMask(Image *image,
- const Image *clip_mask,ExceptionInfo *exception)
-{
- assert(image != (Image *) NULL);
- if (image->debug != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
- assert(image->signature == MagickSignature);
- if (clip_mask != (const Image *) NULL)
- if ((clip_mask->columns != image->columns) ||
- (clip_mask->rows != image->rows))
- ThrowBinaryException(ImageError,"ImageSizeDiffers",image->filename);
- if (image->clip_mask != (Image *) NULL)
- image->clip_mask=DestroyImage(image->clip_mask);
- image->clip_mask=NewImageList();
- if (clip_mask == (Image *) NULL)
- return(MagickTrue);
- if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
- return(MagickFalse);
- image->clip_mask=CloneImage(clip_mask,0,0,MagickTrue,exception);
- if (image->clip_mask == (Image *) NULL)
- return(MagickFalse);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% S e t I m a g e E x t e n t %
% %
% %
% 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 Image *mask,
+ ExceptionInfo *exception)
{
+ CacheView
+ *mask_view,
+ *image_view;
+
+ MagickBooleanType
+ status;
+
+ ssize_t
+ y;
+
+ /*
+ Set image mask.
+ */
assert(image != (Image *) NULL);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(image->signature == MagickSignature);
- if (mask != (const Image *) NULL)
- if ((mask->columns != image->columns) || (mask->rows != image->rows))
- ThrowBinaryException(ImageError,"ImageSizeDiffers",image->filename);
- if (image->mask != (Image *) NULL)
- image->mask=DestroyImage(image->mask);
- image->mask=NewImageList();
- if (mask == (Image *) NULL)
- return(MagickTrue);
- if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
- return(MagickFalse);
- image->mask=CloneImage(mask,0,0,MagickTrue,exception);
- if (image->mask == (Image *) NULL)
- return(MagickFalse);
- return(MagickTrue);
+ if (mask == (const Image *) NULL)
+ {
+ image->masky=MagickFalse;
+ return(MagickTrue);
+ }
+ if ((mask->columns != image->columns) || (mask->rows != image->rows))
+ ThrowBinaryException(ImageError,"ImageSizeDiffers",image->filename);
+ status=MagickTrue;
+ image->masky=MagickTrue;
+ image_view=AcquireCacheView(image);
+ mask_view=AcquireCacheView(mask);
+ for (y=0; y < (ssize_t) image->rows; y++)
+ {
+ register const Quantum
+ *restrict p;
+
+ register Quantum
+ *restrict q;
+
+ register ssize_t
+ x;
+
+ if (status == MagickFalse)
+ continue;
+ p=GetCacheViewVirtualPixels(mask_view,0,y,mask->columns,1,exception);
+ q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
+ if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
+ {
+ status=MagickFalse;
+ continue;
+ }
+ for (x=0; x < (ssize_t) image->columns; x++)
+ {
+ SetPixelMask(image,GetPixelGray(mask,p),q);
+ p+=GetPixelChannels(mask);
+ q+=GetPixelChannels(image);
+ }
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ status=MagickFalse;
+ }
+ mask_view=DestroyCacheView(mask_view);
+ image_view=DestroyCacheView(image_view);
+ return(status);
}
\f
/*
DisposeType
dispose; /* GIF animation disposal method */
- struct _Image
- *clip_mask;
-
size_t
scene, /* index of image in multi-image file */
delay; /* Animation delay time */
MagickBooleanType
black_point_compensation;
- struct _Image
- *mask;
-
RectangleInfo
tile_offset;
MagickBooleanType
ping;
+ MagickBooleanType
+ masky;
+
size_t
number_channels,
number_meta_channels,
SetImageAlpha(Image *,const Quantum,ExceptionInfo *),
SetImageAlphaChannel(Image *,const AlphaChannelType,ExceptionInfo *),
SetImageBackgroundColor(Image *,ExceptionInfo *),
- SetImageClipMask(Image *,const Image *,ExceptionInfo *),
SetImageColor(Image *,const PixelInfo *,ExceptionInfo *),
SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *),
SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *),
/* #undef AUTOTRACE_DELEGATE */
/* Define if coders and filters are to be built as modules. */
-/* #undef BUILD_MODULES */
+#ifndef MAGICKCORE_BUILD_MODULES
+#define MAGICKCORE_BUILD_MODULES 1
+#endif
/* Define if you have the bzip2 library */
#ifndef MAGICKCORE_BZLIB_DELEGATE
#endif
/* Define if you have FlashPIX library */
-/* #undef FPX_DELEGATE */
+#ifndef MAGICKCORE_FPX_DELEGATE
+#define MAGICKCORE_FPX_DELEGATE 1
+#endif
/* Define if you have FreeType (TrueType font) library */
#ifndef MAGICKCORE_FREETYPE_DELEGATE
#endif
/* Define to 1 if you have the <CL/cl.h> header file. */
-/* #undef HAVE_CL_CL_H */
+#ifndef MAGICKCORE_HAVE_CL_CL_H
+#define MAGICKCORE_HAVE_CL_CL_H 1
+#endif
/* Define to 1 if you have the <complex.h> header file. */
#ifndef MAGICKCORE_HAVE_COMPLEX_H
#endif
/* Define if you have the <lcms2.h> header file. */
-#ifndef MAGICKCORE_HAVE_LCMS2_H
-#define MAGICKCORE_HAVE_LCMS2_H 1
-#endif
+/* #undef HAVE_LCMS2_H */
/* Define if you have the <lcms2/lcms2.h> header file. */
/* #undef HAVE_LCMS2_LCMS2_H */
/* Define if you have the <lcms.h> header file. */
-/* #undef HAVE_LCMS_H */
+#ifndef MAGICKCORE_HAVE_LCMS_H
+#define MAGICKCORE_HAVE_LCMS_H 1
+#endif
/* Define if you have the <lcms/lcms.h> header file. */
/* #undef HAVE_LCMS_LCMS_H */
#endif
/* Define if you have JBIG library */
-/* #undef JBIG_DELEGATE */
+#ifndef MAGICKCORE_JBIG_DELEGATE
+#define MAGICKCORE_JBIG_DELEGATE 1
+#endif
/* Define if you have JPEG version 2 "Jasper" library */
#ifndef MAGICKCORE_JP2_DELEGATE
#endif
/* Define if you have LQR library */
-/* #undef LQR_DELEGATE */
+#ifndef MAGICKCORE_LQR_DELEGATE
+#define MAGICKCORE_LQR_DELEGATE 1
+#endif
/* Define if using libltdl to support dynamically loadable modules */
#ifndef MAGICKCORE_LTDL_DELEGATE
/* Define to the system default library search path. */
#ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib64/tracker-0.12:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/usr/lib64/freetype-freeworld:/opt/modules/pkg/intel/f77/10.0.025/lib:/opt/intel/lib/intel64:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tracker-0.12:/usr/lib64/xulrunner-2"
#endif
/* The archive extension */
/* #undef NO_MINUS_C_MINUS_O */
/* Define if you have OPENEXR library */
-/* #undef OPENEXR_DELEGATE */
+#ifndef MAGICKCORE_OPENEXR_DELEGATE
+#define MAGICKCORE_OPENEXR_DELEGATE 1
+#endif
/* Name of package */
#ifndef MAGICKCORE_PACKAGE
#endif
/* Define if you have WEBP library */
-/* #undef WEBP_DELEGATE */
+#ifndef MAGICKCORE_WEBP_DELEGATE
+#define MAGICKCORE_WEBP_DELEGATE 1
+#endif
/* Define to use the Windows GDI32 library */
/* #undef WINGDI32_DELEGATE */
/* #undef _MINIX */
/* Define this for the OpenCL Accelerator */
-/* #undef _OPENCL */
+#ifndef MAGICKCORE__OPENCL
+#define MAGICKCORE__OPENCL 1
+#endif
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
}
k+=(ssize_t) (image->columns+width);
}
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(paint_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
return(image->channel_map[MagentaPixelChannel].traits);
}
+static inline Quantum GetPixelMask(const Image *restrict image,
+ const Quantum *restrict pixel)
+{
+ if (image->channel_map[MaskPixelChannel].traits == UndefinedPixelTrait)
+ return(0);
+ return(pixel[image->channel_map[MaskPixelChannel].offset]);
+}
+
+static inline PixelTrait GetPixelMaskTraits(const Image *restrict image)
+{
+ return(image->channel_map[MaskPixelChannel].traits);
+}
+
static inline size_t GetPixelMetaChannels(const Image *restrict image)
{
return(image->number_meta_channels);
image->channel_map[MagentaPixelChannel].traits=traits;
}
+static inline void SetPixelMask(const Image *restrict image,
+ const Quantum mask,Quantum *restrict pixel)
+{
+ if (image->channel_map[MaskPixelChannel].traits != UndefinedPixelTrait)
+ pixel[image->channel_map[MaskPixelChannel].offset]=mask;
+}
+
static inline void SetPixelMetaChannels(Image *image,
const size_t number_meta_channels)
{
SetPixelChannelMap(image,AlphaPixelChannel,CopyPixelTrait,n++);
if (image->storage_class == PseudoClass)
SetPixelChannelMap(image,IndexPixelChannel,CopyPixelTrait,n++);
+ if (image->masky != MagickFalse)
+ SetPixelChannelMap(image,MaskPixelChannel,CopyPixelTrait,n++);
assert((n+image->number_meta_channels) < MaxPixelChannels);
for (i=0; i < (ssize_t) image->number_meta_channels; i++)
SetPixelChannelMap(image,(PixelChannel) (MetaPixelChannel+i),CopyPixelTrait,
}
if (image->storage_class == PseudoClass)
SetPixelChannelMapTraits(image,IndexPixelChannel,CopyPixelTrait);
+ if (image->masky != MagickFalse)
+ SetPixelChannelMapTraits(image,MaskPixelChannel,CopyPixelTrait);
if (image->debug != MagickFalse)
LogPixelChannels(image);
}
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
Sa=QuantumScale*GetPixelAlpha(image,q);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
Sa=QuantumScale*GetPixelAlpha(image,q);
gamma=1.0/(fabs(Sa) <= MagickEpsilon ? 1.0 : Sa);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ if (GetPixelMask(resize_image,q) != 0)
+ {
+ q+=GetPixelChannels(resize_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
PixelChannel
channel;
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ if (GetPixelMask(resize_image,q) != 0)
+ {
+ q+=GetPixelChannels(resize_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
MagickRealType
alpha,
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ if (GetPixelMask(resize_image,q) != 0)
+ {
+ q+=GetPixelChannels(resize_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(resize_image); i++)
{
MagickRealType
alpha,
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ if (GetPixelMask(sample_image,q) != 0)
+ {
+ q+=GetPixelChannels(sample_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(sample_image); i++)
{
PixelChannel
channel;
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
*/
for (x=0; x < (ssize_t) scale_image->columns; x++)
{
+ if (GetPixelMask(scale_image,q) != 0)
+ {
+ q+=GetPixelChannels(scale_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(scale_image); i++)
{
ssize_t
*/
for (x=0; x < (ssize_t) scale_image->columns; x++)
{
+ if (GetPixelMask(scale_image,q) != 0)
+ {
+ q+=GetPixelChannels(scale_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(scale_image); i++)
{
channel=GetPixelChannelMapChannel(scale_image,i);
register ssize_t
i;
+ if (GetPixelMask(image,tile_pixels) != 0)
+ {
+ tile_pixels-=width*GetPixelChannels(image);
+ q+=GetPixelChannels(rotate_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
i;
q-=GetPixelChannels(rotate_image);
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,tile_pixels) != 0)
+ {
+ tile_pixels+=width*GetPixelChannels(image);
+ q+=GetPixelChannels(rotate_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(evaluate_image); i++)
+ if (GetPixelMask(evaluate_image,p) != 0)
+ {
+ p+=GetPixelChannels(evaluate_image);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(next); i++)
{
PixelChannel
channel;
register ssize_t
i;
+ if (GetPixelMask(evaluate_image,q) != 0)
+ {
+ q+=GetPixelChannels(evaluate_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(evaluate_image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(statistic_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(threshold_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
n;
n=0;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
n;
n=0;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
MagickRealType
n;
n=0;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ q+=GetPixelChannels(chop_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(chop_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
continue;
SetPixelChannel(chop_image,channel,p[i],q);
}
+ p+=GetPixelChannels(chop_image);
q+=GetPixelChannels(chop_image);
}
p+=GetPixelChannels(image);
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(crop_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(excerpt_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(flip_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
i;
q-=GetPixelChannels(flop_image);
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(source,p) != 0)
+ {
+ p+=GetPixelChannels(source);
+ q+=GetPixelChannels(destination);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(source); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(splice_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(splice_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(splice_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(splice_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(transpose_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
i;
q-=GetPixelChannels(transverse_image);
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2012 ImageMagick Studio LLC"
-#define MagickSVNRevision "6592"
+#define MagickSVNRevision "exported"
#define MagickLibVersion 0x700
#define MagickLibVersionText "7.0.0"
#define MagickLibVersionNumber 7,0,0
#define MagickLibAddendum "-0"
#define MagickLibInterface 7
#define MagickLibMinInterface 7
-#define MagickReleaseDate "2012-01-25"
+#define MagickReleaseDate "2012-01-29"
#define MagickChangeDate "20110801"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#if defined(MAGICKCORE_OPENMP_SUPPORT)
/*
Set a blending mask for the composition.
*/
- images->mask=mask_image;
- (void) NegateImage(images->mask,MagickFalse,exception);
+ (void) NegateImage(mask_image,MagickFalse,exception);
+ (void) SetImageMask(image,mask_image,exception);
}
}
status&=CompositeImageList(image_info,&images,composite_image,
if (CurrentContext->clip_mask != (char *) NULL)
if (LocaleCompare(CurrentContext->clip_mask,
wand->graphic_context[wand->index-1]->clip_mask) != 0)
- (void) SetImageClipMask(wand->image,(Image *) NULL);
+ (void) SetImageMask(wand->image,(Image *) NULL);
#endif
CurrentContext=DestroyDrawInfo(CurrentContext);
wand->index--;
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% MagickGetImageClipMask() gets the image clip mask at the current image index.
+% MagickGetImageMask() gets the image clip mask at the current image index.
%
-% The format of the MagickGetImageClipMask method is:
+% The format of the MagickGetImageMask method is:
%
-% MagickWand *MagickGetImageClipMask(MagickWand *wand)
+% MagickWand *MagickGetImageMask(MagickWand *wand)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
*/
-WandExport MagickWand *MagickGetImageClipMask(MagickWand *wand)
+WandExport MagickWand *MagickGetImageMask(MagickWand *wand)
{
Image
*image;
"ContainsNoImages","`%s'",wand->name);
return((MagickWand *) NULL);
}
- image=GetImageClipMask(wand->images,wand->exception);
+ image=GetImageMask(wand->images,wand->exception);
if (image == (Image *) NULL)
return((MagickWand *) NULL);
return(CloneMagickWandFromImages(wand,image));
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% MagickSetImageClipMask() sets image clip mask.
+% MagickSetImageMask() sets image clip mask.
%
-% The format of the MagickSetImageClipMask method is:
+% The format of the MagickSetImageMask method is:
%
-% MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
+% MagickBooleanType MagickSetImageMask(MagickWand *wand,
% const MagickWand *clip_mask)
%
% A description of each parameter follows:
% o clip_mask: the clip_mask wand.
%
*/
-WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
+WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand,
const MagickWand *clip_mask)
{
assert(wand != (MagickWand *) NULL);
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name);
if (clip_mask->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",clip_mask->name);
- return(SetImageClipMask(wand->images,clip_mask->images,wand->exception));
+ return(SetImageMask(wand->images,clip_mask->images,wand->exception));
}
\f
/*
(void) SyncImageSettings(mogrify_info,*image,exception);
if (*option == '+')
{
- (void) SetImageClipMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,(Image *) NULL,exception);
break;
}
(void) ClipImage(*image,exception);
}
mask_view=DestroyCacheView(mask_view);
mask_image->matte=MagickTrue;
- (void) SetImageClipMask(*image,mask_image,exception);
+ (void) SetImageMask(*image,mask_image,exception);
break;
}
if (LocaleCompare("clip-path",option+1) == 0)
Set a blending mask for the composition.
Possible problem, what if image->mask already set.
*/
- image->mask=mask_image;
- (void) NegateImage(image->mask,MagickFalse,exception);
+ (void) NegateImage(mask_image,MagickFalse,exception);
+ (void) SetImageMask(image,mask_image,exception);
+ mask_image=DestroyImage(mask_image);
}
}
(void) CompositeImage(image,image->compose,composite_image,
geometry.x,geometry.y,exception);
- if (mask_image != (Image *) NULL)
- {
- image->mask=DestroyImage(image->mask);
- mask_image=(Image *) NULL;
- }
+ (void) SetImageMask(image,(Image *) NULL,exception);
composite_image=DestroyImage(composite_image);
*images=DestroyImageList(*images);
*images=image;
if (plus_alt_op == MagickFalse)
(void) ClipImage(*image,exception);
else /* "+clip" remove the write mask */
- (void) SetImageClipMask(*image,(Image *) NULL,exception);
+ (void) SetImageMask(*image,(Image *) NULL,exception);
break;
}
if (LocaleCompare("clip-mask",option) == 0)
/* clean up and set the write mask */
mask_view=DestroyCacheView(mask_view);
mask_image->matte=MagickTrue;
- (void) SetImageClipMask(*image,mask_image,exception);
+ (void) SetImageMask(*image,mask_image,exception);
mask_image=DestroyImage(mask_image);
break;
}
if (SvPOK(sval))
clip_mask=SetupList(aTHX_ SvRV(sval),&info,(SV ***) NULL,exception);
for ( ; image; image=image->next)
- SetImageClipMask(image,clip_mask,exception);
+ SetImageMask(image,clip_mask,exception);
break;
}
if (LocaleNCompare(attribute,"colormap",8) == 0)
{
if (image != (Image *) NULL)
{
+ Image
+ *mask_image;
+
SV
*sv;
sv=NULL;
- if (image->mask == (Image *) NULL)
+ if (image->masky == MagickFalse)
ClipImage(image,exception);
- if (image->mask != (Image *) NULL)
+ mask_image=GetImageMask(image,exception);
+ if (mask_image != (Image *) NULL)
{
- AddImageToRegistry(sv,image->mask);
+ AddImageToRegistry(sv,mask_image);
s=sv_bless(newRV(sv),SvSTASH(reference));
}
}
{
if (image != (Image *) NULL)
{
+ Image
+ *mask_image;
+
SV
*sv;
sv=NULL;
- if (image->clip_mask == (Image *) NULL)
+ if (image->masky != MagickFalse)
ClipImage(image,exception);
- if (image->clip_mask != (Image *) NULL)
+ mask_image=GetImageMask(image,exception);
+ if (mask_image != (Image *) NULL)
{
- AddImageToRegistry(sv,image->clip_mask);
+ AddImageToRegistry(sv,mask_image);
s=sv_bless(newRV(sv),SvSTASH(reference));
}
}
}
else
{
+ Image
+ *mask_image;
+
/*
Set a blending mask for the composition.
*/
- image->mask=CloneImage(argument_list[10].image_reference,0,0,
+ mask_image=CloneImage(argument_list[10].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->mask,MagickFalse,exception);
+ (void) NegateImage(mask_image,MagickFalse,exception);
+ (void) SetImageMask(image,mask_image,exception);
+ mask_image=DestroyImage(mask_image);
}
}
if (attribute_flag[11] != 0) /* channel */
(image->compose == DistortCompositeOp))
composite_image=DestroyImage(composite_image);
else
- image->mask=DestroyImage(image->mask);
+ (void) SetImageMask(image,(Image *) NULL,exception);
}
(void) SetPixelChannelMask(image,channel_mask);
break;
}
case 106: /* ClipMask */
{
+ Image
+ *mask_image;
+
if (attribute_flag[0] == 0)
{
ThrowPerlException(exception,OptionError,"MaskImageRequired",
PackageName);
goto PerlException;
}
- image->clip_mask=CloneImage(argument_list[0].image_reference,0,0,
- MagickTrue,exception);
- (void) NegateImage(image->clip_mask,MagickFalse,exception);
+ mask_image=CloneImage(argument_list[0].image_reference,0,0,MagickTrue,
+ exception);
+ (void) NegateImage(mask_image,MagickFalse,exception);
+ (void) SetImageMask(image,mask_image,exception);
+ mask_image=DestroyImage(mask_image);
break;
}
case 107: /* LinearStretch */
}
case 109: /* Mask */
{
+ Image
+ *mask_image;
+
if (attribute_flag[0] == 0)
{
ThrowPerlException(exception,OptionError,"MaskImageRequired",
PackageName);
goto PerlException;
}
- image->mask=CloneImage(argument_list[0].image_reference,0,0,
+ mask_image=CloneImage(argument_list[0].image_reference,0,0,
MagickTrue,exception);
- (void) NegateImage(image->mask,MagickFalse,exception);
+ (void) NegateImage(mask_image,MagickFalse,exception);
+ (void) SetImageMask(image,mask_image,exception);
+ mask_image=DestroyImage(mask_image);
break;
}
case 110: /* Polaroid */
MagickBooleanType
status;
- if (image->clip_mask == (Image *) NULL)
+ if (image->masky == MagickFalse)
(void) ClipImage(image,exception);
- if (image->clip_mask == (Image *) NULL)
+ if (image->masky == MagickFalse)
ThrowWriterException(CoderError,"ImageDoesNotHaveAClipMask");
- clip_image=CloneImage(image->clip_mask,0,0,MagickTrue,exception);
+ clip_image=GetImageMask(image,exception);
if (clip_image == (Image *) NULL)
return(MagickFalse);
- (void) SetImageType(clip_image,TrueColorType,exception);
(void) CopyMagickString(clip_image->filename,image->filename,MaxTextExtent);
write_info=CloneImageInfo(image_info);
(void) SetImageInfo(write_info,1,exception);
&exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageClipMask(msl_info->image[n],msl_info->image[j],
+ SetImageMask(msl_info->image[n],msl_info->image[j],
&exception);
break;
}
/*
PS clipping path from Photoshop clipping path.
*/
- if ((image->clip_mask == (Image *) NULL) ||
- (LocaleNCompare("8BIM:",image->clip_mask->magick_filename,5) != 0))
+ if ((image->masky != MagickFalse) ||
+ (LocaleNCompare("8BIM:",image->magick_filename,5) != 0))
(void) WriteBlobString(image,"/ClipImage {} def\n");
else
{
const char
*value;
- value=GetImageProperty(image,image->clip_mask->magick_filename,
- exception);
+ value=GetImageProperty(image,image->magick_filename,exception);
if (value == (const char *) NULL)
return(MagickFalse);
(void) WriteBlobString(image,value);
/*
Photoshop clipping path active?
*/
- if ((image->clip_mask != (Image *) NULL) &&
- (LocaleNCompare("8BIM:",image->clip_mask->magick_filename,5) == 0))
+ if ((image->masky != MagickFalse) &&
+ (LocaleNCompare("8BIM:",image->magick_filename,5) == 0))
(void) WriteBlobString(image,"true\n");
else
(void) WriteBlobString(image,"false\n");