if (transparent_fill == MagickFalse)
{
GetPixelInfo(image,&fill_color);
- GetFillColor(draw_info,x_offset,y_offset,&fill_color,
- exception);
+ GetFillColor(draw_info,x_offset,y_offset,&fill_color,exception);
fill_opacity=fill_opacity*fill_color.alpha;
CompositePixelOver(image,&fill_color,fill_opacity,q,
GetPixelAlpha(image,q),q);
graphic_context[n]->fill.alpha=graphic_context[n]->fill_alpha;
else
graphic_context[n]->fill.alpha=(MagickRealType)
- ClampToQuantum(QuantumRange*opacity);
+ ClampToQuantum(QuantumRange*(1.0-opacity));
break;
}
if (LocaleCompare("fill-rule",keyword) == 0)
graphic_context[n]->stroke.alpha=graphic_context[n]->stroke_alpha;
else
graphic_context[n]->stroke.alpha=(MagickRealType)
- ClampToQuantum(QuantumRange*opacity);
+ ClampToQuantum(QuantumRange*(1.0-opacity));
break;
}
if (LocaleCompare("stroke-width",keyword) == 0)
ExceptionInfo *exception)
{
#define SegmentImageTag "Segment/Image"
+#define ThrowClassifyException(severity,tag,label) \
+{\
+ for (cluster=head; cluster != (Cluster *) NULL; cluster=next_cluster) \
+ { \
+ next_cluster=cluster->next; \
+ cluster=(Cluster *) RelinquishMagickMemory(cluster); \
+ } \
+ if (squares != (double *) NULL) \
+ { \
+ squares-=255; \
+ free_squares=squares; \
+ free_squares=(double *) RelinquishMagickMemory(free_squares); \
+ } \
+ ThrowBinaryException(severity,tag,label); \
+}
CacheView
*image_view;
*/
cluster=(Cluster *) NULL;
head=(Cluster *) NULL;
+ squares=(double *) NULL;
(void) memset(&red,0,sizeof(red));
(void) memset(&green,0,sizeof(green));
(void) memset(&blue,0,sizeof(blue));
head=cluster;
}
if (cluster == (Cluster *) NULL)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
/*
Initialize a new class.
*/
cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster));
if (cluster == (Cluster *) NULL)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
/*
Initialize a new class.
(void) FormatLocaleFile(stdout,"\n");
}
if (number_clusters > 256)
- ThrowBinaryException(ImageError,"TooManyClusters",image->filename);
+ ThrowClassifyException(ImageError,"TooManyClusters",image->filename);
/*
Speed up distance calculations.
*/
squares=(double *) AcquireQuantumMemory(513UL,sizeof(*squares));
if (squares == (double *) NULL)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
squares+=255;
for (i=(-255); i <= 255; i++)
Allocate image colormap.
*/
if (AcquireImageColormap(image,number_clusters,exception) == MagickFalse)
- ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ ThrowClassifyException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
i=0;
for (cluster=head; cluster != (Cluster *) NULL; cluster=cluster->next)