+current.tx;
}
- AnnotateImage( image(), drawInfo );
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
+ AnnotateImage( image(), drawInfo, &exceptionInfo );
// Restore original values
drawInfo->affine = oaffine;
drawInfo->text = 0;
drawInfo->geometry = 0;
- throwImageException();
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Annotate with text (bounding area is entire image) and placement gravity.
void Magick::Image::annotate ( const std::string &text_,
drawInfo->gravity = gravity_;
- AnnotateImage( image(), drawInfo );
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
+ AnnotateImage( image(), drawInfo, &exceptionInfo );
drawInfo->gravity = NorthWestGravity;
drawInfo->text = 0;
- throwImageException();
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Blur image
// film to light during the development process)
void Magick::Image::solarize ( const double factor_ )
{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
modifyImage();
- SolarizeImage ( image(), factor_ );
- throwImageException();
+ SolarizeImage ( image(), factor_, &exceptionInfo );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Sparse color image, given a set of coordinates, interpolates the colors
{
DrawInfo *drawInfo = options()->drawInfo();
drawInfo->text = const_cast<char *>(text_.c_str());
- GetTypeMetrics( image(), drawInfo, &(metrics->_typeMetric) );
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
+ GetTypeMetrics( image(), drawInfo, &(metrics->_typeMetric), &exceptionInfo );
drawInfo->text = 0;
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
}
// Image format string
Forward declarations.
*/
static MagickBooleanType
- RenderType(Image *,const DrawInfo *,const PointInfo *,TypeMetric *),
- RenderPostscript(Image *,const DrawInfo *,const PointInfo *,TypeMetric *),
+ RenderType(Image *,const DrawInfo *,const PointInfo *,TypeMetric *,
+ ExceptionInfo *),
+ RenderPostscript(Image *,const DrawInfo *,const PointInfo *,TypeMetric *,
+ ExceptionInfo *),
RenderFreetype(Image *,const DrawInfo *,const char *,const PointInfo *,
- TypeMetric *),
- RenderX11(Image *,const DrawInfo *,const PointInfo *,TypeMetric *);
+ TypeMetric *,ExceptionInfo *),
+ RenderX11(Image *,const DrawInfo *,const PointInfo *,TypeMetric *,
+ ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The format of the AnnotateImage method is:
%
-% MagickBooleanType AnnotateImage(Image *image,DrawInfo *draw_info)
+% MagickBooleanType AnnotateImage(Image *image,DrawInfo *draw_info,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o draw_info: the draw info.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType AnnotateImage(Image *image,
- const DrawInfo *draw_info)
+ const DrawInfo *draw_info,ExceptionInfo *exception)
{
char
primitive[MaxTextExtent],
if (annotate_info->geometry != (char *) NULL)
{
(void) ParsePageGeometry(image,annotate_info->geometry,&geometry,
- &image->exception);
+ exception);
(void) ParseGeometry(annotate_info->geometry,&geometry_info);
}
- if (SetImageStorageClass(image,DirectClass,&image->exception) == MagickFalse)
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
for (i=0; textlist[i] != (char *) NULL; i++)
annotate_info->affine.tx=geometry_info.xi-image->page.x;
annotate_info->affine.ty=geometry_info.psi-image->page.y;
(void) CloneString(&annotate->text,textlist[i]);
- (void) GetTypeMetrics(image,annotate,&metrics);
+ (void) GetTypeMetrics(image,annotate,&metrics,exception);
height=(ssize_t) (metrics.ascent-metrics.descent+
draw_info->interline_spacing+0.5);
switch (annotate->gravity)
/*
Annotate image with text.
*/
- status=RenderType(image,annotate,&offset,&metrics);
+ status=RenderType(image,annotate,&offset,&metrics,exception);
if (status == MagickFalse)
break;
if (annotate->decorate == LineThroughDecoration)
% The format of the FormatMagickCaption method is:
%
% ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info,
-% const MagickBooleanType split,TypeMetric *metrics,char **caption)
+% const MagickBooleanType split,TypeMetric *metrics,char **caption,
+% ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o caption: the caption.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info,
- const MagickBooleanType split,TypeMetric *metrics,char **caption)
+ const MagickBooleanType split,TypeMetric *metrics,char **caption,
+ ExceptionInfo *exception)
{
MagickBooleanType
status;
for (i=0; i < (ssize_t) GetUTFOctets(p); i++)
*q++=(*(p+i));
*q='\0';
- status=GetTypeMetrics(image,draw_info,metrics);
+ status=GetTypeMetrics(image,draw_info,metrics,exception);
if (status == MagickFalse)
break;
width=(size_t) floor(metrics->width+0.5);
% The format of the GetMultilineTypeMetrics method is:
%
% MagickBooleanType GetMultilineTypeMetrics(Image *image,
-% const DrawInfo *draw_info,TypeMetric *metrics)
+% const DrawInfo *draw_info,TypeMetric *metrics,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: Return the font metrics in this structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType GetMultilineTypeMetrics(Image *image,
- const DrawInfo *draw_info,TypeMetric *metrics)
+ const DrawInfo *draw_info,TypeMetric *metrics,ExceptionInfo *exception)
{
char
**textlist;
Find the widest of the text lines.
*/
annotate_info->text=textlist[0];
- status=GetTypeMetrics(image,annotate_info,&extent);
+ status=GetTypeMetrics(image,annotate_info,&extent,exception);
*metrics=extent;
for (i=1; textlist[i] != (char *) NULL; i++)
{
annotate_info->text=textlist[i];
- status=GetTypeMetrics(image,annotate_info,&extent);
+ status=GetTypeMetrics(image,annotate_info,&extent,exception);
if (extent.width > metrics->width)
*metrics=extent;
}
% The format of the GetTypeMetrics method is:
%
% MagickBooleanType GetTypeMetrics(Image *image,const DrawInfo *draw_info,
-% TypeMetric *metrics)
+% TypeMetric *metrics,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: Return the font metrics in this structure.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType GetTypeMetrics(Image *image,
- const DrawInfo *draw_info,TypeMetric *metrics)
+ const DrawInfo *draw_info,TypeMetric *metrics,ExceptionInfo *exception)
{
DrawInfo
*annotate_info;
(void) ResetMagickMemory(metrics,0,sizeof(*metrics));
offset.x=0.0;
offset.y=0.0;
- status=RenderType(image,annotate_info,&offset,metrics);
+ status=RenderType(image,annotate_info,&offset,metrics,exception);
if (image->debug != MagickFalse)
(void) LogMagickEvent(AnnotateEvent,GetMagickModule(),"Metrics: text: %s; "
"width: %g; height: %g; ascent: %g; descent: %g; max advance: %g; "
% The format of the RenderType method is:
%
% MagickBooleanType RenderType(Image *image,DrawInfo *draw_info,
-% const PointInfo *offset,TypeMetric *metrics)
+% const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: bounding box of text.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static MagickBooleanType RenderType(Image *image,const DrawInfo *draw_info,
- const PointInfo *offset,TypeMetric *metrics)
+ const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
{
const TypeInfo
*type_info;
if (*draw_info->font == '@')
{
status=RenderFreetype(image,draw_info,draw_info->encoding,offset,
- metrics);
+ metrics,exception);
return(status);
}
if (*draw_info->font == '-')
- return(RenderX11(image,draw_info,offset,metrics));
+ return(RenderX11(image,draw_info,offset,metrics,exception));
if (IsPathAccessible(draw_info->font) != MagickFalse)
{
status=RenderFreetype(image,draw_info,draw_info->encoding,offset,
- metrics);
+ metrics,exception);
return(status);
}
- type_info=GetTypeInfo(draw_info->font,&image->exception);
+ type_info=GetTypeInfo(draw_info->font,exception);
if (type_info == (const TypeInfo *) NULL)
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- TypeWarning,"UnableToReadFont","`%s'",draw_info->font);
+ (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
+ "UnableToReadFont","`%s'",draw_info->font);
}
if ((type_info == (const TypeInfo *) NULL) &&
(draw_info->family != (const char *) NULL))
{
type_info=GetTypeInfoByFamily(draw_info->family,draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- TypeWarning,"UnableToReadFont","`%s'",draw_info->family);
+ (void) ThrowMagickException(exception,GetMagickModule(),TypeWarning,
+ "UnableToReadFont","`%s'",draw_info->family);
}
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily("Arial",draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily("Helvetica",draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily("Century Schoolbook",draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily("Sans",draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
type_info=GetTypeInfoByFamily((const char *) NULL,draw_info->style,
- draw_info->stretch,draw_info->weight,&image->exception);
+ draw_info->stretch,draw_info->weight,exception);
if (type_info == (const TypeInfo *) NULL)
- type_info=GetTypeInfo("*",&image->exception);
+ type_info=GetTypeInfo("*",exception);
if (type_info == (const TypeInfo *) NULL)
{
- status=RenderFreetype(image,draw_info,draw_info->encoding,offset,metrics);
+ status=RenderFreetype(image,draw_info,draw_info->encoding,offset,metrics,
+ exception);
return(status);
}
annotate_info=CloneDrawInfo((ImageInfo *) NULL,draw_info);
(void) CloneString(&annotate_info->metrics,type_info->metrics);
if (type_info->glyphs != (char *) NULL)
(void) CloneString(&annotate_info->font,type_info->glyphs);
- status=RenderFreetype(image,annotate_info,type_info->encoding,offset,metrics);
+ status=RenderFreetype(image,annotate_info,type_info->encoding,offset,metrics,
+ exception);
annotate_info=DestroyDrawInfo(annotate_info);
return(status);
}
% The format of the RenderFreetype method is:
%
% MagickBooleanType RenderFreetype(Image *image,DrawInfo *draw_info,
-% const char *encoding,const PointInfo *offset,TypeMetric *metrics)
+% const char *encoding,const PointInfo *offset,TypeMetric *metrics,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: bounding box of text.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
#if defined(MAGICKCORE_FREETYPE_DELEGATE)
}
static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
- const char *encoding,const PointInfo *offset,TypeMetric *metrics)
+ const char *encoding,const PointInfo *offset,TypeMetric *metrics,
+ ExceptionInfo *exception)
{
#if !defined(FT_OPEN_PATHNAME)
#define FT_OPEN_PATHNAME ft_open_pathname
if (status != 0)
{
(void) FT_Done_FreeType(library);
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
- TypeError,"UnableToReadFont","`%s'",draw_info->font);
- return(RenderPostscript(image,draw_info,offset,metrics));
+ (void) ThrowMagickException(exception,GetMagickModule(),TypeError,
+ "UnableToReadFont","`%s'",draw_info->font);
+ return(RenderPostscript(image,draw_info,offset,metrics,exception));
}
if ((draw_info->metrics != (char *) NULL) &&
(IsPathAccessible(draw_info->metrics) != MagickFalse))
if (draw_info->render != MagickFalse)
{
if (image->storage_class != DirectClass)
- (void) SetImageStorageClass(image,DirectClass,&image->exception);
+ (void) SetImageStorageClass(image,DirectClass,exception);
if (image->matte == MagickFalse)
- (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,&image->exception);
+ (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
}
direction=1.0;
if (draw_info->direction == RightToLeftDirection)
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
Rasterize the glyph.
*/
status=MagickTrue;
- exception=(&image->exception);
image_view=AcquireCacheView(image);
for (y=0; y < (ssize_t) bitmap->bitmap.rows; y++)
{
#else
static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info,
const char *magick_unused(encoding),const PointInfo *offset,
- TypeMetric *metrics)
+ TypeMetric *metrics,ExceptionInfo *exception)
{
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateWarning,"DelegateLibrarySupportNotBuiltIn","`%s' (Freetype)",
draw_info->font != (char *) NULL ? draw_info->font : "none");
return(RenderPostscript(image,draw_info,offset,metrics));
% The format of the RenderPostscript method is:
%
% MagickBooleanType RenderPostscript(Image *image,DrawInfo *draw_info,
-% const PointInfo *offset,TypeMetric *metrics)
+% const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: bounding box of text.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static inline size_t MagickMin(const size_t x,const size_t y)
}
static MagickBooleanType RenderPostscript(Image *image,
- const DrawInfo *draw_info,const PointInfo *offset,TypeMetric *metrics)
+ const DrawInfo *draw_info,const PointInfo *offset,TypeMetric *metrics,
+ ExceptionInfo *exception)
{
char
filename[MaxTextExtent],
file=fdopen(unique_file,"wb");
if ((unique_file == -1) || (file == (FILE *) NULL))
{
- ThrowFileException(&image->exception,FileOpenError,"UnableToOpenFile",
- filename);
+ ThrowFileException(exception,FileOpenError,"UnableToOpenFile",filename);
return(MagickFalse);
}
(void) FormatLocaleFile(file,"%%!PS-Adobe-3.0\n");
if (draw_info->density != (char *) NULL)
(void) CloneString(&annotate_info->density,draw_info->density);
annotate_info->antialias=draw_info->text_antialias;
- annotate_image=ReadImage(annotate_info,&image->exception);
- CatchException(&image->exception);
+ annotate_image=ReadImage(annotate_info,exception);
+ CatchException(exception);
annotate_info=DestroyImageInfo(annotate_info);
(void) RelinquishUniqueFileResource(filename);
if (annotate_image == (Image *) NULL)
RectangleInfo
crop_info;
- crop_info=GetImageBoundingBox(annotate_image,&annotate_image->exception);
+ crop_info=GetImageBoundingBox(annotate_image,exception);
crop_info.height=(size_t) ((resolution.y/DefaultResolution)*
ExpandAffine(&draw_info->affine)*draw_info->pointsize+0.5);
crop_info.y=(ssize_t) ceil((resolution.y/DefaultResolution)*extent.y/8.0-
}
if (draw_info->fill.alpha != TransparentAlpha)
{
- ExceptionInfo
- *exception;
-
MagickBooleanType
sync;
/*
Render fill color.
*/
- exception=(&image->exception);
if (image->matte == MagickFalse)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
if (annotate_image->matte == MagickFalse)
% The format of the RenderX11 method is:
%
% MagickBooleanType RenderX11(Image *image,DrawInfo *draw_info,
-% const PointInfo *offset,TypeMetric *metrics)
+% const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o metrics: bounding box of text.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
#if defined(MAGICKCORE_X11_DELEGATE)
static MagickBooleanType RenderX11(Image *image,const DrawInfo *draw_info,
- const PointInfo *offset,TypeMetric *metrics)
+ const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
{
MagickBooleanType
status;
}
#else
static MagickBooleanType RenderX11(Image *image,const DrawInfo *draw_info,
- const PointInfo *offset,TypeMetric *metrics)
+ const PointInfo *offset,TypeMetric *metrics,ExceptionInfo *exception)
{
(void) draw_info;
(void) offset;
(void) metrics;
- (void) ThrowMagickException(&image->exception,GetMagickModule(),
+ (void) ThrowMagickException(exception,GetMagickModule(),
MissingDelegateError,"DelegateLibrarySupportNotBuiltIn","`%s' (X11)",
image->filename);
return(MagickFalse);
extern MagickExport MagickBooleanType
AnnotateComponentGenesis(void),
- AnnotateImage(Image *,const DrawInfo *),
- GetMultilineTypeMetrics(Image *,const DrawInfo *,TypeMetric *),
- GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *);
+ AnnotateImage(Image *,const DrawInfo *,ExceptionInfo *),
+ GetMultilineTypeMetrics(Image *,const DrawInfo *,TypeMetric *,
+ ExceptionInfo *),
+ GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *,ExceptionInfo *);
extern MagickExport ssize_t
FormatMagickCaption(Image *,DrawInfo *,const MagickBooleanType,TypeMetric *,
- char **);
+ char **,ExceptionInfo *);
extern MagickExport void
AnnotateComponentTerminus(void);
XSetCursorState(display,windows,MagickTrue);
XCheckRefreshWindows(display,windows);
threshold=SiPrefixToDouble(factor,QuantumRange);
- (void) SolarizeImage(*image,threshold);
+ (void) SolarizeImage(*image,threshold,exception);
XSetCursorState(display,windows,MagickFalse);
if (windows->image.orphan != MagickFalse)
break;
(void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f",
primitive_info->point.x,primitive_info->point.y);
(void) CloneString(&clone_info->geometry,geometry);
- status=AnnotateImage(image,clone_info);
+ status=AnnotateImage(image,clone_info,exception);
clone_info=DestroyDrawInfo(clone_info);
break;
}
if (preview_image == (Image *) NULL)
break;
(void) SolarizeImage(preview_image,(double) QuantumRange*
- percentage/100.0);
+ percentage/100.0,exception);
(void) FormatLocaleString(label,MaxTextExtent,"solarize %g",
(QuantumRange*percentage)/100.0);
break;
% The format of the PlasmaImage method is:
%
% MagickBooleanType PlasmaImage(Image *image,const SegmentInfo *segment,
-% size_t attenuate,size_t depth)
+% size_t attenuate,size_t depth,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o depth: Limit the plasma recursion depth.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
static inline Quantum PlasmaPixel(RandomInfo *random_info,
MagickExport MagickBooleanType PlasmaImageProxy(Image *image,
CacheView *image_view,RandomInfo *random_info,const SegmentInfo *segment,
- size_t attenuate,size_t depth)
+ size_t attenuate,size_t depth,ExceptionInfo *exception)
{
- ExceptionInfo
- *exception;
-
MagickRealType
plasma;
local_info.x2=(double) x_mid;
local_info.y2=(double) y_mid;
(void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth);
+ attenuate,depth,exception);
local_info=(*segment);
local_info.y1=(double) y_mid;
local_info.x2=(double) x_mid;
(void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth);
+ attenuate,depth,exception);
local_info=(*segment);
local_info.x1=(double) x_mid;
local_info.y2=(double) y_mid;
(void) PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth);
+ attenuate,depth,exception);
local_info=(*segment);
local_info.x1=(double) x_mid;
local_info.y1=(double) y_mid;
return(PlasmaImageProxy(image,image_view,random_info,&local_info,
- attenuate,depth));
+ attenuate,depth,exception));
}
x_mid=(ssize_t) ceil((segment->x1+segment->x2)/2-0.5);
y_mid=(ssize_t) ceil((segment->y1+segment->y2)/2-0.5);
/*
Average pixels and apply plasma.
*/
- exception=(&image->exception);
plasma=(MagickRealType) QuantumRange/(2.0*attenuate);
if ((segment->x1 != (double) x_mid) || (segment->x2 != (double) x_mid))
{
}
\f
MagickExport MagickBooleanType PlasmaImage(Image *image,
- const SegmentInfo *segment,size_t attenuate,size_t depth)
+ const SegmentInfo *segment,size_t attenuate,size_t depth,
+ ExceptionInfo *exception)
{
CacheView
*image_view;
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
- if (SetImageStorageClass(image,DirectClass,&image->exception) == MagickFalse)
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
image_view=AcquireCacheView(image);
random_info=AcquireRandomInfo();
- status=PlasmaImageProxy(image,image_view,random_info,segment,attenuate,depth);
+ status=PlasmaImageProxy(image,image_view,random_info,segment,attenuate,depth,
+ exception);
random_info=DestroyRandomInfo(random_info);
image_view=DestroyCacheView(image_view);
return(status);
value);
(void) CloneString(&annotate_info->text,caption);
count=FormatMagickCaption(caption_image,annotate_info,MagickTrue,&metrics,
- &caption);
+ &caption,exception);
status=SetImageExtent(caption_image,image->columns,(size_t)
((count+1)*(metrics.ascent-metrics.descent)+0.5),exception);
if (status == MagickFalse)
if (annotate_info->gravity == UndefinedGravity)
(void) CloneString(&annotate_info->geometry,AcquireString(
geometry));
- (void) AnnotateImage(caption_image,annotate_info);
+ (void) AnnotateImage(caption_image,annotate_info,exception);
height+=caption_image->rows;
}
annotate_info=DestroyDrawInfo(annotate_info);
%
% The format of the SolarizeImage method is:
%
-% MagickBooleanType SolarizeImage(Image *image,const double threshold)
+% MagickBooleanType SolarizeImage(Image *image,const double threshold,
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o threshold: Define the extent of the solarization.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
MagickExport MagickBooleanType SolarizeImage(Image *image,
- const double threshold)
+ const double threshold,ExceptionInfo *exception)
{
#define SolarizeImageTag "Solarize/Image"
CacheView
*image_view;
- ExceptionInfo
- *exception;
-
MagickBooleanType
status;
*/
status=MagickTrue;
progress=0;
- exception=(&image->exception);
image_view=AcquireCacheView(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(dynamic,4) shared(progress,status)
if (status == MagickFalse)
continue;
- q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,
- exception);
+ q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
if (q == (const Quantum *) NULL)
{
status=MagickFalse;
*WaveImage(const Image *,const double,const double,ExceptionInfo *);
extern MagickExport MagickBooleanType
- PlasmaImage(Image *,const SegmentInfo *,size_t,size_t),
- SolarizeImage(Image *,const double);
+ PlasmaImage(Image *,const SegmentInfo *,size_t,size_t,ExceptionInfo *),
+ SolarizeImage(Image *,const double,ExceptionInfo *);
#if defined(__cplusplus) || defined(c_plusplus)
}
draw_info->stroke=montage_info->stroke;
draw_info->fill=montage_info->fill;
draw_info->text=AcquireString("");
- (void) GetTypeMetrics(image_list[0],draw_info,&metrics);
+ (void) GetTypeMetrics(image_list[0],draw_info,&metrics,exception);
texture=NewImageList();
if (montage_info->texture != (char *) NULL)
{
clone_info=CloneDrawInfo(image_info,draw_info);
clone_info->gravity=CenterGravity;
clone_info->pointsize*=2.0;
- (void) GetTypeMetrics(image_list[0],clone_info,&metrics);
+ (void) GetTypeMetrics(image_list[0],clone_info,&metrics,exception);
(void) FormatLocaleString(geometry,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) montage->columns,(double)
(metrics.ascent-metrics.descent),0.0,(double) extract_info.y+4);
(void) CloneString(&clone_info->geometry,geometry);
(void) CloneString(&clone_info->text,title);
- (void) AnnotateImage(montage,clone_info);
+ (void) AnnotateImage(montage,clone_info,exception);
clone_info=DestroyDrawInfo(clone_info);
}
(void) SetImageProgressMonitor(montage,progress_monitor,
(montage_info->shadow != MagickFalse ? 4 : 0))+bevel_width));
(void) CloneString(&draw_info->geometry,geometry);
(void) CloneString(&draw_info->text,value);
- (void) AnnotateImage(montage,draw_info);
+ (void) AnnotateImage(montage,draw_info,exception);
}
}
x_offset+=(ssize_t) (width+2*(extract_info.x+border_width));
draw_info->affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
draw_info->affine.sy=cos(DegreesToRadians(fmod(angle,360.0)));
(void) CloneString(&draw_info->geometry,geometry);
- status=AnnotateImage(wand->images,draw_info);
+ status=AnnotateImage(wand->images,draw_info,&wand->images->exception);
draw_info=DestroyDrawInfo(draw_info);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
return(status);
}
\f
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- status=SolarizeImage(wand->images,threshold);
- if (status == MagickFalse)
- InheritException(wand->exception,&wand->images->exception);
+ status=SolarizeImage(wand->images,threshold,&wand->images->exception);
return(status);
}
\f
}
(void) CloneString(&draw_info->text,text);
(void) ResetMagickMemory(&metrics,0,sizeof(metrics));
- status=GetTypeMetrics(wand->images,draw_info,&metrics);
+ status=GetTypeMetrics(wand->images,draw_info,&metrics,
+ &wand->images->exception);
draw_info=DestroyDrawInfo(draw_info);
if (status == MagickFalse)
{
- InheritException(wand->exception,&wand->images->exception);
font_metrics=(double *) RelinquishMagickMemory(font_metrics);
return((double *) NULL);
}
}
(void) CloneString(&draw_info->text,text);
(void) ResetMagickMemory(&metrics,0,sizeof(metrics));
- status=GetMultilineTypeMetrics(wand->images,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(wand->images,draw_info,&metrics,
+ &wand->images->exception);
draw_info=DestroyDrawInfo(draw_info);
if (status == MagickFalse)
{
- InheritException(wand->exception,&wand->images->exception);
font_metrics=(double *) RelinquishMagickMemory(font_metrics);
return((double *) NULL);
}
fmod(geometry_info.sigma,360.0))));
draw_info->affine.sy=cos(DegreesToRadians(
fmod(geometry_info.sigma,360.0)));
- (void) AnnotateImage(*image,draw_info);
- InheritException(exception,&(*image)->exception);
+ (void) AnnotateImage(*image,draw_info,exception);
break;
}
if (LocaleCompare("antialias",option+1) == 0)
(void) SyncImageSettings(mogrify_info,*image);
threshold=SiPrefixToDouble(argv[i+1],QuantumRange);
- (void) SolarizeImage(*image,threshold);
- InheritException(exception,&(*image)->exception);
+ (void) SolarizeImage(*image,threshold,exception);
break;
}
if (LocaleCompare("sparse-color",option+1) == 0)
if (attribute_flag[32] != 0)
draw_info->direction=(DirectionType)
argument_list[32].integer_reference;
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
flags=ParseGeometry(argument_list[0].string_reference,
&geometry_info);
if (attribute_flag[1] != 0)
- geometry_info.rho=SiPrefixToDouble(argument_list[1].string_reference,
- QuantumRange);
- (void) SolarizeImage(image,geometry_info.rho);
+ geometry_info.rho=SiPrefixToDouble(
+ argument_list[1].string_reference,QuantumRange);
+ (void) SolarizeImage(image,geometry_info.rho,exception);
break;
}
case 53: /* Sync */
(void) FormatLocaleString(draw_info->geometry,MaxTextExtent,
"%.15g,%.15g",x,y);
}
- status=GetTypeMetrics(image,draw_info,&metrics);
+ status=GetTypeMetrics(image,draw_info,&metrics,exception);
(void) CatchImageException(image);
if (status == MagickFalse)
PUSHs(&sv_undef);
(void) FormatLocaleString(draw_info->geometry,MaxTextExtent,
"%.15g,%.15g",x,y);
}
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
- (void) CatchImageException(image);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
+ (void) CatchException(exception);
if (status == MagickFalse)
PUSHs(&sv_undef);
else
for ( ; ; )
{
text=AcquireString(caption);
- i=FormatMagickCaption(image,draw_info,MagickFalse,&metrics,&text);
+ i=FormatMagickCaption(image,draw_info,MagickFalse,&metrics,&text,
+ exception);
(void) CloneString(&draw_info->text,text);
text=DestroyString(text);
(void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
-metrics.bounds.x1,metrics.ascent);
if (draw_info->gravity == UndefinedGravity)
(void) CloneString(&draw_info->geometry,geometry);
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
(void) status;
width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
for ( ; ; )
{
text=AcquireString(caption);
- i=FormatMagickCaption(image,draw_info,MagickFalse,&metrics,&text);
+ i=FormatMagickCaption(image,draw_info,MagickFalse,&metrics,&text,
+ exception);
(void) CloneString(&draw_info->text,text);
text=DestroyString(text);
(void) FormatLocaleString(geometry,MaxTextExtent,"%+g%+g",
-metrics.bounds.x1,metrics.ascent);
if (draw_info->gravity == UndefinedGravity)
(void) CloneString(&draw_info->geometry,geometry);
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
height=(size_t) floor(metrics.height+draw_info->stroke_width+0.5);
if ((width > (image->columns+1)) || (height > (image->rows+1)))
}
draw_info->pointsize--;
}
- i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&caption);
+ i=FormatMagickCaption(image,draw_info,MagickTrue,&metrics,&caption,exception);
if (image->rows == 0)
image->rows=(size_t) ((i+1)*(metrics.ascent-metrics.descent+
draw_info->interline_spacing+draw_info->stroke_width)+0.5);
Draw caption.
*/
(void) CloneString(&draw_info->text,caption);
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
if ((draw_info->gravity != UndefinedGravity) &&
(draw_info->direction != RightToLeftDirection))
image->page.x=(ssize_t) (metrics.bounds.x1-draw_info->stroke_width/2.0);
metrics.ascent+draw_info->stroke_width/2.0);
draw_info->geometry=AcquireString(geometry);
}
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
caption=DestroyString(caption);
return(GetFirstImageInList(image));
/*
Fit label to canvas size.
*/
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
for ( ; status != MagickFalse; draw_info->pointsize*=2.0)
{
width=(size_t) floor(metrics.width+draw_info->stroke_width+0.5);
if (((image->columns != 0) && (width >= image->columns)) ||
((image->rows != 0) && (height >= image->rows)))
break;
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
}
draw_info->pointsize/=2.0;
for ( ; status != MagickFalse; draw_info->pointsize--)
break;
if (draw_info->pointsize < 2.0)
break;
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
}
}
- status=GetMultilineTypeMetrics(image,draw_info,&metrics);
+ status=GetMultilineTypeMetrics(image,draw_info,&metrics,exception);
if (status == MagickFalse)
{
InheritException(exception,&image->exception);
image=DestroyImageList(image);
return((Image *) NULL);
}
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
if (image_info->pointsize == 0.0)
{
char
affine.tx;
draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
affine.ty;
- (void) AnnotateImage(msl_info->image[n],draw_info);
+ (void) AnnotateImage(msl_info->image[n],draw_info,
+ &msl_info->image[n]->exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
affine.tx;
draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
affine.ty;
- status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics);
+ status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics,
+ &msl_info->image[n]->exception);
if (status != MagickFalse)
{
Image
}
}
}
- (void) SolarizeImage(msl_info->image[n],geometry_info.rho);
+ (void) SolarizeImage(msl_info->image[n],geometry_info.rho,
+ &msl_info->image[n]->exception);
break;
}
if (LocaleCompare((const char *) tag,"spread") == 0)
i>>=1;
for (depth=1; ; depth++)
{
- if (PlasmaImage(image,&segment_info,0,depth) != MagickFalse)
+ if (PlasmaImage(image,&segment_info,0,depth,exception) != MagickFalse)
break;
status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) depth,
max_depth);
draw_info->pointsize=svg_info->pointsize;
draw_info->text=AcquireString(svg_info->text);
(void) ConcatenateString(&draw_info->text," ");
- GetTypeMetrics(svg_info->image,draw_info,&metrics);
+ (void) GetTypeMetrics(svg_info->image,draw_info,
+ &metrics,svg_info->exception);
svg_info->bounds.x+=metrics.width;
draw_info=DestroyDrawInfo(draw_info);
*svg_info->text='\0';
draw_info->pointsize=svg_info->pointsize;
draw_info->text=AcquireString(svg_info->text);
(void) ConcatenateString(&draw_info->text," ");
- GetTypeMetrics(svg_info->image,draw_info,&metrics);
+ (void) GetTypeMetrics(svg_info->image,draw_info,&metrics,
+ svg_info->exception);
svg_info->bounds.x+=metrics.width;
draw_info=DestroyDrawInfo(draw_info);
*svg_info->text='\0';
(void) FormatLocaleString(geometry,MaxTextExtent,"0x0%+ld%+ld",(long) page.x,
(long) page.y);
(void) CloneString(&draw_info->geometry,geometry);
- status=GetTypeMetrics(image,draw_info,&metrics);
+ status=GetTypeMetrics(image,draw_info,&metrics,exception);
if (status == MagickFalse)
ThrowReaderException(TypeError,"UnableToGetTypeMetrics");
page.y=(ssize_t) ceil((double) page.y+metrics.ascent-0.5);
(void) SetImageProgressMonitor(image,progress_monitor,
image->client_data);
}
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
if (p == (char *) NULL)
break;
/*
(void) TextureImage(image,texture);
(void) SetImageProgressMonitor(image,progress_monitor,image->client_data);
}
- (void) AnnotateImage(image,draw_info);
+ (void) AnnotateImage(image,draw_info,exception);
if (texture != (Image *) NULL)
texture=DestroyImage(texture);
draw_info=DestroyDrawInfo(draw_info);