81 if (wand->
debug != MagickFalse)
82 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
89 wand->
debug=IsEventLogging();
121 if (wand->
debug != MagickFalse)
122 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
123 clone_wand=(
MagickWand *) AcquireCriticalMemory(
sizeof(*clone_wand));
124 (void) memset(clone_wand,0,
sizeof(*clone_wand));
128 clone_wand->
exception=AcquireExceptionInfo();
134 clone_wand->
debug=IsEventLogging();
135 if (clone_wand->
debug != MagickFalse)
136 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clone_wand->
name);
167 if (wand->
debug != MagickFalse)
168 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
172 if (wand->
exception != (ExceptionInfo *) NULL )
176 wand=(
MagickWand *) RelinquishMagickMemory(wand);
239 if (wand->
debug != MagickFalse)
240 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
271 ExceptionType *severity)
278 if (wand->
debug != MagickFalse)
279 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
280 assert(severity != (ExceptionType *) NULL);
283 sizeof(*description));
284 if (description == (
char *) NULL)
286 (void) ThrowMagickException(wand->
exception,GetMagickModule(),WandError,
287 "MemoryAllocationFailed",
"`%s'",wand->
name);
288 return((
char *) NULL);
291 if (wand->
exception->reason != (
char *) NULL)
292 (
void) CopyMagickString(description,GetLocaleExceptionMessage(
294 if (wand->
exception->description != (
char *) NULL)
297 (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
331 if (wand->
debug != MagickFalse)
332 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
363 if (wand->
debug != MagickFalse)
364 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
365 if (wand->
images == (Image *) NULL)
367 (void) ThrowMagickException(wand->
exception,GetMagickModule(),WandError,
368 "ContainsNoIterators",
"`%s'",wand->
name);
371 return(GetImageIndexInList(wand->
images));
411 exception=AcquireExceptionInfo();
412 configure_info=GetConfigureInfoList(option,&number_options,exception);
413 exception=DestroyExceptionInfo(exception);
414 if (configure_info == (
const ConfigureInfo **) NULL)
415 return((
char *) NULL);
417 if (number_options != 0)
418 value=AcquireString(configure_info[0]->value);
419 configure_info=(
const ConfigureInfo **) RelinquishMagickMemory((
void *)
452 size_t *number_options)
460 exception=AcquireExceptionInfo();
461 options=GetConfigureList(pattern,number_options,exception);
462 exception=DestroyExceptionInfo(exception);
527 if (wand->
debug != MagickFalse)
528 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
529 assert(drawing_wand != (
const DrawingWand *) NULL);
530 if (wand->
images == (Image *) NULL)
532 (void) ThrowMagickException(wand->
exception,GetMagickModule(),WandError,
533 "ContainsNoImages",
"`%s'",wand->
name);
534 return((
double *) NULL);
536 font_metrics=(
double *) AcquireQuantumMemory(13UL,
sizeof(*font_metrics));
537 if (font_metrics == (
double *) NULL)
538 return((
double *) NULL);
540 if (draw_info == (DrawInfo *) NULL)
542 font_metrics=(
double *) RelinquishMagickMemory(font_metrics);
543 return((
double *) NULL);
545 (void) CloneString(&draw_info->text,text);
546 (void) memset(&metrics,0,
sizeof(metrics));
547 status=GetTypeMetrics(wand->
images,draw_info,&metrics,wand->
exception);
548 draw_info=DestroyDrawInfo(draw_info);
549 if (status == MagickFalse)
551 font_metrics=(
double *) RelinquishMagickMemory(font_metrics);
552 return((
double *) NULL);
554 font_metrics[0]=metrics.pixels_per_em.x;
555 font_metrics[1]=metrics.pixels_per_em.y;
556 font_metrics[2]=metrics.ascent;
557 font_metrics[3]=metrics.descent;
558 font_metrics[4]=metrics.width;
559 font_metrics[5]=metrics.height;
560 font_metrics[6]=metrics.max_advance;
561 font_metrics[7]=metrics.bounds.x1;
562 font_metrics[8]=metrics.bounds.y1;
563 font_metrics[9]=metrics.bounds.x2;
564 font_metrics[10]=metrics.bounds.y2;
565 font_metrics[11]=metrics.origin.x;
566 font_metrics[12]=metrics.origin.y;
567 return(font_metrics);
634 if (wand->
debug != MagickFalse)
635 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
636 assert(drawing_wand != (
const DrawingWand *) NULL);
637 if (wand->
images == (Image *) NULL)
639 (void) ThrowMagickException(wand->
exception,GetMagickModule(),WandError,
640 "ContainsNoImages",
"`%s'",wand->
name);
641 return((
double *) NULL);
643 font_metrics=(
double *) AcquireQuantumMemory(13UL,
sizeof(*font_metrics));
644 if (font_metrics == (
double *) NULL)
645 return((
double *) NULL);
647 if (draw_info == (DrawInfo *) NULL)
649 font_metrics=(
double *) RelinquishMagickMemory(font_metrics);
650 return((
double *) NULL);
652 (void) CloneString(&draw_info->text,text);
653 (void) memset(&metrics,0,
sizeof(metrics));
654 status=GetMultilineTypeMetrics(wand->
images,draw_info,&metrics,
656 draw_info=DestroyDrawInfo(draw_info);
657 if (status == MagickFalse)
659 font_metrics=(
double *) RelinquishMagickMemory(font_metrics);
660 return((
double *) NULL);
662 font_metrics[0]=metrics.pixels_per_em.x;
663 font_metrics[1]=metrics.pixels_per_em.y;
664 font_metrics[2]=metrics.ascent;
665 font_metrics[3]=metrics.descent;
666 font_metrics[4]=metrics.width;
667 font_metrics[5]=metrics.height;
668 font_metrics[6]=metrics.max_advance;
669 font_metrics[7]=metrics.bounds.x1;
670 font_metrics[8]=metrics.bounds.y1;
671 font_metrics[9]=metrics.bounds.x2;
672 font_metrics[10]=metrics.bounds.y2;
673 font_metrics[11]=metrics.origin.x;
674 font_metrics[12]=metrics.origin.y;
675 return(font_metrics);
704 size_t *number_fonts)
712 exception=AcquireExceptionInfo();
713 fonts=GetTypeList(pattern,number_fonts,exception);
714 exception=DestroyExceptionInfo(exception);
745 size_t *number_formats)
753 exception=AcquireExceptionInfo();
754 formats=GetMagickList(pattern,number_formats,exception);
755 exception=DestroyExceptionInfo(exception);
784 (void) LogMagickEvent(TraceEvent,GetMagickModule(),
"...");
785 return(RelinquishMagickMemory(memory));
824 if (wand->
debug != MagickFalse)
825 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
868 if (wand->
debug != MagickFalse)
869 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
924 if (wand->
debug != MagickFalse)
925 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
926 if (wand->
images == (Image *) NULL)
928 image=GetImageFromList(wand->
images,index);
929 if (image == (Image *) NULL)
971 if (wand->
debug != MagickFalse)
972 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
998 if (IsMagickCoreInstantiated() == MagickFalse)
999 MagickCoreGenesis((
char *) NULL,MagickFalse);
1023 MagickCoreTerminus();
1058 depth=MAGICKCORE_QUANTUM_DEPTH;
1059 quantum=GetMagickQuantumDepth(&depth);
1060 if (depth != MAGICKCORE_QUANTUM_DEPTH)
1062 wand=(
MagickWand *) AcquireMagickMemory(
sizeof(*wand));
1065 GetExceptionMessage(errno));
1066 (void) memset(wand,0,
sizeof(*wand));
1070 wand->
images=NewImageList();
1073 wand->
debug=IsEventLogging();
1074 if (wand->
debug != MagickFalse)
1075 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->
name);
1134 return(IsMagickCoreInstantiated());
#define ThrowWandFatalException(severity, tag, context)
WandExport double * MagickQueryFontMetrics(MagickWand *wand, const DrawingWand *drawing_wand, const char *text)
WandExport void ClearMagickWand(MagickWand *wand)
#define MagickWandSignature
WandExport void * MagickRelinquishMemory(void *memory)
WandExport size_t AcquireWandId(void)
WandExport char * MagickQueryConfigureOption(const char *option)
MagickExport MagickBooleanType IsMagickWandInstantiated(void)
WandExport MagickWand * NewMagickWand(void)
MagickBooleanType insert_before
WandExport MagickBooleanType MagickSetIteratorIndex(MagickWand *wand, const ssize_t index)
WandExport void MagickSetLastIterator(MagickWand *wand)
WandExport DrawInfo * PeekDrawingWand(const DrawingWand *wand)
WandExport void RelinquishWandId(const size_t id)
MagickBooleanType image_pending
WandExport double * MagickQueryMultilineFontMetrics(MagickWand *wand, const DrawingWand *drawing_wand, const char *text)
WandExport void MagickWandTerminus(void)
WandExport void MagickWandGenesis(void)
WandExport void DestroyWandIds(void)
WandExport char ** MagickQueryFormats(const char *pattern, size_t *number_formats)
char name[MagickPathExtent]
WandExport void MagickResetIterator(MagickWand *wand)
WandExport char ** MagickQueryConfigureOptions(const char *pattern, size_t *number_options)
WandExport char ** MagickQueryFonts(const char *pattern, size_t *number_fonts)
WandExport MagickBooleanType IsMagickWand(const MagickWand *wand)
WandExport MagickWand * NewMagickWandFromImage(const Image *image)
WandExport MagickWand * CloneMagickWand(const MagickWand *wand)
WandExport MagickWand * DestroyMagickWand(MagickWand *wand)
WandExport ssize_t MagickGetIteratorIndex(MagickWand *wand)
WandExport MagickBooleanType MagickClearException(MagickWand *wand)
WandExport ExceptionType MagickGetExceptionType(const MagickWand *wand)
WandExport void MagickSetFirstIterator(MagickWand *wand)
WandExport char * MagickGetException(const MagickWand *wand, ExceptionType *severity)
ExceptionInfo * exception