2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % DDDD RRRR AAA W W IIIII N N GGGG %
7 % D D R R A A W W I NN N G %
8 % D D RRRR AAAAA W W I N N N G GG %
9 % D D R R A A W W W I N NN G G %
10 % DDDD R R A A W W IIIII N N GGG %
14 % W W W AAAAA N N N D D %
15 % WW WW A A N NN D D %
19 % MagickWand Image Vector Drawing Methods %
26 % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
27 % dedicated to making software imaging solutions freely available. %
29 % You may not use this file except in compliance with the License. You may %
30 % obtain a copy of the License at %
32 % http://www.imagemagick.org/script/license.php %
34 % Unless required by applicable law or agreed to in writing, software %
35 % distributed under the License is distributed on an "AS IS" BASIS, %
36 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
37 % See the License for the specific language governing permissions and %
38 % limitations under the License. %
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 #include "MagickWand/studio.h"
50 #include "MagickWand/MagickWand.h"
51 #include "MagickWand/magick-wand-private.h"
52 #include "MagickWand/wand.h"
53 #include "MagickCore/string-private.h"
58 #define DRAW_BINARY_IMPLEMENTATION 0
60 #define CurrentContext (wand->graphic_context[wand->index])
61 #define DrawingWandId "DrawingWand"
62 #define ThrowDrawException(severity,tag,reason) (void) ThrowMagickException( \
63 wand->exception,GetMagickModule(),severity,tag,"`%s'",reason);
71 PathCloseOperation, /* Z|z (none) */
72 PathCurveToOperation, /* C|c (x1 y1 x2 y2 x y)+ */
73 PathCurveToQuadraticBezierOperation, /* Q|q (x1 y1 x y)+ */
74 PathCurveToQuadraticBezierSmoothOperation, /* T|t (x y)+ */
75 PathCurveToSmoothOperation, /* S|s (x2 y2 x y)+ */
76 PathEllipticArcOperation, /* A|a (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+ */
77 PathLineToHorizontalOperation, /* H|h x+ */
78 PathLineToOperation, /* L|l (x y)+ */
79 PathLineToVerticalOperation, /* V|v y+ */
80 PathMoveToOperation /* M|m (x y)+ */
98 /* Support structures */
105 /* MVG output string and housekeeping */
110 mvg_alloc, /* total allocated memory */
111 mvg_length; /* total MVG length */
114 mvg_width; /* current line width */
116 /* Pattern support */
128 index; /* array index */
134 filter_off; /* true if not filtering attributes */
136 /* Pretty-printing depth */
138 indent_depth; /* number of left-hand pad characters */
140 /* Path operation support */
155 /* Vector table for invoking subordinate renderers */
158 DrawingWand *(*DestroyDrawingWand) (DrawingWand *);
159 void (*DrawAnnotation)(DrawingWand *,const double,const double,
160 const unsigned char *);
161 void (*DrawArc)(DrawingWand *,const double,const double,const double,
162 const double,const double,const double);
163 void (*DrawBezier)(DrawingWand *,const size_t,const PointInfo *);
164 void (*DrawCircle)(DrawingWand *,const double,const double,const double,
166 void (*DrawColor)(DrawingWand *,const double,const double,const PaintMethod);
167 void (*DrawComment)(DrawingWand *,const char *);
168 void (*DrawEllipse)(DrawingWand *,const double,const double,const double,
169 const double,const double,const double);
170 MagickBooleanType (*DrawComposite)(DrawingWand *,const CompositeOperator,
171 const double,const double,const double,const double,const Image *);
172 void (*DrawLine)(DrawingWand *,const double,const double,const double,
174 void (*DrawMatte)(DrawingWand *,const double,const double,const PaintMethod);
175 void (*DrawPathClose)(DrawingWand *);
176 void (*DrawPathCurveToAbsolute)(DrawingWand *,const double,const double,
177 const double,const double,const double,const double);
178 void (*DrawPathCurveToRelative)(DrawingWand *,const double,const double,
179 const double,const double,const double,const double);
180 void (*DrawPathCurveToQuadraticBezierAbsolute)(DrawingWand *,const double,
181 const double,const double,const double);
182 void (*DrawPathCurveToQuadraticBezierRelative)(DrawingWand *,const double,
183 const double,const double,const double);
184 void (*DrawPathCurveToQuadraticBezierSmoothAbsolute)(DrawingWand *,
185 const double,const double);
186 void (*DrawPathCurveToQuadraticBezierSmoothRelative)(DrawingWand *,
187 const double,const double);
188 void (*DrawPathCurveToSmoothAbsolute)(DrawingWand *,const double,
189 const double,const double,const double);
190 void (*DrawPathCurveToSmoothRelative)(DrawingWand *,const double,
191 const double,const double,const double);
192 void (*DrawPathEllipticArcAbsolute)(DrawingWand *,const double,const double,
193 const double,const MagickBooleanType,const MagickBooleanType,const double,
195 void (*DrawPathEllipticArcRelative)(DrawingWand *,const double,const double,
196 const double,const MagickBooleanType,const MagickBooleanType,const double,
198 void (*DrawPathFinish)(DrawingWand *);
199 void (*DrawPathLineToAbsolute)(DrawingWand *,const double,const double);
200 void (*DrawPathLineToRelative)(DrawingWand *,const double,const double);
201 void (*DrawPathLineToHorizontalAbsolute)(DrawingWand *,const double);
202 void (*DrawPathLineToHorizontalRelative)(DrawingWand *,const double);
203 void (*DrawPathLineToVerticalAbsolute)(DrawingWand *,const double);
204 void (*DrawPathLineToVerticalRelative)(DrawingWand *,const double);
205 void (*DrawPathMoveToAbsolute)(DrawingWand *,const double,const double);
206 void (*DrawPathMoveToRelative)(DrawingWand *,const double,const double);
207 void (*DrawPathStart)(DrawingWand *);
208 void (*DrawPoint)(DrawingWand *,const double,const double);
209 void (*DrawPolygon)(DrawingWand *,const size_t,const PointInfo *);
210 void (*DrawPolyline)(DrawingWand *,const size_t,const PointInfo *);
211 void (*DrawPopClipPath)(DrawingWand *);
212 void (*DrawPopDefs)(DrawingWand *);
213 MagickBooleanType (*DrawPopPattern)(DrawingWand *);
214 void (*DrawPushClipPath)(DrawingWand *,const char *);
215 void (*DrawPushDefs)(DrawingWand *);
216 MagickBooleanType (*DrawPushPattern)(DrawingWand *,const char *,const double,
217 const double,const double,const double);
218 void (*DrawRectangle)(DrawingWand *,const double,const double,const double,
220 void (*DrawRoundRectangle)(DrawingWand *,double,double,double,double,
222 void (*DrawAffine)(DrawingWand *,const AffineMatrix *);
223 MagickBooleanType (*DrawSetClipPath)(DrawingWand *,const char *);
224 void (*DrawSetBorderColor)(DrawingWand *,const PixelWand *);
225 void (*DrawSetClipRule)(DrawingWand *,const FillRule);
226 void (*DrawSetClipUnits)(DrawingWand *,const ClipPathUnits);
227 void (*DrawSetFillColor)(DrawingWand *,const PixelWand *);
228 void (*DrawSetFillRule)(DrawingWand *,const FillRule);
229 MagickBooleanType (*DrawSetFillPatternURL)(DrawingWand *,const char *);
230 MagickBooleanType (*DrawSetFont)(DrawingWand *,const char *);
231 MagickBooleanType (*DrawSetFontFamily)(DrawingWand *,const char *);
232 void (*DrawSetTextKerning)(DrawingWand *,const double);
233 void (*DrawSetTextInterwordSpacing)(DrawingWand *,const double);
234 double (*DrawGetTextKerning)(DrawingWand *);
235 double (*DrawGetTextInterwordSpacing)(DrawingWand *);
236 void (*DrawSetFontSize)(DrawingWand *,const double);
237 void (*DrawSetFontStretch)(DrawingWand *,const StretchType);
238 void (*DrawSetFontStyle)(DrawingWand *,const StyleType);
239 void (*DrawSetFontWeight)(DrawingWand *,const size_t);
240 void (*DrawSetGravity)(DrawingWand *,const GravityType);
241 void (*DrawRotate)(DrawingWand *,const double);
242 void (*DrawScale)(DrawingWand *,const double,const double);
243 void (*DrawSkewX)(DrawingWand *,const double);
244 void (*DrawSkewY)(DrawingWand *,const double);
245 void (*DrawSetStrokeAntialias)(DrawingWand *,const MagickBooleanType);
246 void (*DrawSetStrokeColor)(DrawingWand *,const PixelWand *);
247 MagickBooleanType (*DrawSetStrokeDashArray)(DrawingWand *,const double *);
248 void (*DrawSetStrokeDashOffset)(DrawingWand *,const double);
249 void (*DrawSetStrokeLineCap)(DrawingWand *,const LineCap);
250 void (*DrawSetStrokeLineJoin)(DrawingWand *,const LineJoin);
251 void (*DrawSetStrokeMiterLimit)(DrawingWand *,const size_t);
252 MagickBooleanType (*DrawSetStrokePatternURL)(DrawingWand *,const char *);
253 void (*DrawSetStrokeWidth)(DrawingWand *,const double);
254 void (*DrawSetTextAntialias)(DrawingWand *,const MagickBooleanType);
255 void (*DrawSetTextDecoration)(DrawingWand *,const DecorationType);
256 void (*DrawSetTextUnderColor)(DrawingWand *,const PixelWand *);
257 void (*DrawTranslate)(DrawingWand *,const double,const double);
258 void (*DrawSetViewbox)(DrawingWand *,size_t,size_t,
260 void (*PeekDrawingWand)(DrawingWand *);
261 MagickBooleanType (*PopDrawingWand)(DrawingWand *);
262 MagickBooleanType (*PushDrawingWand)(DrawingWand *);
266 Forward declarations.
269 MvgPrintf(DrawingWand *,const char *,...) wand_attribute((format
271 MvgAutoWrapPrintf(DrawingWand *,const char *,...) wand_attribute((format
275 MvgAppendColor(DrawingWand *,const PixelPacket *);
278 "Printf" for MVG commands
280 static int MvgPrintf(DrawingWand *wand,const char *format,...)
285 if (wand->debug != MagickFalse)
286 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",format);
287 assert(wand != (DrawingWand *) NULL);
288 assert(wand->signature == WandSignature);
289 extent=20UL*MaxTextExtent;
290 if (wand->mvg == (char *) NULL)
292 wand->mvg=(char *) AcquireQuantumMemory(extent,sizeof(*wand->mvg));
293 if (wand->mvg == (char *) NULL)
295 ThrowDrawException(ResourceLimitError,"MemoryAllocationFailed",
299 wand->mvg_alloc=extent;
302 if (wand->mvg_alloc < (wand->mvg_length+10*MaxTextExtent))
304 extent+=wand->mvg_alloc;
305 wand->mvg=(char *) ResizeQuantumMemory(wand->mvg,extent,
307 if (wand->mvg == (char *) NULL)
309 ThrowDrawException(ResourceLimitError,"MemoryAllocationFailed",
313 wand->mvg_alloc=extent;
325 while (wand->mvg_width < wand->indent_depth)
327 wand->mvg[wand->mvg_length]=' ';
331 wand->mvg[wand->mvg_length]='\0';
333 offset=(ssize_t) wand->mvg_alloc-wand->mvg_length-1;
336 va_start(argp,format);
337 #if defined(MAGICKCORE_HAVE_VSNPRINTF)
338 count=vsnprintf(wand->mvg+wand->mvg_length,(size_t) offset,format,argp);
340 count=vsprintf(wand->mvg+wand->mvg_length,format,argp);
344 if ((count < 0) || (count > (int) offset))
345 ThrowDrawException(DrawError,"UnableToPrint",format)
348 wand->mvg_length+=count;
349 wand->mvg_width+=count;
351 wand->mvg[wand->mvg_length]='\0';
352 if ((wand->mvg_length > 1) && (wand->mvg[wand->mvg_length-1] == '\n'))
354 assert((wand->mvg_length+1) < wand->mvg_alloc);
359 static int MvgAutoWrapPrintf(DrawingWand *wand,const char *format,...)
362 buffer[MaxTextExtent];
370 va_start(argp,format);
371 #if defined(MAGICKCORE_HAVE_VSNPRINTF)
372 count=vsnprintf(buffer,sizeof(buffer)-1,format,argp);
374 count=vsprintf(buffer,format,argp);
377 buffer[sizeof(buffer)-1]='\0';
379 ThrowDrawException(DrawError,"UnableToPrint",format)
382 if (((wand->mvg_width + count) > 78) && (buffer[count-1] != '\n'))
383 (void) MvgPrintf(wand, "\n");
384 (void) MvgPrintf(wand,"%s",buffer);
389 static void MvgAppendColor(DrawingWand *wand,const PixelPacket *packet)
391 if ((packet->red == 0) && (packet->green == 0) && (packet->blue == 0) &&
392 (packet->alpha == (Quantum) TransparentAlpha))
393 (void) MvgPrintf(wand,"none");
397 tuple[MaxTextExtent];
402 GetPixelInfo(wand->image,&pixel);
403 pixel.colorspace=RGBColorspace;
404 pixel.matte=packet->alpha != OpaqueAlpha ? MagickTrue : MagickFalse;
405 pixel.red=(MagickRealType) packet->red;
406 pixel.green=(MagickRealType) packet->green;
407 pixel.blue=(MagickRealType) packet->blue;
408 pixel.alpha=(MagickRealType) packet->alpha;
409 GetColorTuple(&pixel,MagickTrue,tuple);
410 (void) MvgPrintf(wand,"%s",tuple);
414 static void MvgAppendPointsCommand(DrawingWand *wand,const char *command,
415 const size_t number_coordinates,const PointInfo *coordinates)
423 (void) MvgPrintf(wand,"%s",command);
424 for (i=number_coordinates, coordinate=coordinates; i != 0; i--)
426 (void) MvgAutoWrapPrintf(wand," %g %g",coordinate->x,coordinate->y);
429 (void) MvgPrintf(wand, "\n");
432 static void AdjustAffine(DrawingWand *wand,const AffineMatrix *affine)
434 assert(wand != (DrawingWand *) NULL);
435 assert(wand->signature == WandSignature);
436 if (wand->debug != MagickFalse)
437 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
438 if ((affine->sx != 1.0) || (affine->rx != 0.0) || (affine->ry != 0.0) ||
439 (affine->sy != 1.0) || (affine->tx != 0.0) || (affine->ty != 0.0))
444 current=CurrentContext->affine;
445 CurrentContext->affine.sx=affine->sx*current.sx+affine->ry*current.rx;
446 CurrentContext->affine.rx=affine->rx*current.sx+affine->sy*current.rx;
447 CurrentContext->affine.ry=affine->sx*current.ry+affine->ry*current.sy;
448 CurrentContext->affine.sy=affine->rx*current.ry+affine->sy*current.sy;
449 CurrentContext->affine.tx=affine->sx*current.tx+affine->ry*current.ty+
451 CurrentContext->affine.ty=affine->rx*current.tx+affine->sy*current.ty+
457 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
461 % C l e a r D r a w i n g W a n d %
465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467 % ClearDrawingWand() clears resources associated with the drawing wand.
469 % The format of the ClearDrawingWand method is:
471 % void ClearDrawingWand(DrawingWand *wand)
473 % A description of each parameter follows:
475 % o wand: the drawing wand to clear.
478 WandExport void ClearDrawingWand(DrawingWand *wand)
480 assert(wand != (DrawingWand *) NULL);
481 assert(wand->signature == WandSignature);
482 if (wand->debug != MagickFalse)
483 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
484 for ( ; wand->index > 0; wand->index--)
485 CurrentContext=DestroyDrawInfo(CurrentContext);
486 CurrentContext=DestroyDrawInfo(CurrentContext);
487 wand->graphic_context=(DrawInfo **) RelinquishMagickMemory(
488 wand->graphic_context);
489 if (wand->pattern_id != (char *) NULL)
490 wand->pattern_id=DestroyString(wand->pattern_id);
491 wand->mvg=DestroyString(wand->mvg);
492 if ((wand->destroy != MagickFalse) && (wand->image != (Image *) NULL))
493 wand->image=DestroyImage(wand->image);
495 wand->image=(Image *) NULL;
496 wand->mvg=(char *) NULL;
500 wand->pattern_id=(char *) NULL;
501 wand->pattern_offset=0;
502 wand->pattern_bounds.x=0;
503 wand->pattern_bounds.y=0;
504 wand->pattern_bounds.width=0;
505 wand->pattern_bounds.height=0;
507 wand->graphic_context=(DrawInfo **) AcquireMagickMemory(
508 sizeof(*wand->graphic_context));
509 if (wand->graphic_context == (DrawInfo **) NULL)
511 ThrowDrawException(ResourceLimitError,"MemoryAllocationFailed",
515 CurrentContext=CloneDrawInfo((ImageInfo *) NULL,(DrawInfo *) NULL);
516 wand->filter_off=MagickTrue;
517 wand->indent_depth=0;
518 wand->path_operation=PathDefaultOperation;
519 wand->path_mode=DefaultPathMode;
520 wand->image=AcquireImage((const ImageInfo *) NULL);
521 ClearMagickException(wand->exception);
522 wand->destroy=MagickTrue;
523 wand->debug=IsEventLogging();
527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
531 % C l o n e D r a w i n g W a n d %
535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537 % CloneDrawingWand() makes an exact copy of the specified wand.
539 % The format of the CloneDrawingWand method is:
541 % DrawingWand *CloneDrawingWand(const DrawingWand *wand)
543 % A description of each parameter follows:
545 % o wand: the magick wand.
548 WandExport DrawingWand *CloneDrawingWand(const DrawingWand *wand)
556 assert(wand != (DrawingWand *) NULL);
557 assert(wand->signature == WandSignature);
558 if (wand->debug != MagickFalse)
559 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
560 clone_wand=(DrawingWand *) AcquireMagickMemory(sizeof(*clone_wand));
561 if (clone_wand == (DrawingWand *) NULL)
562 ThrowWandFatalException(ResourceLimitFatalError,
563 "MemoryAllocationFailed",GetExceptionMessage(errno));
564 (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
565 clone_wand->id=AcquireWandId();
566 (void) FormatLocaleString(clone_wand->name,MaxTextExtent,"DrawingWand-%.20g",
567 (double) clone_wand->id);
568 clone_wand->exception=AcquireExceptionInfo();
569 InheritException(clone_wand->exception,wand->exception);
570 clone_wand->mvg=AcquireString(wand->mvg);
571 clone_wand->mvg_length=strlen(clone_wand->mvg);
572 clone_wand->mvg_alloc=wand->mvg_length+1;
573 clone_wand->mvg_width=wand->mvg_width;
574 clone_wand->pattern_id=AcquireString(wand->pattern_id);
575 clone_wand->pattern_offset=wand->pattern_offset;
576 clone_wand->pattern_bounds=wand->pattern_bounds;
577 clone_wand->index=wand->index;
578 clone_wand->graphic_context=(DrawInfo **) AcquireQuantumMemory((size_t)
579 wand->index+1UL,sizeof(*wand->graphic_context));
580 if (clone_wand->graphic_context == (DrawInfo **) NULL)
581 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
582 GetExceptionMessage(errno));
583 for (i=0; i <= (ssize_t) wand->index; i++)
584 clone_wand->graphic_context[i]=
585 CloneDrawInfo((ImageInfo *) NULL,wand->graphic_context[i]);
586 clone_wand->filter_off=wand->filter_off;
587 clone_wand->indent_depth=wand->indent_depth;
588 clone_wand->path_operation=wand->path_operation;
589 clone_wand->path_mode=wand->path_mode;
590 clone_wand->image=wand->image;
591 if (wand->image != (Image *) NULL)
592 clone_wand->image=CloneImage(wand->image,0,0,MagickTrue,
593 clone_wand->exception);
594 clone_wand->destroy=MagickTrue;
595 clone_wand->debug=IsEventLogging();
596 if (clone_wand->debug != MagickFalse)
597 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name);
598 clone_wand->signature=WandSignature;
603 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
607 % D e s t r o y D r a w i n g W a n d %
611 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
613 % DestroyDrawingWand() frees all resources associated with the drawing wand.
614 % Once the drawing wand has been freed, it should not be used and further
615 % unless it re-allocated.
617 % The format of the DestroyDrawingWand method is:
619 % DrawingWand *DestroyDrawingWand(DrawingWand *wand)
621 % A description of each parameter follows:
623 % o wand: the drawing wand to destroy.
626 WandExport DrawingWand *DestroyDrawingWand(DrawingWand *wand)
628 assert(wand != (DrawingWand *) NULL);
629 assert(wand->signature == WandSignature);
630 if (wand->debug != MagickFalse)
631 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
632 for ( ; wand->index > 0; wand->index--)
633 CurrentContext=DestroyDrawInfo(CurrentContext);
634 CurrentContext=DestroyDrawInfo(CurrentContext);
635 wand->graphic_context=(DrawInfo **) RelinquishMagickMemory(
636 wand->graphic_context);
637 if (wand->pattern_id != (char *) NULL)
638 wand->pattern_id=DestroyString(wand->pattern_id);
639 wand->mvg=DestroyString(wand->mvg);
640 if ((wand->destroy != MagickFalse) && (wand->image != (Image *) NULL))
641 wand->image=DestroyImage(wand->image);
642 wand->image=(Image *) NULL;
643 wand->exception=DestroyExceptionInfo(wand->exception);
644 wand->signature=(~WandSignature);
645 RelinquishWandId(wand->id);
646 wand=(DrawingWand *) RelinquishMagickMemory(wand);
651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
655 % D r a w A f f i n e %
659 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
661 % DrawAffine() adjusts the current affine transformation matrix with
662 % the specified affine transformation matrix. Note that the current affine
663 % transform is adjusted rather than replaced.
665 % The format of the DrawAffine method is:
667 % void DrawAffine(DrawingWand *wand,const AffineMatrix *affine)
669 % A description of each parameter follows:
671 % o wand: Drawing wand
673 % o affine: Affine matrix parameters
676 WandExport void DrawAffine(DrawingWand *wand,const AffineMatrix *affine)
678 assert(wand != (DrawingWand *) NULL);
679 assert(wand->signature == WandSignature);
680 if (wand->debug != MagickFalse)
681 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
682 assert(affine != (const AffineMatrix *) NULL);
683 AdjustAffine(wand,affine);
684 (void) MvgPrintf(wand,"affine %g %g %g %g %g %g\n",
685 affine->sx,affine->rx,affine->ry,affine->sy,affine->tx,affine->ty);
689 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
693 + D r a w A l l o c a t e W a n d %
697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
699 % DrawAllocateWand() allocates an initial drawing wand which is an opaque
700 % handle required by the remaining drawing methods.
702 % The format of the DrawAllocateWand method is:
704 % DrawingWand DrawAllocateWand(const DrawInfo *draw_info,Image *image)
706 % A description of each parameter follows:
708 % o draw_info: Initial drawing defaults. Set to NULL to use defaults.
710 % o image: the image to draw on.
713 WandExport DrawingWand *DrawAllocateWand(const DrawInfo *draw_info,Image *image)
718 wand=NewDrawingWand();
719 if (draw_info != (const DrawInfo *) NULL)
721 CurrentContext=DestroyDrawInfo(CurrentContext);
722 CurrentContext=CloneDrawInfo((ImageInfo *) NULL,draw_info);
724 if (image != (Image *) NULL)
726 wand->image=DestroyImage(wand->image);
727 wand->destroy=MagickFalse;
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738 % D r a w A n n o t a t i o n %
742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
744 % DrawAnnotation() draws text on the image.
746 % The format of the DrawAnnotation method is:
748 % void DrawAnnotation(DrawingWand *wand,const double x,
749 % const double y,const unsigned char *text)
751 % A description of each parameter follows:
753 % o wand: the drawing wand.
755 % o x: x ordinate to left of text
757 % o y: y ordinate to text baseline
759 % o text: text to draw
762 WandExport void DrawAnnotation(DrawingWand *wand,const double x,const double y,
763 const unsigned char *text)
768 assert(wand != (DrawingWand *) NULL);
769 assert(wand->signature == WandSignature);
770 if (wand->debug != MagickFalse)
771 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
772 assert(text != (const unsigned char *) NULL);
773 escaped_text=EscapeString((const char *) text,'\'');
774 if (escaped_text != (char *) NULL)
776 (void) MvgPrintf(wand,"text %g %g '%s'\n",x,y,escaped_text);
777 escaped_text=DestroyString(escaped_text);
782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
792 % DrawArc() draws an arc falling within a specified bounding rectangle on the
795 % The format of the DrawArc method is:
797 % void DrawArc(DrawingWand *wand,const double sx,const double sy,
798 % const double ex,const double ey,const double sd,const double ed)
800 % A description of each parameter follows:
802 % o wand: the drawing wand.
804 % o sx: starting x ordinate of bounding rectangle
806 % o sy: starting y ordinate of bounding rectangle
808 % o ex: ending x ordinate of bounding rectangle
810 % o ey: ending y ordinate of bounding rectangle
812 % o sd: starting degrees of rotation
814 % o ed: ending degrees of rotation
817 WandExport void DrawArc(DrawingWand *wand,const double sx,const double sy,
818 const double ex,const double ey,const double sd,const double ed)
820 assert(wand != (DrawingWand *) NULL);
821 assert(wand->signature == WandSignature);
822 if (wand->debug != MagickFalse)
823 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
824 (void) MvgPrintf(wand,"arc %g %g %g %g %g %g\n",sx,sy,ex,
829 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
833 % D r a w B e z i e r %
837 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
839 % DrawBezier() draws a bezier curve through a set of points on the image.
841 % The format of the DrawBezier method is:
843 % void DrawBezier(DrawingWand *wand,
844 % const size_t number_coordinates,const PointInfo *coordinates)
846 % A description of each parameter follows:
848 % o wand: the drawing wand.
850 % o number_coordinates: number of coordinates
852 % o coordinates: coordinates
855 WandExport void DrawBezier(DrawingWand *wand,
856 const size_t number_coordinates,const PointInfo *coordinates)
858 assert(wand != (DrawingWand *) NULL);
859 assert(wand->signature == WandSignature);
860 if (wand->debug != MagickFalse)
861 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
862 assert(coordinates != (const PointInfo *) NULL);
863 MvgAppendPointsCommand(wand,"bezier",number_coordinates,coordinates);
867 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
871 % D r a w C i r c l e %
875 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
877 % DrawCircle() draws a circle on the image.
879 % The format of the DrawCircle method is:
881 % void DrawCircle(DrawingWand *wand,const double ox,
882 % const double oy,const double px, const double py)
884 % A description of each parameter follows:
886 % o wand: the drawing wand.
888 % o ox: origin x ordinate
890 % o oy: origin y ordinate
892 % o px: perimeter x ordinate
894 % o py: perimeter y ordinate
897 WandExport void DrawCircle(DrawingWand *wand,const double ox,const double oy,
898 const double px,const double py)
900 assert(wand != (DrawingWand *) NULL);
901 assert(wand->signature == WandSignature);
902 if (wand->debug != MagickFalse)
903 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
904 (void) MvgPrintf(wand,"circle %g %g %g %g\n",ox,oy,px,py);
908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
912 % D r a w C l e a r E x c e p t i o n %
916 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
918 % DrawClearException() clear any exceptions associated with the wand.
920 % The format of the DrawClearException method is:
922 % MagickBooleanType DrawClearException(DrawWand *wand)
924 % A description of each parameter follows:
926 % o wand: the drawing wand.
929 WandExport MagickBooleanType DrawClearException(DrawingWand *wand)
931 assert(wand != (DrawingWand *) NULL);
932 assert(wand->signature == WandSignature);
933 if (wand->debug != MagickFalse)
934 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
935 ClearMagickException(wand->exception);
940 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
944 % D r a w C o m p o s i t e %
948 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
950 % DrawComposite() composites an image onto the current image, using the
951 % specified composition operator, specified position, and at the specified
954 % The format of the DrawComposite method is:
956 % MagickBooleanType DrawComposite(DrawingWand *wand,
957 % const CompositeOperator compose,const double x,
958 % const double y,const double width,const double height,
959 % MagickWand *magick_wand)
961 % A description of each parameter follows:
963 % o wand: the drawing wand.
965 % o compose: composition operator
967 % o x: x ordinate of top left corner
969 % o y: y ordinate of top left corner
971 % o width: Width to resize image to prior to compositing. Specify zero to
972 % use existing width.
974 % o height: Height to resize image to prior to compositing. Specify zero
975 % to use existing height.
977 % o magick_wand: Image to composite is obtained from this wand.
980 WandExport MagickBooleanType DrawComposite(DrawingWand *wand,
981 const CompositeOperator compose,const double x,const double y,
982 const double width,const double height,MagickWand *magick_wand)
1012 assert(wand != (DrawingWand *) NULL);
1013 assert(wand->signature == WandSignature);
1014 if (wand->debug != MagickFalse)
1015 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1016 assert(magick_wand != (MagickWand *) NULL);
1017 image=GetImageFromMagickWand(magick_wand);
1018 if (image == (Image *) NULL)
1019 return(MagickFalse);
1020 clone_image=CloneImage(image,0,0,MagickTrue,wand->exception);
1021 if (clone_image == (Image *) NULL)
1022 return(MagickFalse);
1023 image_info=AcquireImageInfo();
1024 (void) CopyMagickString(image_info->magick,"MIFF",MaxTextExtent);
1026 blob=(unsigned char *) ImageToBlob(image_info,clone_image,&blob_length,
1028 image_info=DestroyImageInfo(image_info);
1029 clone_image=DestroyImageList(clone_image);
1030 if (blob == (void *) NULL)
1031 return(MagickFalse);
1033 base64=Base64Encode(blob,blob_length,&encoded_length);
1034 blob=(unsigned char *) RelinquishMagickMemory(blob);
1035 if (base64 == (char *) NULL)
1038 buffer[MaxTextExtent];
1040 (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g bytes",(double)
1041 (4L*blob_length/3L+4L));
1042 ThrowDrawException(ResourceLimitWarning,"MemoryAllocationFailed",
1044 return(MagickFalse);
1046 mode=CommandOptionToMnemonic(MagickComposeOptions,(ssize_t) compose);
1047 media_type=MagickToMime(image->magick);
1048 (void) MvgPrintf(wand,"image %s %g %g %g %g 'data:%s;base64,\n",
1049 mode,x,y,width,height,media_type);
1051 for (i=(ssize_t) encoded_length; i > 0; i-=76)
1053 (void) MvgPrintf(wand,"%.76s",p);
1056 (void) MvgPrintf(wand,"\n");
1058 (void) MvgPrintf(wand,"'\n");
1059 media_type=DestroyString(media_type);
1060 base64=DestroyString(base64);
1065 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1069 % D r a w C o l o r %
1073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1075 % DrawColor() draws color on image using the current fill color, starting at
1076 % specified position, and using specified paint method. The available paint
1079 % PointMethod: Recolors the target pixel
1080 % ReplaceMethod: Recolor any pixel that matches the target pixel.
1081 % FloodfillMethod: Recolors target pixels and matching neighbors.
1082 % ResetMethod: Recolor all pixels.
1084 % The format of the DrawColor method is:
1086 % void DrawColor(DrawingWand *wand,const double x,const double y,
1087 % const PaintMethod paint_method)
1089 % A description of each parameter follows:
1091 % o wand: the drawing wand.
1097 % o paint_method: paint method.
1100 WandExport void DrawColor(DrawingWand *wand,const double x,const double y,
1101 const PaintMethod paint_method)
1103 assert(wand != (DrawingWand *) NULL);
1104 assert(wand->signature == WandSignature);
1105 if (wand->debug != MagickFalse)
1106 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1107 (void) MvgPrintf(wand,"color %g %g '%s'\n",x,y,CommandOptionToMnemonic(
1108 MagickMethodOptions,(ssize_t) paint_method));
1112 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1116 % D r a w C o m m e n t %
1120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1122 % DrawComment() adds a comment to a vector output stream.
1124 % The format of the DrawComment method is:
1126 % void DrawComment(DrawingWand *wand,const char *comment)
1128 % A description of each parameter follows:
1130 % o wand: the drawing wand.
1132 % o comment: comment text
1135 WandExport void DrawComment(DrawingWand *wand,const char *comment)
1137 (void) MvgPrintf(wand,"#%s\n",comment);
1141 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1145 % D r a w E l l i p s e %
1149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1151 % DrawEllipse() draws an ellipse on the image.
1153 % The format of the DrawEllipse method is:
1155 % void DrawEllipse(DrawingWand *wand,const double ox,const double oy,
1156 % const double rx,const double ry,const double start,const double end)
1158 % A description of each parameter follows:
1160 % o wand: the drawing wand.
1162 % o ox: origin x ordinate
1164 % o oy: origin y ordinate
1170 % o start: starting rotation in degrees
1172 % o end: ending rotation in degrees
1175 WandExport void DrawEllipse(DrawingWand *wand,const double ox,const double oy,
1176 const double rx,const double ry,const double start,const double end)
1178 assert(wand != (DrawingWand *) NULL);
1179 assert(wand->signature == WandSignature);
1180 if (wand->debug != MagickFalse)
1181 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1182 (void) MvgPrintf(wand,"ellipse %g %g %g %g %g %g\n",ox,oy,
1187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1191 % D r a w G e t B o r d e r C o l o r %
1195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1197 % DrawGetBorderColor() returns the border color used for drawing bordered
1200 % The format of the DrawGetBorderColor method is:
1202 % void DrawGetBorderColor(const DrawingWand *wand,
1203 % PixelWand *border_color)
1205 % A description of each parameter follows:
1207 % o wand: the drawing wand.
1209 % o border_color: Return the border color.
1212 WandExport void DrawGetBorderColor(const DrawingWand *wand,
1213 PixelWand *border_color)
1215 assert(wand != (const DrawingWand *) NULL);
1216 assert(wand->signature == WandSignature);
1217 assert(border_color != (PixelWand *) NULL);
1218 if (wand->debug != MagickFalse)
1219 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1220 PixelSetQuantumPacket(border_color,&CurrentContext->border_color);
1224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1228 % D r a w G e t C l i p P a t h %
1232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1234 % DrawGetClipPath() obtains the current clipping path ID. The value returned
1235 % must be deallocated by the user when it is no longer needed.
1237 % The format of the DrawGetClipPath method is:
1239 % char *DrawGetClipPath(const DrawingWand *wand)
1241 % A description of each parameter follows:
1243 % o wand: the drawing wand.
1246 WandExport char *DrawGetClipPath(const DrawingWand *wand)
1248 assert(wand != (const DrawingWand *) NULL);
1249 assert(wand->signature == WandSignature);
1250 if (wand->debug != MagickFalse)
1251 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1252 if (CurrentContext->clip_mask != (char *) NULL)
1253 return((char *) AcquireString(CurrentContext->clip_mask));
1254 return((char *) NULL);
1258 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1262 % D r a w G e t C l i p R u l e %
1266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1268 % DrawGetClipRule() returns the current polygon fill rule to be used by the
1271 % The format of the DrawGetClipRule method is:
1273 % FillRule DrawGetClipRule(const DrawingWand *wand)
1275 % A description of each parameter follows:
1277 % o wand: the drawing wand.
1280 WandExport FillRule DrawGetClipRule(const DrawingWand *wand)
1282 assert(wand != (const DrawingWand *) NULL);
1283 assert(wand->signature == WandSignature);
1284 if (wand->debug != MagickFalse)
1285 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1286 return(CurrentContext->fill_rule);
1290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1294 % D r a w G e t C l i p U n i t s %
1298 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1300 % DrawGetClipUnits() returns the interpretation of clip path units.
1302 % The format of the DrawGetClipUnits method is:
1304 % ClipPathUnits DrawGetClipUnits(const DrawingWand *wand)
1306 % A description of each parameter follows:
1308 % o wand: the drawing wand.
1311 WandExport ClipPathUnits DrawGetClipUnits(const DrawingWand *wand)
1313 assert(wand != (const DrawingWand *) NULL);
1314 assert(wand->signature == WandSignature);
1315 if (wand->debug != MagickFalse)
1316 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1317 return(CurrentContext->clip_units);
1321 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1325 % D r a w G e t E x c e p t i o n %
1329 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1331 % DrawGetException() returns the severity, reason, and description of any
1332 % error that occurs when using other methods in this API.
1334 % The format of the DrawGetException method is:
1336 % char *DrawGetException(const DrawWand *wand,
1337 % ExceptionType *severity)
1339 % A description of each parameter follows:
1341 % o wand: the drawing wand.
1343 % o severity: the severity of the error is returned here.
1346 WandExport char *DrawGetException(const DrawingWand *wand,
1347 ExceptionType *severity)
1352 assert(wand != (const DrawingWand *) NULL);
1353 assert(wand->signature == WandSignature);
1354 if (wand->debug != MagickFalse)
1355 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1356 assert(severity != (ExceptionType *) NULL);
1357 *severity=wand->exception->severity;
1358 description=(char *) AcquireQuantumMemory(2UL*MaxTextExtent,
1359 sizeof(*description));
1360 if (description == (char *) NULL)
1361 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
1364 if (wand->exception->reason != (char *) NULL)
1365 (void) CopyMagickString(description,GetLocaleExceptionMessage(
1366 wand->exception->severity,wand->exception->reason),
1368 if (wand->exception->description != (char *) NULL)
1370 (void) ConcatenateMagickString(description," (",MaxTextExtent);
1371 (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
1372 wand->exception->severity,wand->exception->description),
1374 (void) ConcatenateMagickString(description,")",MaxTextExtent);
1376 return(description);
1380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1384 % P i x e l G e t E x c e p t i o n T y p e %
1388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1390 % DrawGetExceptionType() the exception type associated with the wand. If
1391 % no exception has occurred, UndefinedExceptionType is returned.
1393 % The format of the DrawGetExceptionType method is:
1395 % ExceptionType DrawGetExceptionType(const DrawWand *wand)
1397 % A description of each parameter follows:
1399 % o wand: the magick wand.
1402 WandExport ExceptionType DrawGetExceptionType(const DrawingWand *wand)
1404 assert(wand != (const DrawingWand *) NULL);
1405 assert(wand->signature == WandSignature);
1406 if (wand->debug != MagickFalse)
1407 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1408 return(wand->exception->severity);
1412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1416 % D r a w G e t F i l l C o l o r %
1420 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1422 % DrawGetFillColor() returns the fill color used for drawing filled objects.
1424 % The format of the DrawGetFillColor method is:
1426 % void DrawGetFillColor(const DrawingWand *wand,
1427 % PixelWand *fill_color)
1429 % A description of each parameter follows:
1431 % o wand: the drawing wand.
1433 % o fill_color: Return the fill color.
1436 WandExport void DrawGetFillColor(const DrawingWand *wand,PixelWand *fill_color)
1438 assert(wand != (const DrawingWand *) NULL);
1439 assert(wand->signature == WandSignature);
1440 assert(fill_color != (PixelWand *) NULL);
1441 if (wand->debug != MagickFalse)
1442 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1443 PixelSetQuantumPacket(fill_color,&CurrentContext->fill);
1447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1451 % D r a w G e t F i l l O p a c i t y %
1455 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1457 % DrawGetFillOpacity() returns the opacity used when drawing using the fill
1458 % color or fill texture. Fully opaque is 1.0.
1460 % The format of the DrawGetFillOpacity method is:
1462 % double DrawGetFillOpacity(const DrawingWand *wand)
1464 % A description of each parameter follows:
1466 % o wand: the drawing wand.
1469 WandExport double DrawGetFillOpacity(const DrawingWand *wand)
1474 assert(wand != (const DrawingWand *) NULL);
1475 assert(wand->signature == WandSignature);
1476 if (wand->debug != MagickFalse)
1477 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1478 alpha=(double) QuantumScale*CurrentContext->fill.alpha;
1483 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1487 % D r a w G e t F i l l R u l e %
1491 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1493 % DrawGetFillRule() returns the fill rule used while drawing polygons.
1495 % The format of the DrawGetFillRule method is:
1497 % FillRule DrawGetFillRule(const DrawingWand *wand)
1499 % A description of each parameter follows:
1501 % o wand: the drawing wand.
1504 WandExport FillRule DrawGetFillRule(const DrawingWand *wand)
1506 assert(wand != (const DrawingWand *) NULL);
1507 assert(wand->signature == WandSignature);
1508 if (wand->debug != MagickFalse)
1509 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1510 return(CurrentContext->fill_rule);
1514 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1518 % D r a w G e t F o n t %
1522 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1524 % DrawGetFont() returns a null-terminaged string specifying the font used
1525 % when annotating with text. The value returned must be freed by the user
1526 % when no longer needed.
1528 % The format of the DrawGetFont method is:
1530 % char *DrawGetFont(const DrawingWand *wand)
1532 % A description of each parameter follows:
1534 % o wand: the drawing wand.
1537 WandExport char *DrawGetFont(const DrawingWand *wand)
1539 assert(wand != (const DrawingWand *) NULL);
1540 assert(wand->signature == WandSignature);
1541 if (wand->debug != MagickFalse)
1542 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1543 if (CurrentContext->font != (char *) NULL)
1544 return(AcquireString(CurrentContext->font));
1545 return((char *) NULL);
1549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1553 % D r a w G e t F o n t F a m i l y %
1557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1559 % DrawGetFontFamily() returns the font family to use when annotating with text.
1560 % The value returned must be freed by the user when it is no longer needed.
1562 % The format of the DrawGetFontFamily method is:
1564 % char *DrawGetFontFamily(const DrawingWand *wand)
1566 % A description of each parameter follows:
1568 % o wand: the drawing wand.
1571 WandExport char *DrawGetFontFamily(const DrawingWand *wand)
1573 assert(wand != (const DrawingWand *) NULL);
1574 assert(wand->signature == WandSignature);
1575 if (wand->debug != MagickFalse)
1576 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1577 if (CurrentContext->family != NULL)
1578 return(AcquireString(CurrentContext->family));
1579 return((char *) NULL);
1583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1587 % D r a w G e t F o n t R e s o l u t i o n %
1591 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1593 % DrawGetFontResolution() gets the image X and Y resolution.
1595 % The format of the DrawGetFontResolution method is:
1597 % DrawBooleanType DrawGetFontResolution(const DrawingWand *wand,
1598 % double *x,double *y)
1600 % A description of each parameter follows:
1602 % o wand: the magick wand.
1604 % o x: the x-resolution.
1606 % o y: the y-resolution.
1609 WandExport MagickBooleanType DrawGetFontResolution(const DrawingWand *wand,
1610 double *x,double *y)
1612 assert(wand != (DrawingWand *) NULL);
1613 assert(wand->signature == WandSignature);
1614 if (wand->debug != MagickFalse)
1615 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1618 if (CurrentContext->density != (char *) NULL)
1626 flags=ParseGeometry(CurrentContext->density,&geometry_info);
1627 *x=geometry_info.rho;
1628 *y=geometry_info.sigma;
1629 if ((flags & SigmaValue) == MagickFalse)
1636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1640 % D r a w G e t F o n t S i z e %
1644 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1646 % DrawGetFontSize() returns the font pointsize used when annotating with text.
1648 % The format of the DrawGetFontSize method is:
1650 % double DrawGetFontSize(const DrawingWand *wand)
1652 % A description of each parameter follows:
1654 % o wand: the drawing wand.
1657 WandExport double DrawGetFontSize(const DrawingWand *wand)
1659 assert(wand != (const DrawingWand *) NULL);
1660 assert(wand->signature == WandSignature);
1661 if (wand->debug != MagickFalse)
1662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1663 return(CurrentContext->pointsize);
1667 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1671 % D r a w G e t F o n t S t r e t c h %
1675 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1677 % DrawGetFontStretch() returns the font stretch used when annotating with text.
1679 % The format of the DrawGetFontStretch method is:
1681 % StretchType DrawGetFontStretch(const DrawingWand *wand)
1683 % A description of each parameter follows:
1685 % o wand: the drawing wand.
1688 WandExport StretchType DrawGetFontStretch(const DrawingWand *wand)
1690 assert(wand != (const DrawingWand *) NULL);
1691 assert(wand->signature == WandSignature);
1692 if (wand->debug != MagickFalse)
1693 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1694 return(CurrentContext->stretch);
1698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1702 % D r a w G e t F o n t S t y l e %
1706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1708 % DrawGetFontStyle() returns the font style used when annotating with text.
1710 % The format of the DrawGetFontStyle method is:
1712 % StyleType DrawGetFontStyle(const DrawingWand *wand)
1714 % A description of each parameter follows:
1716 % o wand: the drawing wand.
1719 WandExport StyleType DrawGetFontStyle(const DrawingWand *wand)
1721 assert(wand != (const DrawingWand *) NULL);
1722 assert(wand->signature == WandSignature);
1723 if (wand->debug != MagickFalse)
1724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1725 return(CurrentContext->style);
1729 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1733 % D r a w G e t F o n t W e i g h t %
1737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1739 % DrawGetFontWeight() returns the font weight used when annotating with text.
1741 % The format of the DrawGetFontWeight method is:
1743 % size_t DrawGetFontWeight(const DrawingWand *wand)
1745 % A description of each parameter follows:
1747 % o wand: the drawing wand.
1750 WandExport size_t DrawGetFontWeight(const DrawingWand *wand)
1752 assert(wand != (const DrawingWand *) NULL);
1753 assert(wand->signature == WandSignature);
1754 if (wand->debug != MagickFalse)
1755 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1756 return(CurrentContext->weight);
1760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1764 % D r a w G e t G r a v i t y %
1768 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1770 % DrawGetGravity() returns the text placement gravity used when annotating
1773 % The format of the DrawGetGravity method is:
1775 % GravityType DrawGetGravity(const DrawingWand *wand)
1777 % A description of each parameter follows:
1779 % o wand: the drawing wand.
1782 WandExport GravityType DrawGetGravity(const DrawingWand *wand)
1784 assert(wand != (const DrawingWand *) NULL);
1785 assert(wand->signature == WandSignature);
1786 if (wand->debug != MagickFalse)
1787 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1788 return(CurrentContext->gravity);
1792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1796 % D r a w G e t O p a c i t y %
1800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1802 % DrawGetOpacity() returns the opacity used when drawing with the fill
1803 % or stroke color or texture. Fully opaque is 1.0.
1805 % The format of the DrawGetOpacity method is:
1807 % double DrawGetOpacity(const DrawingWand *wand)
1809 % A description of each parameter follows:
1811 % o wand: the drawing wand.
1814 WandExport double DrawGetOpacity(const DrawingWand *wand)
1819 assert(wand != (const DrawingWand *) NULL);
1820 assert(wand->signature == WandSignature);
1821 if (wand->debug != MagickFalse)
1822 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1823 alpha=(double) QuantumScale*CurrentContext->alpha;
1828 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1832 % D r a w G e t S t r o k e A n t i a l i a s %
1836 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1838 % DrawGetStrokeAntialias() returns the current stroke antialias setting.
1839 % Stroked outlines are antialiased by default. When antialiasing is disabled
1840 % stroked pixels are thresholded to determine if the stroke color or
1841 % underlying canvas color should be used.
1843 % The format of the DrawGetStrokeAntialias method is:
1845 % MagickBooleanType DrawGetStrokeAntialias(const DrawingWand *wand)
1847 % A description of each parameter follows:
1849 % o wand: the drawing wand.
1852 WandExport MagickBooleanType DrawGetStrokeAntialias(const DrawingWand *wand)
1854 assert(wand != (const DrawingWand *) NULL);
1855 assert(wand->signature == WandSignature);
1856 if (wand->debug != MagickFalse)
1857 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1858 return(CurrentContext->stroke_antialias);
1862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1866 % D r a w G e t S t r o k e C o l o r %
1870 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1872 % DrawGetStrokeColor() returns the color used for stroking object outlines.
1874 % The format of the DrawGetStrokeColor method is:
1876 % void DrawGetStrokeColor(const DrawingWand *wand,
1877 $ PixelWand *stroke_color)
1879 % A description of each parameter follows:
1881 % o wand: the drawing wand.
1883 % o stroke_color: Return the stroke color.
1886 WandExport void DrawGetStrokeColor(const DrawingWand *wand,
1887 PixelWand *stroke_color)
1889 assert(wand != (const DrawingWand *) NULL);
1890 assert(wand->signature == WandSignature);
1891 assert(stroke_color != (PixelWand *) NULL);
1892 if (wand->debug != MagickFalse)
1893 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1894 PixelSetQuantumPacket(stroke_color,&CurrentContext->stroke);
1898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1902 % D r a w G e t S t r o k e D a s h A r r a y %
1906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1908 % DrawGetStrokeDashArray() returns an array representing the pattern of
1909 % dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The
1910 % array must be freed once it is no longer required by the user.
1912 % The format of the DrawGetStrokeDashArray method is:
1914 % double *DrawGetStrokeDashArray(const DrawingWand *wand,
1915 % size_t *number_elements)
1917 % A description of each parameter follows:
1919 % o wand: the drawing wand.
1921 % o number_elements: address to place number of elements in dash array
1924 WandExport double *DrawGetStrokeDashArray(const DrawingWand *wand,
1925 size_t *number_elements)
1930 register const double
1942 assert(wand != (const DrawingWand *) NULL);
1943 assert(wand->signature == WandSignature);
1944 if (wand->debug != MagickFalse)
1945 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1946 assert(number_elements != (size_t *) NULL);
1948 p=CurrentContext->dash_pattern;
1949 if (p != (const double *) NULL)
1953 dash_array=(double *) NULL;
1956 dash_array=(double *) AcquireQuantumMemory((size_t) n,
1957 sizeof(*dash_array));
1958 p=CurrentContext->dash_pattern;
1960 for (i=0; i < (ssize_t) n; i++)
1967 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1971 % D r a w G e t S t r o k e D a s h O f f s e t %
1975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1977 % DrawGetStrokeDashOffset() returns the offset into the dash pattern to
1980 % The format of the DrawGetStrokeDashOffset method is:
1982 % double DrawGetStrokeDashOffset(const DrawingWand *wand)
1984 % A description of each parameter follows:
1986 % o wand: the drawing wand.
1989 WandExport double DrawGetStrokeDashOffset(const DrawingWand *wand)
1991 assert(wand != (const DrawingWand *) NULL);
1992 assert(wand->signature == WandSignature);
1993 if (wand->debug != MagickFalse)
1994 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
1995 return(CurrentContext->dash_offset);
1999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2003 % D r a w G e t S t r o k e L i n e C a p %
2007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2009 % DrawGetStrokeLineCap() returns the shape to be used at the end of
2010 % open subpaths when they are stroked. Values of LineCap are
2011 % UndefinedCap, ButtCap, RoundCap, and SquareCap.
2013 % The format of the DrawGetStrokeLineCap method is:
2015 % LineCap DrawGetStrokeLineCap(const DrawingWand *wand)
2017 % A description of each parameter follows:
2019 % o wand: the drawing wand.
2022 WandExport LineCap DrawGetStrokeLineCap(const DrawingWand *wand)
2024 assert(wand != (const DrawingWand *) NULL);
2025 assert(wand->signature == WandSignature);
2026 if (wand->debug != MagickFalse)
2027 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2028 return(CurrentContext->linecap);
2032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2036 % D r a w G e t S t r o k e L i n e J o i n %
2040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2042 % DrawGetStrokeLineJoin() returns the shape to be used at the
2043 % corners of paths (or other vector shapes) when they are
2044 % stroked. Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin,
2047 % The format of the DrawGetStrokeLineJoin method is:
2049 % LineJoin DrawGetStrokeLineJoin(const DrawingWand *wand)
2051 % A description of each parameter follows:
2053 % o wand: the drawing wand.
2056 WandExport LineJoin DrawGetStrokeLineJoin(const DrawingWand *wand)
2058 assert(wand != (const DrawingWand *) NULL);
2059 assert(wand->signature == WandSignature);
2060 if (wand->debug != MagickFalse)
2061 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2062 return(CurrentContext->linejoin);
2066 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2070 % D r a w G e t S t r o k e M i t e r L i m i t %
2074 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2076 % DrawGetStrokeMiterLimit() returns the miter limit. When two line
2077 % segments meet at a sharp angle and miter joins have been specified for
2078 % 'lineJoin', it is possible for the miter to extend far beyond the
2079 % thickness of the line stroking the path. The miterLimit' imposes a
2080 % limit on the ratio of the miter length to the 'lineWidth'.
2082 % The format of the DrawGetStrokeMiterLimit method is:
2084 % size_t DrawGetStrokeMiterLimit(const DrawingWand *wand)
2086 % A description of each parameter follows:
2088 % o wand: the drawing wand.
2091 WandExport size_t DrawGetStrokeMiterLimit(const DrawingWand *wand)
2093 assert(wand != (const DrawingWand *) NULL);
2094 assert(wand->signature == WandSignature);
2095 if (wand->debug != MagickFalse)
2096 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2097 return CurrentContext->miterlimit;
2101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2105 % D r a w G e t S t r o k e O p a c i t y %
2109 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2111 % DrawGetStrokeOpacity() returns the opacity of stroked object outlines.
2113 % The format of the DrawGetStrokeOpacity method is:
2115 % double DrawGetStrokeOpacity(const DrawingWand *wand)
2117 % A description of each parameter follows:
2119 % o wand: the drawing wand.
2122 WandExport double DrawGetStrokeOpacity(const DrawingWand *wand)
2127 assert(wand != (const DrawingWand *) NULL);
2128 assert(wand->signature == WandSignature);
2129 if (wand->debug != MagickFalse)
2130 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2131 alpha=(double) QuantumScale*CurrentContext->stroke.alpha;
2136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2140 % D r a w G e t S t r o k e W i d t h %
2144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2146 % DrawGetStrokeWidth() returns the width of the stroke used to draw object
2149 % The format of the DrawGetStrokeWidth method is:
2151 % double DrawGetStrokeWidth(const DrawingWand *wand)
2153 % A description of each parameter follows:
2155 % o wand: the drawing wand.
2158 WandExport double DrawGetStrokeWidth(const DrawingWand *wand)
2160 assert(wand != (const DrawingWand *) NULL);
2161 assert(wand->signature == WandSignature);
2162 if (wand->debug != MagickFalse)
2163 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2164 return(CurrentContext->stroke_width);
2168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2172 % D r a w G e t T e x t A l i g n m e n t %
2176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2178 % DrawGetTextAlignment() returns the alignment applied when annotating with
2181 % The format of the DrawGetTextAlignment method is:
2183 % AlignType DrawGetTextAlignment(DrawingWand *wand)
2185 % A description of each parameter follows:
2187 % o wand: the drawing wand.
2190 WandExport AlignType DrawGetTextAlignment(const DrawingWand *wand)
2192 assert(wand != (const DrawingWand *) NULL);
2193 assert(wand->signature == WandSignature);
2194 if (wand->debug != MagickFalse)
2195 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2196 return(CurrentContext->align);
2200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2204 % D r a w G e t T e x t A n t i a l i a s %
2208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2210 % DrawGetTextAntialias() returns the current text antialias setting, which
2211 % determines whether text is antialiased. Text is antialiased by default.
2213 % The format of the DrawGetTextAntialias method is:
2215 % MagickBooleanType DrawGetTextAntialias(const DrawingWand *wand)
2217 % A description of each parameter follows:
2219 % o wand: the drawing wand.
2222 WandExport MagickBooleanType DrawGetTextAntialias(const DrawingWand *wand)
2224 assert(wand != (const DrawingWand *) NULL);
2225 assert(wand->signature == WandSignature);
2226 if (wand->debug != MagickFalse)
2227 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2228 return(CurrentContext->text_antialias);
2232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2236 % D r a w G e t T e x t D e c o r a t i o n %
2240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2242 % DrawGetTextDecoration() returns the decoration applied when annotating with
2245 % The format of the DrawGetTextDecoration method is:
2247 % DecorationType DrawGetTextDecoration(DrawingWand *wand)
2249 % A description of each parameter follows:
2251 % o wand: the drawing wand.
2254 WandExport DecorationType DrawGetTextDecoration(const DrawingWand *wand)
2256 assert(wand != (const DrawingWand *) NULL);
2257 assert(wand->signature == WandSignature);
2258 if (wand->debug != MagickFalse)
2259 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2260 return(CurrentContext->decorate);
2264 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2268 % D r a w G e t T e x t E n c o d i n g %
2272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2274 % DrawGetTextEncoding() returns a null-terminated string which specifies the
2275 % code set used for text annotations. The string must be freed by the user
2276 % once it is no longer required.
2278 % The format of the DrawGetTextEncoding method is:
2280 % char *DrawGetTextEncoding(const DrawingWand *wand)
2282 % A description of each parameter follows:
2284 % o wand: the drawing wand.
2287 WandExport char *DrawGetTextEncoding(const DrawingWand *wand)
2289 assert(wand != (const DrawingWand *) NULL);
2290 assert(wand->signature == WandSignature);
2291 if (wand->debug != MagickFalse)
2292 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2293 if (CurrentContext->encoding != (char *) NULL)
2294 return((char *) AcquireString(CurrentContext->encoding));
2295 return((char *) NULL);
2299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2303 % D r a w G e t T e x t K e r n i n g %
2307 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2309 % DrawGetTextKerning() gets the spacing between characters in text.
2311 % The format of the DrawSetFontKerning method is:
2313 % double DrawGetTextKerning(DrawingWand *wand)
2315 % A description of each parameter follows:
2317 % o wand: the drawing wand.
2320 WandExport double DrawGetTextKerning(DrawingWand *wand)
2322 assert(wand != (DrawingWand *) NULL);
2323 assert(wand->signature == WandSignature);
2325 if (wand->debug != MagickFalse)
2326 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2327 return(CurrentContext->kerning);
2331 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2335 % D r a w G e t T e x t I n t e r L i n e S p a c i n g %
2339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2341 % DrawGetTextInterwordSpacing() gets the spacing between lines in text.
2343 % The format of the DrawSetFontKerning method is:
2345 % double DrawGetTextInterwordSpacing(DrawingWand *wand)
2347 % A description of each parameter follows:
2349 % o wand: the drawing wand.
2352 WandExport double DrawGetTextInterlineSpacing(DrawingWand *wand)
2354 assert(wand != (DrawingWand *) NULL);
2355 assert(wand->signature == WandSignature);
2356 if (wand->debug != MagickFalse)
2357 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2358 return(CurrentContext->interline_spacing);
2362 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2366 % D r a w G e t T e x t I n t e r w o r d S p a c i n g %
2370 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2372 % DrawGetTextInterwordSpacing() gets the spacing between words in text.
2374 % The format of the DrawSetFontKerning method is:
2376 % double DrawGetTextInterwordSpacing(DrawingWand *wand)
2378 % A description of each parameter follows:
2380 % o wand: the drawing wand.
2383 WandExport double DrawGetTextInterwordSpacing(DrawingWand *wand)
2385 assert(wand != (DrawingWand *) NULL);
2386 assert(wand->signature == WandSignature);
2387 if (wand->debug != MagickFalse)
2388 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2389 return(CurrentContext->interword_spacing);
2393 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2397 % D r a w G e t V e c t o r G r a p h i c s %
2401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2403 % DrawGetVectorGraphics() returns a null-terminated string which specifies the
2404 % vector graphics generated by any graphics calls made since the wand was
2405 % instantiated. The string must be freed by the user once it is no longer
2408 % The format of the DrawGetVectorGraphics method is:
2410 % char *DrawGetVectorGraphics(const DrawingWand *wand)
2412 % A description of each parameter follows:
2414 % o wand: the drawing wand.
2417 WandExport char *DrawGetVectorGraphics(DrawingWand *wand)
2420 value[MaxTextExtent],
2433 assert(wand != (const DrawingWand *) NULL);
2434 assert(wand->signature == WandSignature);
2435 if (wand->debug != MagickFalse)
2436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2437 xml_info=NewXMLTreeTag("drawing-wand");
2438 if (xml_info == (XMLTreeInfo *) NULL)
2439 return(char *) NULL;
2440 GetPixelInfo(wand->image,&pixel);
2441 child=AddChildToXMLTree(xml_info,"clip-path",0);
2442 if (child != (XMLTreeInfo *) NULL)
2443 (void) SetXMLTreeContent(child,CurrentContext->clip_mask);
2444 child=AddChildToXMLTree(xml_info,"clip-units",0);
2445 if (child != (XMLTreeInfo *) NULL)
2447 (void) CopyMagickString(value,CommandOptionToMnemonic(
2448 MagickClipPathOptions,(ssize_t) CurrentContext->clip_units),
2450 (void) SetXMLTreeContent(child,value);
2452 child=AddChildToXMLTree(xml_info,"decorate",0);
2453 if (child != (XMLTreeInfo *) NULL)
2455 (void) CopyMagickString(value,CommandOptionToMnemonic(
2456 MagickDecorateOptions,(ssize_t) CurrentContext->decorate),
2458 (void) SetXMLTreeContent(child,value);
2460 child=AddChildToXMLTree(xml_info,"encoding",0);
2461 if (child != (XMLTreeInfo *) NULL)
2462 (void) SetXMLTreeContent(child,CurrentContext->encoding);
2463 child=AddChildToXMLTree(xml_info,"fill",0);
2464 if (child != (XMLTreeInfo *) NULL)
2466 if (CurrentContext->fill.alpha != OpaqueAlpha)
2467 pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ?
2468 MagickTrue : MagickFalse;
2469 SetPixelInfoPacket(wand->image,&CurrentContext->fill,&pixel);
2470 GetColorTuple(&pixel,MagickTrue,value);
2471 (void) SetXMLTreeContent(child,value);
2473 child=AddChildToXMLTree(xml_info,"fill-opacity",0);
2474 if (child != (XMLTreeInfo *) NULL)
2476 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2477 (double) QuantumScale*CurrentContext->fill.alpha);
2478 (void) SetXMLTreeContent(child,value);
2480 child=AddChildToXMLTree(xml_info,"fill-rule",0);
2481 if (child != (XMLTreeInfo *) NULL)
2483 (void) CopyMagickString(value,CommandOptionToMnemonic(
2484 MagickFillRuleOptions,(ssize_t) CurrentContext->fill_rule),
2486 (void) SetXMLTreeContent(child,value);
2488 child=AddChildToXMLTree(xml_info,"font",0);
2489 if (child != (XMLTreeInfo *) NULL)
2490 (void) SetXMLTreeContent(child,CurrentContext->font);
2491 child=AddChildToXMLTree(xml_info,"font-family",0);
2492 if (child != (XMLTreeInfo *) NULL)
2493 (void) SetXMLTreeContent(child,CurrentContext->family);
2494 child=AddChildToXMLTree(xml_info,"font-size",0);
2495 if (child != (XMLTreeInfo *) NULL)
2497 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2498 CurrentContext->pointsize);
2499 (void) SetXMLTreeContent(child,value);
2501 child=AddChildToXMLTree(xml_info,"font-stretch",0);
2502 if (child != (XMLTreeInfo *) NULL)
2504 (void) CopyMagickString(value,CommandOptionToMnemonic(
2505 MagickStretchOptions,(ssize_t) CurrentContext->stretch),MaxTextExtent);
2506 (void) SetXMLTreeContent(child,value);
2508 child=AddChildToXMLTree(xml_info,"font-style",0);
2509 if (child != (XMLTreeInfo *) NULL)
2511 (void) CopyMagickString(value,CommandOptionToMnemonic(
2512 MagickStyleOptions,(ssize_t) CurrentContext->style),MaxTextExtent);
2513 (void) SetXMLTreeContent(child,value);
2515 child=AddChildToXMLTree(xml_info,"font-weight",0);
2516 if (child != (XMLTreeInfo *) NULL)
2518 (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
2519 CurrentContext->weight);
2520 (void) SetXMLTreeContent(child,value);
2522 child=AddChildToXMLTree(xml_info,"gravity",0);
2523 if (child != (XMLTreeInfo *) NULL)
2525 (void) CopyMagickString(value,CommandOptionToMnemonic(
2526 MagickGravityOptions,(ssize_t) CurrentContext->gravity),MaxTextExtent);
2527 (void) SetXMLTreeContent(child,value);
2529 child=AddChildToXMLTree(xml_info,"stroke",0);
2530 if (child != (XMLTreeInfo *) NULL)
2532 if (CurrentContext->stroke.alpha != OpaqueAlpha)
2533 pixel.matte=CurrentContext->stroke.alpha != OpaqueAlpha ?
2534 MagickTrue : MagickFalse;
2535 SetPixelInfoPacket(wand->image,&CurrentContext->stroke,&pixel);
2536 GetColorTuple(&pixel,MagickTrue,value);
2537 (void) SetXMLTreeContent(child,value);
2539 child=AddChildToXMLTree(xml_info,"stroke-antialias",0);
2540 if (child != (XMLTreeInfo *) NULL)
2542 (void) FormatLocaleString(value,MaxTextExtent,"%d",
2543 CurrentContext->stroke_antialias != MagickFalse ? 1 : 0);
2544 (void) SetXMLTreeContent(child,value);
2546 child=AddChildToXMLTree(xml_info,"stroke-dasharray",0);
2547 if ((child != (XMLTreeInfo *) NULL) &&
2548 (CurrentContext->dash_pattern != (double *) NULL))
2553 dash_pattern=AcquireString((char *) NULL);
2554 for (i=0; CurrentContext->dash_pattern[i] != 0.0; i++)
2557 (void) ConcatenateString(&dash_pattern,",");
2558 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2559 CurrentContext->dash_pattern[i]);
2560 (void) ConcatenateString(&dash_pattern,value);
2562 (void) SetXMLTreeContent(child,dash_pattern);
2563 dash_pattern=DestroyString(dash_pattern);
2565 child=AddChildToXMLTree(xml_info,"stroke-dashoffset",0);
2566 if (child != (XMLTreeInfo *) NULL)
2568 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2569 CurrentContext->dash_offset);
2570 (void) SetXMLTreeContent(child,value);
2572 child=AddChildToXMLTree(xml_info,"stroke-linecap",0);
2573 if (child != (XMLTreeInfo *) NULL)
2575 (void) CopyMagickString(value,CommandOptionToMnemonic(MagickLineCapOptions,
2576 (ssize_t) CurrentContext->linecap),MaxTextExtent);
2577 (void) SetXMLTreeContent(child,value);
2579 child=AddChildToXMLTree(xml_info,"stroke-linejoin",0);
2580 if (child != (XMLTreeInfo *) NULL)
2582 (void) CopyMagickString(value,CommandOptionToMnemonic(
2583 MagickLineJoinOptions,(ssize_t) CurrentContext->linejoin),
2585 (void) SetXMLTreeContent(child,value);
2587 child=AddChildToXMLTree(xml_info,"stroke-miterlimit",0);
2588 if (child != (XMLTreeInfo *) NULL)
2590 (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
2591 CurrentContext->miterlimit);
2592 (void) SetXMLTreeContent(child,value);
2594 child=AddChildToXMLTree(xml_info,"stroke-opacity",0);
2595 if (child != (XMLTreeInfo *) NULL)
2597 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2598 (double) QuantumScale*CurrentContext->stroke.alpha);
2599 (void) SetXMLTreeContent(child,value);
2601 child=AddChildToXMLTree(xml_info,"stroke-width",0);
2602 if (child != (XMLTreeInfo *) NULL)
2604 (void) FormatLocaleString(value,MaxTextExtent,"%g",
2605 CurrentContext->stroke_width);
2606 (void) SetXMLTreeContent(child,value);
2608 child=AddChildToXMLTree(xml_info,"text-align",0);
2609 if (child != (XMLTreeInfo *) NULL)
2611 (void) CopyMagickString(value,CommandOptionToMnemonic(MagickAlignOptions,
2612 (ssize_t) CurrentContext->align),MaxTextExtent);
2613 (void) SetXMLTreeContent(child,value);
2615 child=AddChildToXMLTree(xml_info,"text-antialias",0);
2616 if (child != (XMLTreeInfo *) NULL)
2618 (void) FormatLocaleString(value,MaxTextExtent,"%d",
2619 CurrentContext->text_antialias != MagickFalse ? 1 : 0);
2620 (void) SetXMLTreeContent(child,value);
2622 child=AddChildToXMLTree(xml_info,"text-undercolor",0);
2623 if (child != (XMLTreeInfo *) NULL)
2625 if (CurrentContext->undercolor.alpha != OpaqueAlpha)
2626 pixel.matte=CurrentContext->undercolor.alpha != OpaqueAlpha ?
2627 MagickTrue : MagickFalse;
2628 SetPixelInfoPacket(wand->image,&CurrentContext->undercolor,&pixel);
2629 GetColorTuple(&pixel,MagickTrue,value);
2630 (void) SetXMLTreeContent(child,value);
2632 child=AddChildToXMLTree(xml_info,"vector-graphics",0);
2633 if (child != (XMLTreeInfo *) NULL)
2634 (void) SetXMLTreeContent(child,wand->mvg);
2635 xml=XMLTreeInfoToXML(xml_info);
2636 xml_info=DestroyXMLTree(xml_info);
2641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2645 % D r a w G e t T e x t U n d e r C o l o r %
2649 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2651 % DrawGetTextUnderColor() returns the color of a background rectangle
2652 % to place under text annotations.
2654 % The format of the DrawGetTextUnderColor method is:
2656 % void DrawGetTextUnderColor(const DrawingWand *wand,
2657 % PixelWand *under_color)
2659 % A description of each parameter follows:
2661 % o wand: the drawing wand.
2663 % o under_color: Return the under color.
2666 WandExport void DrawGetTextUnderColor(const DrawingWand *wand,
2667 PixelWand *under_color)
2669 assert(wand != (const DrawingWand *) NULL);
2670 assert(wand->signature == WandSignature);
2671 assert(under_color != (PixelWand *) NULL);
2672 if (wand->debug != MagickFalse)
2673 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2674 PixelSetQuantumPacket(under_color,&CurrentContext->undercolor);
2678 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2688 % DrawLine() draws a line on the image using the current stroke color,
2689 % stroke opacity, and stroke width.
2691 % The format of the DrawLine method is:
2693 % void DrawLine(DrawingWand *wand,const double sx,const double sy,
2694 % const double ex,const double ey)
2696 % A description of each parameter follows:
2698 % o wand: the drawing wand.
2700 % o sx: starting x ordinate
2702 % o sy: starting y ordinate
2704 % o ex: ending x ordinate
2706 % o ey: ending y ordinate
2709 WandExport void DrawLine(DrawingWand *wand,const double sx,const double sy,
2710 const double ex,const double ey)
2712 assert(wand != (DrawingWand *) NULL);
2713 assert(wand->signature == WandSignature);
2714 if (wand->debug != MagickFalse)
2715 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2716 (void) MvgPrintf(wand,"line %g %g %g %g\n",sx,sy,ex,ey);
2720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2724 % D r a w M a t t e %
2728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2730 % DrawMatte() paints on the image's opacity channel in order to set effected
2731 % pixels to transparent.
2732 % to influence the opacity of pixels. The available paint
2735 % PointMethod: Select the target pixel
2736 % ReplaceMethod: Select any pixel that matches the target pixel.
2737 % FloodfillMethod: Select the target pixel and matching neighbors.
2738 % FillToBorderMethod: Select the target pixel and neighbors not matching
2740 % ResetMethod: Select all pixels.
2742 % The format of the DrawMatte method is:
2744 % void DrawMatte(DrawingWand *wand,const double x,const double y,
2745 % const PaintMethod paint_method)
2747 % A description of each parameter follows:
2749 % o wand: the drawing wand.
2755 % o paint_method: paint method.
2758 WandExport void DrawMatte(DrawingWand *wand,const double x,const double y,
2759 const PaintMethod paint_method)
2761 assert(wand != (DrawingWand *) NULL);
2762 assert(wand->signature == WandSignature);
2763 if (wand->debug != MagickFalse)
2764 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2765 (void) MvgPrintf(wand,"matte %g %g '%s'\n",x,y,CommandOptionToMnemonic(
2766 MagickMethodOptions,(ssize_t) paint_method));
2770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2774 % D r a w P a t h C l o s e %
2778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2780 % DrawPathClose() adds a path element to the current path which closes the
2781 % current subpath by drawing a straight line from the current point to the
2782 % current subpath's most recent starting point (usually, the most recent
2785 % The format of the DrawPathClose method is:
2787 % void DrawPathClose(DrawingWand *wand)
2789 % A description of each parameter follows:
2791 % o wand: the drawing wand.
2794 WandExport void DrawPathClose(DrawingWand *wand)
2796 assert(wand != (DrawingWand *) NULL);
2797 assert(wand->signature == WandSignature);
2798 if (wand->debug != MagickFalse)
2799 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2800 (void) MvgAutoWrapPrintf(wand,"%s",wand->path_mode == AbsolutePathMode ?
2805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2809 % D r a w P a t h C u r v e T o A b s o l u t e %
2813 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2815 % DrawPathCurveToAbsolute() draws a cubic Bezier curve from the current
2816 % point to (x,y) using (x1,y1) as the control point at the beginning of
2817 % the curve and (x2,y2) as the control point at the end of the curve using
2818 % absolute coordinates. At the end of the command, the new current point
2819 % becomes the final (x,y) coordinate pair used in the polybezier.
2821 % The format of the DrawPathCurveToAbsolute method is:
2823 % void DrawPathCurveToAbsolute(DrawingWand *wand,const double x1,
2824 % const double y1,const double x2,const double y2,const double x,
2827 % A description of each parameter follows:
2829 % o wand: the drawing wand.
2831 % o x1: x ordinate of control point for curve beginning
2833 % o y1: y ordinate of control point for curve beginning
2835 % o x2: x ordinate of control point for curve ending
2837 % o y2: y ordinate of control point for curve ending
2839 % o x: x ordinate of the end of the curve
2841 % o y: y ordinate of the end of the curve
2845 static void DrawPathCurveTo(DrawingWand *wand,const PathMode mode,
2846 const double x1,const double y1,const double x2,const double y2,
2847 const double x,const double y)
2849 assert(wand != (DrawingWand *) NULL);
2850 assert(wand->signature == WandSignature);
2851 if (wand->debug != MagickFalse)
2852 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2853 if ((wand->path_operation != PathCurveToOperation) ||
2854 (wand->path_mode != mode))
2856 wand->path_operation=PathCurveToOperation;
2857 wand->path_mode=mode;
2858 (void) MvgAutoWrapPrintf(wand, "%c%g %g %g %g %g %g",
2859 mode == AbsolutePathMode ? 'C' : 'c',x1,y1,x2,y2,x,y);
2862 (void) MvgAutoWrapPrintf(wand," %g %g %g %g %g %g",x1,y1,
2866 WandExport void DrawPathCurveToAbsolute(DrawingWand *wand,const double x1,
2867 const double y1,const double x2,const double y2,const double x,const double y)
2869 assert(wand != (DrawingWand *) NULL);
2870 assert(wand->signature == WandSignature);
2871 if (wand->debug != MagickFalse)
2872 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2873 DrawPathCurveTo(wand,AbsolutePathMode,x1,y1,x2,y2,x,y);
2877 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2881 % D r a w P a t h C u r v e T o R e l a t i v e %
2885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2887 % DrawPathCurveToRelative() draws a cubic Bezier curve from the current
2888 % point to (x,y) using (x1,y1) as the control point at the beginning of
2889 % the curve and (x2,y2) as the control point at the end of the curve using
2890 % relative coordinates. At the end of the command, the new current point
2891 % becomes the final (x,y) coordinate pair used in the polybezier.
2893 % The format of the DrawPathCurveToRelative method is:
2895 % void DrawPathCurveToRelative(DrawingWand *wand,const double x1,
2896 % const double y1,const double x2,const double y2,const double x,
2899 % A description of each parameter follows:
2901 % o wand: the drawing wand.
2903 % o x1: x ordinate of control point for curve beginning
2905 % o y1: y ordinate of control point for curve beginning
2907 % o x2: x ordinate of control point for curve ending
2909 % o y2: y ordinate of control point for curve ending
2911 % o x: x ordinate of the end of the curve
2913 % o y: y ordinate of the end of the curve
2916 WandExport void DrawPathCurveToRelative(DrawingWand *wand,const double x1,
2917 const double y1,const double x2,const double y2,const double x,const double y)
2919 assert(wand != (DrawingWand *) NULL);
2920 assert(wand->signature == WandSignature);
2921 if (wand->debug != MagickFalse)
2922 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2923 DrawPathCurveTo(wand,RelativePathMode,x1,y1,x2,y2,x,y);
2927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2931 % D r a w P a t h C u r v e T o Q u a d r a t i c B e z i e r A b s o l u t e %
2935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2937 % DrawPathCurveToQuadraticBezierAbsolute() draws a quadratic Bezier curve
2938 % from the current point to (x,y) using (x1,y1) as the control point using
2939 % absolute coordinates. At the end of the command, the new current point
2940 % becomes the final (x,y) coordinate pair used in the polybezier.
2942 % The format of the DrawPathCurveToQuadraticBezierAbsolute method is:
2944 % void DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *wand,
2945 % const double x1,const double y1,onst double x,const double y)
2947 % A description of each parameter follows:
2949 % o wand: the drawing wand.
2951 % o x1: x ordinate of the control point
2953 % o y1: y ordinate of the control point
2955 % o x: x ordinate of final point
2957 % o y: y ordinate of final point
2961 static void DrawPathCurveToQuadraticBezier(DrawingWand *wand,
2962 const PathMode mode,const double x1,double y1,const double x,const double y)
2964 assert(wand != (DrawingWand *) NULL);
2965 assert(wand->signature == WandSignature);
2966 if (wand->debug != MagickFalse)
2967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2968 if ((wand->path_operation != PathCurveToQuadraticBezierOperation) ||
2969 (wand->path_mode != mode))
2971 wand->path_operation=PathCurveToQuadraticBezierOperation;
2972 wand->path_mode=mode;
2973 (void) MvgAutoWrapPrintf(wand, "%c%g %g %g %g",
2974 mode == AbsolutePathMode ? 'Q' : 'q',x1,y1,x,y);
2977 (void) MvgAutoWrapPrintf(wand," %g %g %g %g",x1,y1,x,y);
2980 WandExport void DrawPathCurveToQuadraticBezierAbsolute(DrawingWand *wand,
2981 const double x1,const double y1,const double x,const double y)
2983 assert(wand != (DrawingWand *) NULL);
2984 assert(wand->signature == WandSignature);
2985 if (wand->debug != MagickFalse)
2986 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
2987 DrawPathCurveToQuadraticBezier(wand,AbsolutePathMode,x1,y1,x,y);
2991 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2995 % D r a w P a t h C u r v e T o Q u a d r a t i c B e z i e r R e l a t i v e
2999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3001 % DrawPathCurveToQuadraticBezierRelative() draws a quadratic Bezier curve
3002 % from the current point to (x,y) using (x1,y1) as the control point using
3003 % relative coordinates. At the end of the command, the new current point
3004 % becomes the final (x,y) coordinate pair used in the polybezier.
3006 % The format of the DrawPathCurveToQuadraticBezierRelative method is:
3008 % void DrawPathCurveToQuadraticBezierRelative(DrawingWand *wand,
3009 % const double x1,const double y1,const double x,const double y)
3011 % A description of each parameter follows:
3013 % o wand: the drawing wand.
3015 % o x1: x ordinate of the control point
3017 % o y1: y ordinate of the control point
3019 % o x: x ordinate of final point
3021 % o y: y ordinate of final point
3024 WandExport void DrawPathCurveToQuadraticBezierRelative(DrawingWand *wand,
3025 const double x1,const double y1,const double x,const double y)
3027 assert(wand != (DrawingWand *) NULL);
3028 assert(wand->signature == WandSignature);
3029 if (wand->debug != MagickFalse)
3030 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3031 DrawPathCurveToQuadraticBezier(wand,RelativePathMode,x1,y1,x,y);
3035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3039 % D r a w P a t h C u r v e T o Q u a d r a t i c B e z i e r S m o o t h %
3043 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3045 % DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic
3046 % Bezier curve (using absolute coordinates) from the current point to
3047 % (x,y). The control point is assumed to be the reflection of the
3048 % control point on the previous command relative to the current
3049 % point. (If there is no previous command or if the previous command was
3050 % not a DrawPathCurveToQuadraticBezierAbsolute,
3051 % DrawPathCurveToQuadraticBezierRelative,
3052 % DrawPathCurveToQuadraticBezierSmoothAbsolute or
3053 % DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point
3054 % is coincident with the current point.). At the end of the command, the
3055 % new current point becomes the final (x,y) coordinate pair used in the
3058 % The format of the DrawPathCurveToQuadraticBezierSmoothAbsolute method is:
3060 % void DrawPathCurveToQuadraticBezierSmoothAbsolute(
3061 % DrawingWand *wand,const double x,const double y)
3063 % A description of each parameter follows:
3065 % o wand: the drawing wand.
3067 % o x: x ordinate of final point
3069 % o y: y ordinate of final point
3073 static void DrawPathCurveToQuadraticBezierSmooth(DrawingWand *wand,
3074 const PathMode mode,const double x,const double y)
3076 assert(wand != (DrawingWand *) NULL);
3077 assert(wand->signature == WandSignature);
3078 if (wand->debug != MagickFalse)
3079 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3080 if ((wand->path_operation != PathCurveToQuadraticBezierSmoothOperation) ||
3081 (wand->path_mode != mode))
3083 wand->path_operation=PathCurveToQuadraticBezierSmoothOperation;
3084 wand->path_mode=mode;
3085 (void) MvgAutoWrapPrintf(wand,"%c%g %g",mode == AbsolutePathMode ?
3089 (void) MvgAutoWrapPrintf(wand," %g %g",x,y);
3092 WandExport void DrawPathCurveToQuadraticBezierSmoothAbsolute(DrawingWand *wand,
3093 const double x,const double y)
3095 assert(wand != (DrawingWand *) NULL);
3096 assert(wand->signature == WandSignature);
3097 if (wand->debug != MagickFalse)
3098 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3099 DrawPathCurveToQuadraticBezierSmooth(wand,AbsolutePathMode,x,y);
3103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3107 % D r a w P a t h C u r v e T o Q u a d r a t i c B e z i e r S m o o t h %
3111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3113 % DrawPathCurveToQuadraticBezierSmoothAbsolute() draws a quadratic Bezier
3114 % curve (using relative coordinates) from the current point to (x,y). The
3115 % control point is assumed to be the reflection of the control point on the
3116 % previous command relative to the current point. (If there is no previous
3117 % command or if the previous command was not a
3118 % DrawPathCurveToQuadraticBezierAbsolute,
3119 % DrawPathCurveToQuadraticBezierRelative,
3120 % DrawPathCurveToQuadraticBezierSmoothAbsolute or
3121 % DrawPathCurveToQuadraticBezierSmoothRelative, assume the control point is
3122 % coincident with the current point.). At the end of the command, the new
3123 % current point becomes the final (x,y) coordinate pair used in the polybezier.
3125 % The format of the DrawPathCurveToQuadraticBezierSmoothRelative method is:
3127 % void DrawPathCurveToQuadraticBezierSmoothRelative(DrawingWand *wand,
3128 % const double x,const double y)
3130 % A description of each parameter follows:
3132 % o wand: the drawing wand.
3134 % o x: x ordinate of final point
3136 % o y: y ordinate of final point
3139 WandExport void DrawPathCurveToQuadraticBezierSmoothRelative(DrawingWand *wand,
3140 const double x,const double y)
3142 DrawPathCurveToQuadraticBezierSmooth(wand,RelativePathMode,x,y);
3146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3150 % D r a w P a t h C u r v e T o S m o o t h A b s o l u t e %
3154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3156 % DrawPathCurveToSmoothAbsolute() draws a cubic Bezier curve from the
3157 % current point to (x,y) using absolute coordinates. The first control
3158 % point is assumed to be the reflection of the second control point on
3159 % the previous command relative to the current point. (If there is no
3160 % previous command or if the previous command was not an
3161 % DrawPathCurveToAbsolute, DrawPathCurveToRelative,
3162 % DrawPathCurveToSmoothAbsolute or DrawPathCurveToSmoothRelative, assume
3163 % the first control point is coincident with the current point.) (x2,y2)
3164 % is the second control point (i.e., the control point at the end of the
3165 % curve). At the end of the command, the new current point becomes the
3166 % final (x,y) coordinate pair used in the polybezier.
3168 % The format of the DrawPathCurveToSmoothAbsolute method is:
3170 % void DrawPathCurveToSmoothAbsolute(DrawingWand *wand,
3171 % const double x2const double y2,const double x,const double y)
3173 % A description of each parameter follows:
3175 % o wand: the drawing wand.
3177 % o x2: x ordinate of second control point
3179 % o y2: y ordinate of second control point
3181 % o x: x ordinate of termination point
3183 % o y: y ordinate of termination point
3187 static void DrawPathCurveToSmooth(DrawingWand *wand,const PathMode mode,
3188 const double x2,const double y2,const double x,const double y)
3190 assert(wand != (DrawingWand *) NULL);
3191 assert(wand->signature == WandSignature);
3192 if (wand->debug != MagickFalse)
3193 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3194 if ((wand->path_operation != PathCurveToSmoothOperation) ||
3195 (wand->path_mode != mode))
3197 wand->path_operation=PathCurveToSmoothOperation;
3198 wand->path_mode=mode;
3199 (void) MvgAutoWrapPrintf(wand,"%c%g %g %g %g",
3200 mode == AbsolutePathMode ? 'S' : 's',x2,y2,x,y);
3203 (void) MvgAutoWrapPrintf(wand," %g %g %g %g",x2,y2,x,y);
3206 WandExport void DrawPathCurveToSmoothAbsolute(DrawingWand *wand,const double x2,
3207 const double y2,const double x,const double y)
3209 assert(wand != (DrawingWand *) NULL);
3210 assert(wand->signature == WandSignature);
3211 if (wand->debug != MagickFalse)
3212 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3213 DrawPathCurveToSmooth(wand,AbsolutePathMode,x2,y2,x,y);
3217 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3221 % D r a w P a t h C u r v e T o S m o o t h R e l a t i v e %
3225 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3227 % DrawPathCurveToSmoothRelative() draws a cubic Bezier curve from the current
3228 % point to (x,y) using relative coordinates. The first control point is
3229 % assumed to be the reflection of the second control point on the previous
3230 % command relative to the current point. (If there is no previous command or
3231 % if the previous command was not an DrawPathCurveToAbsolute,
3232 % DrawPathCurveToRelative, DrawPathCurveToSmoothAbsolute or
3233 % DrawPathCurveToSmoothRelative, assume the first control point is coincident
3234 % with the current point.) (x2,y2) is the second control point (i.e., the
3235 % control point at the end of the curve). At the end of the command, the new
3236 % current point becomes the final (x,y) coordinate pair used in the polybezier.
3238 % The format of the DrawPathCurveToSmoothRelative method is:
3240 % void DrawPathCurveToSmoothRelative(DrawingWand *wand,
3241 % const double x2,const double y2,const double x,const double y)
3243 % A description of each parameter follows:
3245 % o wand: the drawing wand.
3247 % o x2: x ordinate of second control point
3249 % o y2: y ordinate of second control point
3251 % o x: x ordinate of termination point
3253 % o y: y ordinate of termination point
3256 WandExport void DrawPathCurveToSmoothRelative(DrawingWand *wand,const double x2,
3257 const double y2,const double x,const double y)
3259 assert(wand != (DrawingWand *) NULL);
3260 assert(wand->signature == WandSignature);
3261 if (wand->debug != MagickFalse)
3262 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3263 DrawPathCurveToSmooth(wand,RelativePathMode,x2,y2,x,y);
3267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3271 % D r a w P a t h E l l i p t i c A r c A b s o l u t e %
3275 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3277 % DrawPathEllipticArcAbsolute() draws an elliptical arc from the current point
3278 % to (x, y) using absolute coordinates. The size and orientation of the
3279 % ellipse are defined by two radii (rx, ry) and an xAxisRotation, which
3280 % indicates how the ellipse as a whole is rotated relative to the current
3281 % coordinate system. The center (cx, cy) of the ellipse is calculated
3282 % automagically to satisfy the constraints imposed by the other parameters.
3283 % largeArcFlag and sweepFlag contribute to the automatic calculations and help
3284 % determine how the arc is drawn. If largeArcFlag is true then draw the larger
3285 % of the available arcs. If sweepFlag is true, then draw the arc matching a
3286 % clock-wise rotation.
3288 % The format of the DrawPathEllipticArcAbsolute method is:
3290 % void DrawPathEllipticArcAbsolute(DrawingWand *wand,
3291 % const double rx,const double ry,const double x_axis_rotation,
3292 % const MagickBooleanType large_arc_flag,
3293 % const MagickBooleanType sweep_flag,const double x,const double y)
3295 % A description of each parameter follows:
3297 % o wand: the drawing wand.
3303 % o x_axis_rotation: indicates how the ellipse as a whole is rotated
3304 % relative to the current coordinate system
3306 % o large_arc_flag: If non-zero (true) then draw the larger of the
3309 % o sweep_flag: If non-zero (true) then draw the arc matching a
3310 % clock-wise rotation
3315 static void DrawPathEllipticArc(DrawingWand *wand, const PathMode mode,
3316 const double rx,const double ry,const double x_axis_rotation,
3317 const MagickBooleanType large_arc_flag,const MagickBooleanType sweep_flag,
3318 const double x,const double y)
3320 assert(wand != (DrawingWand *) NULL);
3321 assert(wand->signature == WandSignature);
3322 if (wand->debug != MagickFalse)
3323 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3324 if ((wand->path_operation != PathEllipticArcOperation) ||
3325 (wand->path_mode != mode))
3327 wand->path_operation=PathEllipticArcOperation;
3328 wand->path_mode=mode;
3329 (void) MvgAutoWrapPrintf(wand, "%c%g %g %g %u %u %g %g",
3330 mode == AbsolutePathMode ? 'A' : 'a',rx,ry,x_axis_rotation,
3331 large_arc_flag,sweep_flag,x,y);
3334 (void) MvgAutoWrapPrintf(wand," %g %g %g %u %u %g %g",rx,ry,
3335 x_axis_rotation,large_arc_flag,sweep_flag,x,y);
3338 WandExport void DrawPathEllipticArcAbsolute(DrawingWand *wand,const double rx,
3339 const double ry,const double x_axis_rotation,
3340 const MagickBooleanType large_arc_flag,const MagickBooleanType sweep_flag,
3341 const double x,const double y)
3343 assert(wand != (DrawingWand *) NULL);
3344 assert(wand->signature == WandSignature);
3345 if (wand->debug != MagickFalse)
3346 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3347 DrawPathEllipticArc(wand,AbsolutePathMode,rx,ry,x_axis_rotation,
3348 large_arc_flag,sweep_flag,x,y);
3352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3356 % D r a w P a t h E l l i p t i c A r c R e l a t i v e %
3360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3362 % DrawPathEllipticArcRelative() draws an elliptical arc from the current point
3363 % to (x, y) using relative coordinates. The size and orientation of the
3364 % ellipse are defined by two radii (rx, ry) and an xAxisRotation, which
3365 % indicates how the ellipse as a whole is rotated relative to the current
3366 % coordinate system. The center (cx, cy) of the ellipse is calculated
3367 % automagically to satisfy the constraints imposed by the other parameters.
3368 % largeArcFlag and sweepFlag contribute to the automatic calculations and help
3369 % determine how the arc is drawn. If largeArcFlag is true then draw the larger
3370 % of the available arcs. If sweepFlag is true, then draw the arc matching a
3371 % clock-wise rotation.
3373 % The format of the DrawPathEllipticArcRelative method is:
3375 % void DrawPathEllipticArcRelative(DrawingWand *wand,
3376 % const double rx,const double ry,const double x_axis_rotation,
3377 % const MagickBooleanType large_arc_flag,
3378 % const MagickBooleanType sweep_flag,const double x,const double y)
3380 % A description of each parameter follows:
3382 % o wand: the drawing wand.
3388 % o x_axis_rotation: indicates how the ellipse as a whole is rotated
3389 % relative to the current coordinate system
3391 % o large_arc_flag: If non-zero (true) then draw the larger of the
3394 % o sweep_flag: If non-zero (true) then draw the arc matching a
3395 % clock-wise rotation
3398 WandExport void DrawPathEllipticArcRelative(DrawingWand *wand,const double rx,
3399 const double ry,const double x_axis_rotation,
3400 const MagickBooleanType large_arc_flag,const MagickBooleanType sweep_flag,
3401 const double x,const double y)
3403 DrawPathEllipticArc(wand,RelativePathMode,rx,ry,x_axis_rotation,
3404 large_arc_flag,sweep_flag,x,y);
3408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3412 % D r a w P a t h F i n i s h %
3416 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3418 % DrawPathFinish() terminates the current path.
3420 % The format of the DrawPathFinish method is:
3422 % void DrawPathFinish(DrawingWand *wand)
3424 % A description of each parameter follows:
3426 % o wand: the drawing wand.
3429 WandExport void DrawPathFinish(DrawingWand *wand)
3431 assert(wand != (DrawingWand *) NULL);
3432 assert(wand->signature == WandSignature);
3433 if (wand->debug != MagickFalse)
3434 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3435 (void) MvgPrintf(wand,"'\n");
3436 wand->path_operation=PathDefaultOperation;
3437 wand->path_mode=DefaultPathMode;
3441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3445 % D r a w P a t h L i n e T o A b s o l u t e %
3449 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3451 % DrawPathLineToAbsolute() draws a line path from the current point to the
3452 % given coordinate using absolute coordinates. The coordinate then becomes
3453 % the new current point.
3455 % The format of the DrawPathLineToAbsolute method is:
3457 % void DrawPathLineToAbsolute(DrawingWand *wand,const double x,
3460 % A description of each parameter follows:
3462 % o wand: the drawing wand.
3464 % o x: target x ordinate
3466 % o y: target y ordinate
3469 static void DrawPathLineTo(DrawingWand *wand,const PathMode mode,
3470 const double x,const double y)
3472 assert(wand != (DrawingWand *) NULL);
3473 assert(wand->signature == WandSignature);
3474 if (wand->debug != MagickFalse)
3475 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3476 if ((wand->path_operation != PathLineToOperation) ||
3477 (wand->path_mode != mode))
3479 wand->path_operation=PathLineToOperation;
3480 wand->path_mode=mode;
3481 (void) MvgAutoWrapPrintf(wand,"%c%g %g",mode == AbsolutePathMode ?
3485 (void) MvgAutoWrapPrintf(wand," %g %g",x,y);
3488 WandExport void DrawPathLineToAbsolute(DrawingWand *wand,const double x,
3491 assert(wand != (DrawingWand *) NULL);
3492 assert(wand->signature == WandSignature);
3493 if (wand->debug != MagickFalse)
3494 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3495 DrawPathLineTo(wand,AbsolutePathMode,x,y);
3499 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3503 % D r a w P a t h L i n e T o R e l a t i v e %
3507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3509 % DrawPathLineToRelative() draws a line path from the current point to the
3510 % given coordinate using relative coordinates. The coordinate then becomes
3511 % the new current point.
3513 % The format of the DrawPathLineToRelative method is:
3515 % void DrawPathLineToRelative(DrawingWand *wand,const double x,
3518 % A description of each parameter follows:
3520 % o wand: the drawing wand.
3522 % o x: target x ordinate
3524 % o y: target y ordinate
3527 WandExport void DrawPathLineToRelative(DrawingWand *wand,const double x,
3530 assert(wand != (DrawingWand *) NULL);
3531 assert(wand->signature == WandSignature);
3532 if (wand->debug != MagickFalse)
3533 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3534 DrawPathLineTo(wand,RelativePathMode,x,y);
3538 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3542 % D r a w P a t h L i n e T o H o r i z o n t a l A b s o l u t e %
3546 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3548 % DrawPathLineToHorizontalAbsolute() draws a horizontal line path from the
3549 % current point to the target point using absolute coordinates. The target
3550 % point then becomes the new current point.
3552 % The format of the DrawPathLineToHorizontalAbsolute method is:
3554 % void DrawPathLineToHorizontalAbsolute(DrawingWand *wand,
3555 % const PathMode mode,const double x)
3557 % A description of each parameter follows:
3559 % o wand: the drawing wand.
3561 % o x: target x ordinate
3565 static void DrawPathLineToHorizontal(DrawingWand *wand,const PathMode mode,
3568 assert(wand != (DrawingWand *) NULL);
3569 assert(wand->signature == WandSignature);
3570 if (wand->debug != MagickFalse)
3571 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3572 if ((wand->path_operation != PathLineToHorizontalOperation) ||
3573 (wand->path_mode != mode))
3575 wand->path_operation=PathLineToHorizontalOperation;
3576 wand->path_mode=mode;
3577 (void) MvgAutoWrapPrintf(wand,"%c%g",mode == AbsolutePathMode ?
3581 (void) MvgAutoWrapPrintf(wand," %g",x);
3584 WandExport void DrawPathLineToHorizontalAbsolute(DrawingWand *wand,
3587 assert(wand != (DrawingWand *) NULL);
3588 assert(wand->signature == WandSignature);
3589 if (wand->debug != MagickFalse)
3590 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3591 DrawPathLineToHorizontal(wand,AbsolutePathMode,x);
3595 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3599 % D r a w P a t h L i n e T o H o r i z o n t a l R e l a t i v e %
3603 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3605 % DrawPathLineToHorizontalRelative() draws a horizontal line path from the
3606 % current point to the target point using relative coordinates. The target
3607 % point then becomes the new current point.
3609 % The format of the DrawPathLineToHorizontalRelative method is:
3611 % void DrawPathLineToHorizontalRelative(DrawingWand *wand,
3614 % A description of each parameter follows:
3616 % o wand: the drawing wand.
3618 % o x: target x ordinate
3621 WandExport void DrawPathLineToHorizontalRelative(DrawingWand *wand,
3624 DrawPathLineToHorizontal(wand,RelativePathMode,x);
3628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3632 % D r a w P a t h L i n e T o V e r t i c a l A b s o l u t e %
3636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3638 % DrawPathLineToVerticalAbsolute() draws a vertical line path from the
3639 % current point to the target point using absolute coordinates. The target
3640 % point then becomes the new current point.
3642 % The format of the DrawPathLineToVerticalAbsolute method is:
3644 % void DrawPathLineToVerticalAbsolute(DrawingWand *wand,
3647 % A description of each parameter follows:
3649 % o wand: the drawing wand.
3651 % o y: target y ordinate
3655 static void DrawPathLineToVertical(DrawingWand *wand,const PathMode mode,
3658 assert(wand != (DrawingWand *) NULL);
3659 assert(wand->signature == WandSignature);
3660 if (wand->debug != MagickFalse)
3661 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3662 if ((wand->path_operation != PathLineToVerticalOperation) ||
3663 (wand->path_mode != mode))
3665 wand->path_operation=PathLineToVerticalOperation;
3666 wand->path_mode=mode;
3667 (void) MvgAutoWrapPrintf(wand,"%c%g",mode == AbsolutePathMode ?
3671 (void) MvgAutoWrapPrintf(wand," %g",y);
3674 WandExport void DrawPathLineToVerticalAbsolute(DrawingWand *wand,const double y)
3676 assert(wand != (DrawingWand *) NULL);
3677 assert(wand->signature == WandSignature);
3678 if (wand->debug != MagickFalse)
3679 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3680 DrawPathLineToVertical(wand,AbsolutePathMode,y);
3684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3688 % D r a w P a t h L i n e T o V e r t i c a l R e l a t i v e %
3692 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3694 % DrawPathLineToVerticalRelative() draws a vertical line path from the
3695 % current point to the target point using relative coordinates. The target
3696 % point then becomes the new current point.
3698 % The format of the DrawPathLineToVerticalRelative method is:
3700 % void DrawPathLineToVerticalRelative(DrawingWand *wand,
3703 % A description of each parameter follows:
3705 % o wand: the drawing wand.
3707 % o y: target y ordinate
3710 WandExport void DrawPathLineToVerticalRelative(DrawingWand *wand,const double y)
3712 assert(wand != (DrawingWand *) NULL);
3713 assert(wand->signature == WandSignature);
3714 if (wand->debug != MagickFalse)
3715 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3716 DrawPathLineToVertical(wand,RelativePathMode,y);
3719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3723 % D r a w P a t h M o v e T o A b s o l u t e %
3727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3729 % DrawPathMoveToAbsolute() starts a new sub-path at the given coordinate
3730 % using absolute coordinates. The current point then becomes the
3731 % specified coordinate.
3733 % The format of the DrawPathMoveToAbsolute method is:
3735 % void DrawPathMoveToAbsolute(DrawingWand *wand,const double x,
3738 % A description of each parameter follows:
3740 % o wand: the drawing wand.
3742 % o x: target x ordinate
3744 % o y: target y ordinate
3748 static void DrawPathMoveTo(DrawingWand *wand,const PathMode mode,const double x,
3751 assert(wand != (DrawingWand *) NULL);
3752 assert(wand->signature == WandSignature);
3753 if (wand->debug != MagickFalse)
3754 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3755 if ((wand->path_operation != PathMoveToOperation) ||
3756 (wand->path_mode != mode))
3758 wand->path_operation=PathMoveToOperation;
3759 wand->path_mode=mode;
3760 (void) MvgAutoWrapPrintf(wand,"%c%g %g",mode == AbsolutePathMode ?
3764 (void) MvgAutoWrapPrintf(wand," %g %g",x,y);
3767 WandExport void DrawPathMoveToAbsolute(DrawingWand *wand,const double x,
3770 assert(wand != (DrawingWand *) NULL);
3771 assert(wand->signature == WandSignature);
3772 if (wand->debug != MagickFalse)
3773 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3774 DrawPathMoveTo(wand,AbsolutePathMode,x,y);
3778 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3782 % D r a w P a t h M o v e T o R e l a t i v e %
3786 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3788 % DrawPathMoveToRelative() starts a new sub-path at the given coordinate using
3789 % relative coordinates. The current point then becomes the specified
3792 % The format of the DrawPathMoveToRelative method is:
3794 % void DrawPathMoveToRelative(DrawingWand *wand,const double x,
3797 % A description of each parameter follows:
3799 % o wand: the drawing wand.
3801 % o x: target x ordinate
3803 % o y: target y ordinate
3806 WandExport void DrawPathMoveToRelative(DrawingWand *wand,const double x,
3809 assert(wand != (DrawingWand *) NULL);
3810 assert(wand->signature == WandSignature);
3811 if (wand->debug != MagickFalse)
3812 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3813 DrawPathMoveTo(wand,RelativePathMode,x,y);
3817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3821 % D r a w P a t h S t a r t %
3825 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3827 % DrawPathStart() declares the start of a path drawing list which is terminated
3828 % by a matching DrawPathFinish() command. All other DrawPath commands must
3829 % be enclosed between a DrawPathStart() and a DrawPathFinish() command. This
3830 % is because path drawing commands are subordinate commands and they do not
3831 % function by themselves.
3833 % The format of the DrawPathStart method is:
3835 % void DrawPathStart(DrawingWand *wand)
3837 % A description of each parameter follows:
3839 % o wand: the drawing wand.
3842 WandExport void DrawPathStart(DrawingWand *wand)
3844 assert(wand != (DrawingWand *) NULL);
3845 assert(wand->signature == WandSignature);
3846 if (wand->debug != MagickFalse)
3847 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3848 (void) MvgPrintf(wand,"path '");
3849 wand->path_operation=PathDefaultOperation;
3850 wand->path_mode=DefaultPathMode;
3854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3858 % D r a w P o i n t %
3862 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3864 % DrawPoint() draws a point using the current fill color.
3866 % The format of the DrawPoint method is:
3868 % void DrawPoint(DrawingWand *wand,const double x,const double y)
3870 % A description of each parameter follows:
3872 % o wand: the drawing wand.
3874 % o x: target x coordinate
3876 % o y: target y coordinate
3879 WandExport void DrawPoint(DrawingWand *wand,const double x,const double y)
3881 assert(wand != (DrawingWand *) NULL);
3882 assert(wand->signature == WandSignature);
3883 if (wand->debug != MagickFalse)
3884 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3885 (void) MvgPrintf(wand,"point %g %g\n",x,y);
3889 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3893 % D r a w P o l y g o n %
3897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3899 % DrawPolygon() draws a polygon using the current stroke, stroke width, and
3900 % fill color or texture, using the specified array of coordinates.
3902 % The format of the DrawPolygon method is:
3904 % void DrawPolygon(DrawingWand *wand,
3905 % const size_t number_coordinates,const PointInfo *coordinates)
3907 % A description of each parameter follows:
3909 % o wand: the drawing wand.
3911 % o number_coordinates: number of coordinates
3913 % o coordinates: coordinate array
3916 WandExport void DrawPolygon(DrawingWand *wand,
3917 const size_t number_coordinates,const PointInfo *coordinates)
3919 assert(wand != (DrawingWand *) NULL);
3920 assert(wand->signature == WandSignature);
3921 if (wand->debug != MagickFalse)
3922 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3923 MvgAppendPointsCommand(wand,"polygon",number_coordinates,coordinates);
3927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3931 % D r a w P o l y l i n e %
3935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3937 % DrawPolyline() draws a polyline using the current stroke, stroke width, and
3938 % fill color or texture, using the specified array of coordinates.
3940 % The format of the DrawPolyline method is:
3942 % void DrawPolyline(DrawingWand *wand,
3943 % const size_t number_coordinates,const PointInfo *coordinates)
3945 % A description of each parameter follows:
3947 % o wand: the drawing wand.
3949 % o number_coordinates: number of coordinates
3951 % o coordinates: coordinate array
3954 WandExport void DrawPolyline(DrawingWand *wand,
3955 const size_t number_coordinates,const PointInfo *coordinates)
3957 assert(wand != (DrawingWand *) NULL);
3958 assert(wand->signature == WandSignature);
3959 if (wand->debug != MagickFalse)
3960 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3961 MvgAppendPointsCommand(wand,"polyline",number_coordinates,coordinates);
3965 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3969 % D r a w P o p C l i p P a t h %
3973 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3975 % DrawPopClipPath() terminates a clip path definition.
3977 % The format of the DrawPopClipPath method is:
3979 % void DrawPopClipPath(DrawingWand *wand)
3981 % A description of each parameter follows:
3983 % o wand: the drawing wand.
3986 WandExport void DrawPopClipPath(DrawingWand *wand)
3988 assert(wand != (DrawingWand *) NULL);
3989 assert(wand->signature == WandSignature);
3990 if (wand->debug != MagickFalse)
3991 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
3992 if (wand->indent_depth > 0)
3993 wand->indent_depth--;
3994 (void) MvgPrintf(wand,"pop clip-path\n");
3998 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4002 % D r a w P o p D e f s %
4006 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4008 % DrawPopDefs() terminates a definition list.
4010 % The format of the DrawPopDefs method is:
4012 % void DrawPopDefs(DrawingWand *wand)
4014 % A description of each parameter follows:
4016 % o wand: the drawing wand.
4019 WandExport void DrawPopDefs(DrawingWand *wand)
4021 assert(wand != (DrawingWand *) NULL);
4022 assert(wand->signature == WandSignature);
4023 if (wand->debug != MagickFalse)
4024 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4025 if (wand->indent_depth > 0)
4026 wand->indent_depth--;
4027 (void) MvgPrintf(wand,"pop defs\n");
4031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4035 % D r a w P o p P a t t e r n %
4039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4041 % DrawPopPattern() terminates a pattern definition.
4043 % The format of the DrawPopPattern method is:
4045 % MagickBooleanType DrawPopPattern(DrawingWand *wand)
4047 % A description of each parameter follows:
4049 % o wand: the drawing wand.
4052 WandExport MagickBooleanType DrawPopPattern(DrawingWand *wand)
4055 geometry[MaxTextExtent],
4058 assert(wand != (DrawingWand *) NULL);
4059 assert(wand->signature == WandSignature);
4060 if (wand->debug != MagickFalse)
4061 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4062 if (wand->image == (Image *) NULL)
4063 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
4064 if (wand->pattern_id == (const char *) NULL)
4066 ThrowDrawException(DrawWarning,"NotCurrentlyPushingPatternDefinition",
4068 return(MagickFalse);
4070 (void) FormatLocaleString(key,MaxTextExtent,"%s",wand->pattern_id);
4071 (void) SetImageArtifact(wand->image,key,wand->mvg+wand->pattern_offset);
4072 (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
4073 (double) wand->pattern_bounds.width,(double) wand->pattern_bounds.height,
4074 (double) wand->pattern_bounds.x,(double) wand->pattern_bounds.y);
4075 (void) SetImageArtifact(wand->image,key,geometry);
4076 wand->pattern_id=DestroyString(wand->pattern_id);
4077 wand->pattern_offset=0;
4078 wand->pattern_bounds.x=0;
4079 wand->pattern_bounds.y=0;
4080 wand->pattern_bounds.width=0;
4081 wand->pattern_bounds.height=0;
4082 wand->filter_off=MagickTrue;
4083 if (wand->indent_depth > 0)
4084 wand->indent_depth--;
4085 (void) MvgPrintf(wand,"pop pattern\n");
4090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4094 % D r a w P u s h C l i p P a t h %
4098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4100 % DrawPushClipPath() starts a clip path definition which is comprized of any
4101 % number of drawing commands and terminated by a DrawPopClipPath() command.
4103 % The format of the DrawPushClipPath method is:
4105 % void DrawPushClipPath(DrawingWand *wand,const char *clip_mask_id)
4107 % A description of each parameter follows:
4109 % o wand: the drawing wand.
4111 % o clip_mask_id: string identifier to associate with the clip path for
4115 WandExport void DrawPushClipPath(DrawingWand *wand,const char *clip_mask_id)
4117 assert(wand != (DrawingWand *) NULL);
4118 assert(wand->signature == WandSignature);
4119 if (wand->debug != MagickFalse)
4120 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4121 assert(clip_mask_id != (const char *) NULL);
4122 (void) MvgPrintf(wand,"push clip-path %s\n",clip_mask_id);
4123 wand->indent_depth++;
4127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4131 % D r a w P u s h D e f s %
4135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4137 % DrawPushDefs() indicates that commands up to a terminating DrawPopDefs()
4138 % command create named elements (e.g. clip-paths, textures, etc.) which
4139 % may safely be processed earlier for the sake of efficiency.
4141 % The format of the DrawPushDefs method is:
4143 % void DrawPushDefs(DrawingWand *wand)
4145 % A description of each parameter follows:
4147 % o wand: the drawing wand.
4150 WandExport void DrawPushDefs(DrawingWand *wand)
4152 assert(wand != (DrawingWand *) NULL);
4153 assert(wand->signature == WandSignature);
4154 if (wand->debug != MagickFalse)
4155 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4156 (void) MvgPrintf(wand,"push defs\n");
4157 wand->indent_depth++;
4161 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4165 % D r a w P u s h P a t t e r n %
4169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4171 % DrawPushPattern() indicates that subsequent commands up to a
4172 % DrawPopPattern() command comprise the definition of a named pattern.
4173 % The pattern space is assigned top left corner coordinates, a width
4174 % and height, and becomes its own drawing space. Anything which can
4175 % be drawn may be used in a pattern definition.
4176 % Named patterns may be used as stroke or brush definitions.
4178 % The format of the DrawPushPattern method is:
4180 % MagickBooleanType DrawPushPattern(DrawingWand *wand,
4181 % const char *pattern_id,const double x,const double y,
4182 % const double width,const double height)
4184 % A description of each parameter follows:
4186 % o wand: the drawing wand.
4188 % o pattern_id: pattern identification for later reference
4190 % o x: x ordinate of top left corner
4192 % o y: y ordinate of top left corner
4194 % o width: width of pattern space
4196 % o height: height of pattern space
4199 WandExport MagickBooleanType DrawPushPattern(DrawingWand *wand,
4200 const char *pattern_id,const double x,const double y,const double width,
4201 const double height)
4203 assert(wand != (DrawingWand *) NULL);
4204 assert(wand->signature == WandSignature);
4205 if (wand->debug != MagickFalse)
4206 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4207 assert(pattern_id != (const char *) NULL);
4208 if (wand->pattern_id != NULL)
4210 ThrowDrawException(DrawError,"AlreadyPushingPatternDefinition",
4212 return(MagickFalse);
4214 wand->filter_off=MagickTrue;
4215 (void) MvgPrintf(wand,"push pattern %s %g %g %g %g\n",pattern_id,
4217 wand->indent_depth++;
4218 wand->pattern_id=AcquireString(pattern_id);
4219 wand->pattern_bounds.x=(ssize_t) ceil(x-0.5);
4220 wand->pattern_bounds.y=(ssize_t) ceil(y-0.5);
4221 wand->pattern_bounds.width=(size_t) floor(width+0.5);
4222 wand->pattern_bounds.height=(size_t) floor(height+0.5);
4223 wand->pattern_offset=wand->mvg_length;
4228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4232 % D r a w R e c t a n g l e %
4236 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4238 % DrawRectangle() draws a rectangle given two coordinates and using the
4239 % current stroke, stroke width, and fill settings.
4241 % The format of the DrawRectangle method is:
4243 % void DrawRectangle(DrawingWand *wand,const double x1,
4244 % const double y1,const double x2,const double y2)
4246 % A description of each parameter follows:
4248 % o x1: x ordinate of first coordinate
4250 % o y1: y ordinate of first coordinate
4252 % o x2: x ordinate of second coordinate
4254 % o y2: y ordinate of second coordinate
4257 WandExport void DrawRectangle(DrawingWand *wand,const double x1,const double y1,
4258 const double x2,const double y2)
4260 assert(wand != (DrawingWand *) NULL);
4261 assert(wand->signature == WandSignature);
4262 if (wand->debug != MagickFalse)
4263 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4264 (void) MvgPrintf(wand,"rectangle %g %g %g %g\n",x1,y1,x2,y2);
4268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4272 + D r a w R e n d e r %
4276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4278 % DrawRender() renders all preceding drawing commands onto the image.
4280 % The format of the DrawRender method is:
4282 % MagickBooleanType DrawRender(DrawingWand *wand)
4284 % A description of each parameter follows:
4286 % o wand: the drawing wand.
4289 WandExport MagickBooleanType DrawRender(DrawingWand *wand)
4294 assert(wand != (const DrawingWand *) NULL);
4295 assert(wand->signature == WandSignature);
4296 if (wand->debug != MagickFalse)
4297 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4298 CurrentContext->primitive=wand->mvg;
4299 if (wand->debug != MagickFalse)
4300 (void) LogMagickEvent(DrawEvent,GetMagickModule(),"MVG:\n'%s'\n",wand->mvg);
4301 if (wand->image == (Image *) NULL)
4302 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
4303 status=DrawImage(wand->image,CurrentContext,wand->exception);
4304 CurrentContext->primitive=(char *) NULL;
4309 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4313 % D r a w R e s e t V e c t o r G r a p h i c s %
4317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4319 % DrawResetVectorGraphics() resets the vector graphics associated with the
4322 % The format of the DrawResetVectorGraphics method is:
4324 % void DrawResetVectorGraphics(DrawingWand *wand)
4326 % A description of each parameter follows:
4328 % o wand: the drawing wand.
4331 WandExport void DrawResetVectorGraphics(DrawingWand *wand)
4333 assert(wand != (DrawingWand *) NULL);
4334 assert(wand->signature == WandSignature);
4335 if (wand->debug != MagickFalse)
4336 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4337 if (wand->mvg != (char *) NULL)
4338 wand->mvg=DestroyString(wand->mvg);
4345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4349 % D r a w R o t a t e %
4353 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4355 % DrawRotate() applies the specified rotation to the current coordinate space.
4357 % The format of the DrawRotate method is:
4359 % void DrawRotate(DrawingWand *wand,const double degrees)
4361 % A description of each parameter follows:
4363 % o wand: the drawing wand.
4365 % o degrees: degrees of rotation
4368 WandExport void DrawRotate(DrawingWand *wand,const double degrees)
4370 assert(wand != (DrawingWand *) NULL);
4371 assert(wand->signature == WandSignature);
4372 if (wand->debug != MagickFalse)
4373 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4374 (void) MvgPrintf(wand,"rotate %g\n",degrees);
4378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4382 % D r a w R o u n d R e c t a n g l e %
4386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4388 % DrawRoundRectangle() draws a rounted rectangle given two coordinates,
4389 % x & y corner radiuses and using the current stroke, stroke width,
4390 % and fill settings.
4392 % The format of the DrawRoundRectangle method is:
4394 % void DrawRoundRectangle(DrawingWand *wand,double x1,double y1,
4395 % double x2,double y2,double rx,double ry)
4397 % A description of each parameter follows:
4399 % o wand: the drawing wand.
4401 % o x1: x ordinate of first coordinate
4403 % o y1: y ordinate of first coordinate
4405 % o x2: x ordinate of second coordinate
4407 % o y2: y ordinate of second coordinate
4409 % o rx: radius of corner in horizontal direction
4411 % o ry: radius of corner in vertical direction
4414 WandExport void DrawRoundRectangle(DrawingWand *wand,double x1,double y1,
4415 double x2,double y2,double rx,double ry)
4417 assert(wand != (DrawingWand *) NULL);
4418 assert(wand->signature == WandSignature);
4419 if (wand->debug != MagickFalse)
4420 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4421 (void) MvgPrintf(wand,"roundrectangle %g %g %g %g %g %g\n",
4426 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4430 % D r a w S c a l e %
4434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4436 % DrawScale() adjusts the scaling factor to apply in the horizontal and
4437 % vertical directions to the current coordinate space.
4439 % The format of the DrawScale method is:
4441 % void DrawScale(DrawingWand *wand,const double x,const double y)
4443 % A description of each parameter follows:
4445 % o wand: the drawing wand.
4447 % o x: horizontal scale factor
4449 % o y: vertical scale factor
4452 WandExport void DrawScale(DrawingWand *wand,const double x,const double y)
4454 assert(wand != (DrawingWand *) NULL);
4455 assert(wand->signature == WandSignature);
4456 if (wand->debug != MagickFalse)
4457 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4458 (void) MvgPrintf(wand,"scale %g %g\n",x,y);
4462 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4466 % D r a w S e t B o r d e r C o l o r %
4470 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4472 % DrawSetBorderColor() sets the border color to be used for drawing bordered
4475 % The format of the DrawSetBorderColor method is:
4477 % void DrawSetBorderColor(DrawingWand *wand,const PixelWand *border_wand)
4479 % A description of each parameter follows:
4481 % o wand: the drawing wand.
4483 % o border_wand: border wand.
4486 WandExport void DrawSetBorderColor(DrawingWand *wand,
4487 const PixelWand *border_wand)
4494 assert(wand != (DrawingWand *) NULL);
4495 assert(wand->signature == WandSignature);
4496 if (wand->debug != MagickFalse)
4497 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4498 assert(border_wand != (const PixelWand *) NULL);
4499 PixelGetQuantumPacket(border_wand,&border_color);
4500 new_border=border_color;
4501 current_border=(&CurrentContext->border_color);
4502 if ((wand->filter_off != MagickFalse) ||
4503 (IsPixelPacketEquivalent(current_border,&new_border) == MagickFalse))
4505 CurrentContext->border_color=new_border;
4506 (void) MvgPrintf(wand,"border-color '");
4507 MvgAppendColor(wand,&border_color);
4508 (void) MvgPrintf(wand,"'\n");
4513 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4517 % D r a w S e t C l i p P a t h %
4521 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4523 % DrawSetClipPath() associates a named clipping path with the image. Only
4524 % the areas drawn on by the clipping path will be modified as ssize_t as it
4525 % remains in effect.
4527 % The format of the DrawSetClipPath method is:
4529 % MagickBooleanType DrawSetClipPath(DrawingWand *wand,
4530 % const char *clip_mask)
4532 % A description of each parameter follows:
4534 % o wand: the drawing wand.
4536 % o clip_mask: name of clipping path to associate with image
4539 WandExport MagickBooleanType DrawSetClipPath(DrawingWand *wand,
4540 const char *clip_mask)
4542 if (wand->debug != MagickFalse)
4543 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask);
4544 assert(wand != (DrawingWand *) NULL);
4545 assert(wand->signature == WandSignature);
4546 assert(clip_mask != (const char *) NULL);
4547 if ((CurrentContext->clip_mask == (const char *) NULL) ||
4548 (wand->filter_off != MagickFalse) ||
4549 (LocaleCompare(CurrentContext->clip_mask,clip_mask) != 0))
4551 (void) CloneString(&CurrentContext->clip_mask,clip_mask);
4552 #if DRAW_BINARY_IMPLEMENTATION
4553 if (wand->image == (Image *) NULL)
4554 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
4555 (void) DrawClipPath(wand->image,CurrentContext,CurrentContext->clip_mask);
4557 (void) MvgPrintf(wand,"clip-path url(#%s)\n",clip_mask);
4563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4567 % D r a w S e t C l i p R u l e %
4571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4573 % DrawSetClipRule() set the polygon fill rule to be used by the clipping path.
4575 % The format of the DrawSetClipRule method is:
4577 % void DrawSetClipRule(DrawingWand *wand,const FillRule fill_rule)
4579 % A description of each parameter follows:
4581 % o wand: the drawing wand.
4583 % o fill_rule: fill rule (EvenOddRule or NonZeroRule)
4586 WandExport void DrawSetClipRule(DrawingWand *wand,const FillRule fill_rule)
4588 assert(wand != (DrawingWand *) NULL);
4589 assert(wand->signature == WandSignature);
4590 if (wand->debug != MagickFalse)
4591 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4592 if ((wand->filter_off != MagickFalse) ||
4593 (CurrentContext->fill_rule != fill_rule))
4595 CurrentContext->fill_rule=fill_rule;
4596 (void) MvgPrintf(wand, "clip-rule '%s'\n",CommandOptionToMnemonic(
4597 MagickFillRuleOptions,(ssize_t) fill_rule));
4602 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4606 % D r a w S e t C l i p U n i t s %
4610 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4612 % DrawSetClipUnits() sets the interpretation of clip path units.
4614 % The format of the DrawSetClipUnits method is:
4616 % void DrawSetClipUnits(DrawingWand *wand,
4617 % const ClipPathUnits clip_units)
4619 % A description of each parameter follows:
4621 % o wand: the drawing wand.
4623 % o clip_units: units to use (UserSpace, UserSpaceOnUse, or
4624 % ObjectBoundingBox)
4627 WandExport void DrawSetClipUnits(DrawingWand *wand,
4628 const ClipPathUnits clip_units)
4630 assert(wand != (DrawingWand *) NULL);
4631 assert(wand->signature == WandSignature);
4632 if (wand->debug != MagickFalse)
4633 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4634 if ((wand->filter_off != MagickFalse) ||
4635 (CurrentContext->clip_units != clip_units))
4637 CurrentContext->clip_units=clip_units;
4638 if (clip_units == ObjectBoundingBox)
4643 GetAffineMatrix(&affine);
4644 affine.sx=CurrentContext->bounds.x2;
4645 affine.sy=CurrentContext->bounds.y2;
4646 affine.tx=CurrentContext->bounds.x1;
4647 affine.ty=CurrentContext->bounds.y1;
4648 AdjustAffine(wand,&affine);
4650 (void) MvgPrintf(wand, "clip-units '%s'\n",CommandOptionToMnemonic(
4651 MagickClipPathOptions,(ssize_t) clip_units));
4656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4660 % D r a w S e t F i l l C o l o r %
4664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4666 % DrawSetFillColor() sets the fill color to be used for drawing filled objects.
4668 % The format of the DrawSetFillColor method is:
4670 % void DrawSetFillColor(DrawingWand *wand,const PixelWand *fill_wand)
4672 % A description of each parameter follows:
4674 % o wand: the drawing wand.
4676 % o fill_wand: fill wand.
4679 WandExport void DrawSetFillColor(DrawingWand *wand,const PixelWand *fill_wand)
4686 assert(wand != (DrawingWand *) NULL);
4687 assert(wand->signature == WandSignature);
4688 if (wand->debug != MagickFalse)
4689 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4690 assert(fill_wand != (const PixelWand *) NULL);
4691 PixelGetQuantumPacket(fill_wand,&fill_color);
4692 new_fill=fill_color;
4693 current_fill=(&CurrentContext->fill);
4694 if ((wand->filter_off != MagickFalse) ||
4695 (IsPixelPacketEquivalent(current_fill,&new_fill) == MagickFalse))
4697 CurrentContext->fill=new_fill;
4698 (void) MvgPrintf(wand,"fill '");
4699 MvgAppendColor(wand,&fill_color);
4700 (void) MvgPrintf(wand,"'\n");
4705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4709 % D r a w S e t F i l l O p a c i t y %
4713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4715 % DrawSetFillOpacity() sets the opacity to use when drawing using the fill
4716 % color or fill texture. Fully opaque is 1.0.
4718 % The format of the DrawSetFillOpacity method is:
4720 % void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity)
4722 % A description of each parameter follows:
4724 % o wand: the drawing wand.
4726 % o fill_opacity: fill opacity
4729 WandExport void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity)
4734 assert(wand != (DrawingWand *) NULL);
4735 assert(wand->signature == WandSignature);
4736 if (wand->debug != MagickFalse)
4737 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4738 opacity=ClampToQuantum((double) QuantumRange*(1.0-fill_opacity));
4739 if ((wand->filter_off != MagickFalse) ||
4740 (CurrentContext->fill.alpha != opacity))
4742 CurrentContext->fill.alpha=opacity;
4743 (void) MvgPrintf(wand,"fill-opacity %g\n",fill_opacity);
4748 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4752 % D r a w S e t F o n t R e s o l u t i o n %
4756 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4758 % DrawSetFontResolution() sets the image resolution.
4760 % The format of the DrawSetFontResolution method is:
4762 % DrawBooleanType DrawSetFontResolution(DrawingWand *wand,
4763 % const double x_resolution,const doubtl y_resolution)
4765 % A description of each parameter follows:
4767 % o wand: the magick wand.
4769 % o x_resolution: the image x resolution.
4771 % o y_resolution: the image y resolution.
4774 WandExport MagickBooleanType DrawSetFontResolution(DrawingWand *wand,
4775 const double x_resolution,const double y_resolution)
4778 density[MaxTextExtent];
4780 assert(wand != (DrawingWand *) NULL);
4781 assert(wand->signature == WandSignature);
4782 if (wand->debug != MagickFalse)
4783 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4784 (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution,
4786 (void) CloneString(&CurrentContext->density,density);
4791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4795 % D r a w S e t O p a c i t y %
4799 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4801 % DrawSetOpacity() sets the opacity to use when drawing using the fill or
4802 % stroke color or texture. Fully opaque is 1.0.
4804 % The format of the DrawSetOpacity method is:
4806 % void DrawSetOpacity(DrawingWand *wand,const double opacity)
4808 % A description of each parameter follows:
4810 % o wand: the drawing wand.
4812 % o opacity: fill opacity
4815 WandExport void DrawSetOpacity(DrawingWand *wand,const double opacity)
4820 assert(wand != (DrawingWand *) NULL);
4821 assert(wand->signature == WandSignature);
4822 if (wand->debug != MagickFalse)
4823 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4824 quantum_opacity=ClampToQuantum((double) QuantumRange*(1.0-opacity));
4825 if ((wand->filter_off != MagickFalse) ||
4826 (CurrentContext->alpha != quantum_opacity))
4828 CurrentContext->alpha=(Quantum) opacity;
4829 (void) MvgPrintf(wand,"opacity %g\n",opacity);
4834 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4838 % D r a w S e t F i l l P a t t e r n U R L %
4842 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4844 % DrawSetFillPatternURL() sets the URL to use as a fill pattern for filling
4845 % objects. Only local URLs ("#identifier") are supported at this time. These
4846 % local URLs are normally created by defining a named fill pattern with
4847 % DrawPushPattern/DrawPopPattern.
4849 % The format of the DrawSetFillPatternURL method is:
4851 % MagickBooleanType DrawSetFillPatternURL(DrawingWand *wand,
4852 % const char *fill_url)
4854 % A description of each parameter follows:
4856 % o wand: the drawing wand.
4858 % o fill_url: URL to use to obtain fill pattern.
4861 WandExport MagickBooleanType DrawSetFillPatternURL(DrawingWand *wand,
4862 const char *fill_url)
4865 pattern[MaxTextExtent],
4866 pattern_spec[MaxTextExtent];
4868 assert(wand != (DrawingWand *) NULL);
4869 assert(wand->signature == WandSignature);
4870 if (wand->debug != MagickFalse)
4871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",fill_url);
4872 if (wand->image == (Image *) NULL)
4873 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
4874 assert(fill_url != (const char *) NULL);
4875 if (*fill_url != '#')
4877 ThrowDrawException(DrawError,"NotARelativeURL",fill_url);
4878 return(MagickFalse);
4880 (void) FormatLocaleString(pattern,MaxTextExtent,"%s",fill_url+1);
4881 if (GetImageArtifact(wand->image,pattern) == (const char *) NULL)
4883 ThrowDrawException(DrawError,"URLNotFound",fill_url)
4884 return(MagickFalse);
4886 (void) FormatLocaleString(pattern_spec,MaxTextExtent,"url(%s)",fill_url);
4887 #if DRAW_BINARY_IMPLEMENTATION
4888 DrawPatternPath(wand->image,CurrentContext,pattern_spec,
4889 &CurrentContext->fill_pattern);
4891 if (CurrentContext->fill.alpha != (Quantum) TransparentAlpha)
4892 CurrentContext->fill.alpha=CurrentContext->alpha;
4893 (void) MvgPrintf(wand,"fill %s\n",pattern_spec);
4898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4902 % D r a w S e t F i l l R u l e %
4906 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4908 % DrawSetFillRule() sets the fill rule to use while drawing polygons.
4910 % The format of the DrawSetFillRule method is:
4912 % void DrawSetFillRule(DrawingWand *wand,const FillRule fill_rule)
4914 % A description of each parameter follows:
4916 % o wand: the drawing wand.
4918 % o fill_rule: fill rule (EvenOddRule or NonZeroRule)
4921 WandExport void DrawSetFillRule(DrawingWand *wand,const FillRule fill_rule)
4923 assert(wand != (DrawingWand *) NULL);
4924 assert(wand->signature == WandSignature);
4925 if (wand->debug != MagickFalse)
4926 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4927 if ((wand->filter_off != MagickFalse) ||
4928 (CurrentContext->fill_rule != fill_rule))
4930 CurrentContext->fill_rule=fill_rule;
4931 (void) MvgPrintf(wand, "fill-rule '%s'\n",CommandOptionToMnemonic(
4932 MagickFillRuleOptions,(ssize_t) fill_rule));
4937 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4941 % D r a w S e t F o n t %
4945 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4947 % DrawSetFont() sets the fully-sepecified font to use when annotating with
4950 % The format of the DrawSetFont method is:
4952 % MagickBooleanType DrawSetFont(DrawingWand *wand,const char *font_name)
4954 % A description of each parameter follows:
4956 % o wand: the drawing wand.
4958 % o font_name: font name
4961 WandExport MagickBooleanType DrawSetFont(DrawingWand *wand,
4962 const char *font_name)
4964 assert(wand != (DrawingWand *) NULL);
4965 assert(wand->signature == WandSignature);
4966 if (wand->debug != MagickFalse)
4967 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
4968 assert(font_name != (const char *) NULL);
4969 if ((wand->filter_off != MagickFalse) ||
4970 (CurrentContext->font == (char *) NULL) ||
4971 (LocaleCompare(CurrentContext->font,font_name) != 0))
4973 (void) CloneString(&CurrentContext->font,font_name);
4974 (void) MvgPrintf(wand,"font '%s'\n",font_name);
4980 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4984 % D r a w S e t F o n t F a m i l y %
4988 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4990 % DrawSetFontFamily() sets the font family to use when annotating with text.
4992 % The format of the DrawSetFontFamily method is:
4994 % MagickBooleanType DrawSetFontFamily(DrawingWand *wand,
4995 % const char *font_family)
4997 % A description of each parameter follows:
4999 % o wand: the drawing wand.
5001 % o font_family: font family
5004 WandExport MagickBooleanType DrawSetFontFamily(DrawingWand *wand,
5005 const char *font_family)
5007 assert(wand != (DrawingWand *) NULL);
5008 assert(wand->signature == WandSignature);
5009 if (wand->debug != MagickFalse)
5010 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5011 assert(font_family != (const char *) NULL);
5012 if ((wand->filter_off != MagickFalse) ||
5013 (CurrentContext->family == (const char *) NULL) ||
5014 (LocaleCompare(CurrentContext->family,font_family) != 0))
5016 (void) CloneString(&CurrentContext->family,font_family);
5017 (void) MvgPrintf(wand,"font-family '%s'\n",font_family);
5023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5027 % D r a w S e t F o n t S i z e %
5031 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5033 % DrawSetFontSize() sets the font pointsize to use when annotating with text.
5035 % The format of the DrawSetFontSize method is:
5037 % void DrawSetFontSize(DrawingWand *wand,const double pointsize)
5039 % A description of each parameter follows:
5041 % o wand: the drawing wand.
5043 % o pointsize: text pointsize
5046 WandExport void DrawSetFontSize(DrawingWand *wand,const double pointsize)
5048 assert(wand != (DrawingWand *) NULL);
5049 assert(wand->signature == WandSignature);
5050 if (wand->debug != MagickFalse)
5051 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5052 if ((wand->filter_off != MagickFalse) ||
5053 (fabs(CurrentContext->pointsize-pointsize) > MagickEpsilon))
5055 CurrentContext->pointsize=pointsize;
5056 (void) MvgPrintf(wand,"font-size %g\n",pointsize);
5061 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5065 % D r a w S e t F o n t S t r e t c h %
5069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5071 % DrawSetFontStretch() sets the font stretch to use when annotating with text.
5072 % The AnyStretch enumeration acts as a wild-card "don't care" option.
5074 % The format of the DrawSetFontStretch method is:
5076 % void DrawSetFontStretch(DrawingWand *wand,
5077 % const StretchType font_stretch)
5079 % A description of each parameter follows:
5081 % o wand: the drawing wand.
5083 % o font_stretch: font stretch (NormalStretch, UltraCondensedStretch,
5084 % CondensedStretch, SemiCondensedStretch,
5085 % SemiExpandedStretch, ExpandedStretch,
5086 % ExtraExpandedStretch, UltraExpandedStretch, AnyStretch)
5089 WandExport void DrawSetFontStretch(DrawingWand *wand,
5090 const StretchType font_stretch)
5092 assert(wand != (DrawingWand *) NULL);
5093 assert(wand->signature == WandSignature);
5094 if (wand->debug != MagickFalse)
5095 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5096 if ((wand->filter_off != MagickFalse) ||
5097 (CurrentContext->stretch != font_stretch))
5099 CurrentContext->stretch=font_stretch;
5100 (void) MvgPrintf(wand, "font-stretch '%s'\n",CommandOptionToMnemonic(
5101 MagickStretchOptions,(ssize_t) font_stretch));
5106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5110 % D r a w S e t F o n t S t y l e %
5114 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5116 % DrawSetFontStyle() sets the font style to use when annotating with text.
5117 % The AnyStyle enumeration acts as a wild-card "don't care" option.
5119 % The format of the DrawSetFontStyle method is:
5121 % void DrawSetFontStyle(DrawingWand *wand,const StyleType style)
5123 % A description of each parameter follows:
5125 % o wand: the drawing wand.
5127 % o style: font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle)
5130 WandExport void DrawSetFontStyle(DrawingWand *wand,const StyleType style)
5132 assert(wand != (DrawingWand *) NULL);
5133 assert(wand->signature == WandSignature);
5134 if (wand->debug != MagickFalse)
5135 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5136 if ((wand->filter_off != MagickFalse) ||
5137 (CurrentContext->style != style))
5139 CurrentContext->style=style;
5140 (void) MvgPrintf(wand, "font-style '%s'\n",CommandOptionToMnemonic(
5141 MagickStyleOptions,(ssize_t) style));
5146 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5150 % D r a w S e t F o n t W e i g h t %
5154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5156 % DrawSetFontWeight() sets the font weight to use when annotating with text.
5158 % The format of the DrawSetFontWeight method is:
5160 % void DrawSetFontWeight(DrawingWand *wand,
5161 % const size_t font_weight)
5163 % A description of each parameter follows:
5165 % o wand: the drawing wand.
5167 % o font_weight: font weight (valid range 100-900)
5170 WandExport void DrawSetFontWeight(DrawingWand *wand,
5171 const size_t font_weight)
5173 assert(wand != (DrawingWand *) NULL);
5174 assert(wand->signature == WandSignature);
5175 if (wand->debug != MagickFalse)
5176 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5177 if ((wand->filter_off != MagickFalse) ||
5178 (CurrentContext->weight != font_weight))
5180 CurrentContext->weight=font_weight;
5181 (void) MvgPrintf(wand,"font-weight %.20g\n",(double) font_weight);
5186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5190 % D r a w S e t G r a v i t y %
5194 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5196 % DrawSetGravity() sets the text placement gravity to use when annotating
5199 % The format of the DrawSetGravity method is:
5201 % void DrawSetGravity(DrawingWand *wand,const GravityType gravity)
5203 % A description of each parameter follows:
5205 % o wand: the drawing wand.
5207 % o gravity: positioning gravity (NorthWestGravity, NorthGravity,
5208 % NorthEastGravity, WestGravity, CenterGravity,
5209 % EastGravity, SouthWestGravity, SouthGravity,
5213 WandExport void DrawSetGravity(DrawingWand *wand,const GravityType gravity)
5215 assert(wand != (DrawingWand *) NULL);
5216 assert(wand->signature == WandSignature);
5217 if (wand->debug != MagickFalse)
5218 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5219 if ((wand->filter_off != MagickFalse) ||
5220 (CurrentContext->gravity != gravity) || (gravity != ForgetGravity))
5222 CurrentContext->gravity=gravity;
5223 (void) MvgPrintf(wand,"gravity '%s'\n",CommandOptionToMnemonic(
5224 MagickGravityOptions,(ssize_t) gravity));
5229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5233 % D r a w S e t S t r o k e C o l o r %
5237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5239 % DrawSetStrokeColor() sets the color used for stroking object outlines.
5241 % The format of the DrawSetStrokeColor method is:
5243 % void DrawSetStrokeColor(DrawingWand *wand,
5244 % const PixelWand *stroke_wand)
5246 % A description of each parameter follows:
5248 % o wand: the drawing wand.
5250 % o stroke_wand: stroke wand.
5253 WandExport void DrawSetStrokeColor(DrawingWand *wand,
5254 const PixelWand *stroke_wand)
5261 assert(wand != (DrawingWand *) NULL);
5262 assert(wand->signature == WandSignature);
5263 if (wand->debug != MagickFalse)
5264 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5265 assert(stroke_wand != (const PixelWand *) NULL);
5266 PixelGetQuantumPacket(stroke_wand,&stroke_color);
5267 new_stroke=stroke_color;
5268 current_stroke=(&CurrentContext->stroke);
5269 if ((wand->filter_off != MagickFalse) ||
5270 (IsPixelPacketEquivalent(current_stroke,&new_stroke) == MagickFalse))
5272 CurrentContext->stroke=new_stroke;
5273 (void) MvgPrintf(wand,"stroke '");
5274 MvgAppendColor(wand,&stroke_color);
5275 (void) MvgPrintf(wand,"'\n");
5280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5284 % D r a w S e t S t r o k e P a t t e r n U R L %
5288 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5290 % DrawSetStrokePatternURL() sets the pattern used for stroking object outlines.
5292 % The format of the DrawSetStrokePatternURL method is:
5294 % MagickBooleanType DrawSetStrokePatternURL(DrawingWand *wand,
5295 % const char *stroke_url)
5297 % A description of each parameter follows:
5299 % o wand: the drawing wand.
5301 % o stroke_url: URL specifying pattern ID (e.g. "#pattern_id")
5304 WandExport MagickBooleanType DrawSetStrokePatternURL(DrawingWand *wand,
5305 const char *stroke_url)
5308 pattern[MaxTextExtent],
5309 pattern_spec[MaxTextExtent];
5311 assert(wand != (DrawingWand *) NULL);
5312 assert(wand->signature == WandSignature);
5313 if (wand->debug != MagickFalse)
5314 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5315 if (wand->image == (Image *) NULL)
5316 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
5317 assert(stroke_url != NULL);
5318 if (stroke_url[0] != '#')
5319 ThrowDrawException(DrawError,"NotARelativeURL",stroke_url);
5320 (void) FormatLocaleString(pattern,MaxTextExtent,"%s",stroke_url+1);
5321 if (GetImageArtifact(wand->image,pattern) == (const char *) NULL)
5323 ThrowDrawException(DrawError,"URLNotFound",stroke_url)
5324 return(MagickFalse);
5326 (void) FormatLocaleString(pattern_spec,MaxTextExtent,"url(%s)",stroke_url);
5327 #if DRAW_BINARY_IMPLEMENTATION
5328 DrawPatternPath(wand->image,CurrentContext,pattern_spec,
5329 &CurrentContext->stroke_pattern);
5331 if (CurrentContext->stroke.alpha != (Quantum) TransparentAlpha)
5332 CurrentContext->stroke.alpha=CurrentContext->alpha;
5333 (void) MvgPrintf(wand,"stroke %s\n",pattern_spec);
5338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5342 % D r a w S e t S t r o k e A n t i a l i a s %
5346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5348 % DrawSetStrokeAntialias() controls whether stroked outlines are antialiased.
5349 % Stroked outlines are antialiased by default. When antialiasing is disabled
5350 % stroked pixels are thresholded to determine if the stroke color or
5351 % underlying canvas color should be used.
5353 % The format of the DrawSetStrokeAntialias method is:
5355 % void DrawSetStrokeAntialias(DrawingWand *wand,
5356 % const MagickBooleanType stroke_antialias)
5358 % A description of each parameter follows:
5360 % o wand: the drawing wand.
5362 % o stroke_antialias: set to false (zero) to disable antialiasing
5365 WandExport void DrawSetStrokeAntialias(DrawingWand *wand,
5366 const MagickBooleanType stroke_antialias)
5368 assert(wand != (DrawingWand *) NULL);
5369 assert(wand->signature == WandSignature);
5370 if (wand->debug != MagickFalse)
5371 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5372 if ((wand->filter_off != MagickFalse) ||
5373 (CurrentContext->stroke_antialias != stroke_antialias))
5375 CurrentContext->stroke_antialias=stroke_antialias;
5376 (void) MvgPrintf(wand,"stroke-antialias %i\n",stroke_antialias != 0 ?
5382 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5386 % D r a w S e t S t r o k e D a s h A r r a y %
5390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5392 % DrawSetStrokeDashArray() specifies the pattern of dashes and gaps used to
5393 % stroke paths. The stroke dash array represents an array of numbers that
5394 % specify the lengths of alternating dashes and gaps in pixels. If an odd
5395 % number of values is provided, then the list of values is repeated to yield
5396 % an even number of values. To remove an existing dash array, pass a zero
5397 % number_elements argument and null dash_array. A typical stroke dash array
5398 % might contain the members 5 3 2.
5400 % The format of the DrawSetStrokeDashArray method is:
5402 % MagickBooleanType DrawSetStrokeDashArray(DrawingWand *wand,
5403 % const size_t number_elements,const double *dash_array)
5405 % A description of each parameter follows:
5407 % o wand: the drawing wand.
5409 % o number_elements: number of elements in dash array
5411 % o dash_array: dash array values
5414 WandExport MagickBooleanType DrawSetStrokeDashArray(DrawingWand *wand,
5415 const size_t number_elements,const double *dash_array)
5420 register const double
5433 assert(wand != (DrawingWand *) NULL);
5434 assert(wand->signature == WandSignature);
5435 if (wand->debug != MagickFalse)
5436 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5437 n_new=number_elements;
5440 q=CurrentContext->dash_pattern;
5441 if (q != (const double *) NULL)
5444 if ((n_old == 0) && (n_new == 0))
5450 if ((CurrentContext->dash_pattern != (double *) NULL) &&
5451 (dash_array != (double *) NULL))
5454 q=CurrentContext->dash_pattern;
5455 for (i=0; i < (ssize_t) n_new; i++)
5457 if (fabs((*p)-(*q)) > MagickEpsilon)
5466 if ((wand->filter_off != MagickFalse) || (update != MagickFalse))
5468 if (CurrentContext->dash_pattern != (double *) NULL)
5469 CurrentContext->dash_pattern=(double *)
5470 RelinquishMagickMemory(CurrentContext->dash_pattern);
5473 CurrentContext->dash_pattern=(double *) AcquireQuantumMemory((size_t)
5474 n_new+1UL,sizeof(*CurrentContext->dash_pattern));
5475 if (!CurrentContext->dash_pattern)
5477 ThrowDrawException(ResourceLimitError,"MemoryAllocationFailed",
5479 return(MagickFalse);
5481 q=CurrentContext->dash_pattern;
5483 for (i=0; i < (ssize_t) n_new; i++)
5487 (void) MvgPrintf(wand,"stroke-dasharray ");
5489 (void) MvgPrintf(wand,"none\n");
5493 (void) MvgPrintf(wand,"%g",*p++);
5494 for (i=1; i < (ssize_t) n_new; i++)
5495 (void) MvgPrintf(wand,",%g",*p++);
5496 (void) MvgPrintf(wand,"\n");
5503 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5507 % D r a w S e t S t r o k e D a s h O f f s e t %
5511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5513 % DrawSetStrokeDashOffset() specifies the offset into the dash pattern to
5516 % The format of the DrawSetStrokeDashOffset method is:
5518 % void DrawSetStrokeDashOffset(DrawingWand *wand,
5519 % const double dash_offset)
5521 % A description of each parameter follows:
5523 % o wand: the drawing wand.
5525 % o dash_offset: dash offset
5528 WandExport void DrawSetStrokeDashOffset(DrawingWand *wand,
5529 const double dash_offset)
5531 assert(wand != (DrawingWand *) NULL);
5532 assert(wand->signature == WandSignature);
5533 if (wand->debug != MagickFalse)
5534 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5535 if ((wand->filter_off != MagickFalse) ||
5536 (fabs(CurrentContext->dash_offset-dash_offset) > MagickEpsilon))
5538 CurrentContext->dash_offset=dash_offset;
5539 (void) MvgPrintf(wand,"stroke-dashoffset %g\n",dash_offset);
5544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5548 % D r a w S e t S t r o k e L i n e C a p %
5552 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5554 % DrawSetStrokeLineCap() specifies the shape to be used at the end of
5555 % open subpaths when they are stroked. Values of LineCap are
5556 % UndefinedCap, ButtCap, RoundCap, and SquareCap.
5558 % The format of the DrawSetStrokeLineCap method is:
5560 % void DrawSetStrokeLineCap(DrawingWand *wand,
5561 % const LineCap linecap)
5563 % A description of each parameter follows:
5565 % o wand: the drawing wand.
5567 % o linecap: linecap style
5570 WandExport void DrawSetStrokeLineCap(DrawingWand *wand,const LineCap linecap)
5572 assert(wand != (DrawingWand *) NULL);
5573 assert(wand->signature == WandSignature);
5574 if (wand->debug != MagickFalse)
5575 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5576 if ((wand->filter_off != MagickFalse) ||
5577 (CurrentContext->linecap != linecap))
5579 CurrentContext->linecap=linecap;
5580 (void) MvgPrintf(wand,"stroke-linecap '%s'\n",CommandOptionToMnemonic(
5581 MagickLineCapOptions,(ssize_t) linecap));
5586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5590 % D r a w S e t S t r o k e L i n e J o i n %
5594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5596 % DrawSetStrokeLineJoin() specifies the shape to be used at the corners of
5597 % paths (or other vector shapes) when they are stroked. Values of LineJoin are
5598 % UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.
5600 % The format of the DrawSetStrokeLineJoin method is:
5602 % void DrawSetStrokeLineJoin(DrawingWand *wand,
5603 % const LineJoin linejoin)
5605 % A description of each parameter follows:
5607 % o wand: the drawing wand.
5609 % o linejoin: line join style
5612 WandExport void DrawSetStrokeLineJoin(DrawingWand *wand,const LineJoin linejoin)
5614 assert(wand != (DrawingWand *) NULL);
5615 assert(wand->signature == WandSignature);
5616 if (wand->debug != MagickFalse)
5617 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5618 if ((wand->filter_off != MagickFalse) ||
5619 (CurrentContext->linejoin != linejoin))
5621 CurrentContext->linejoin=linejoin;
5622 (void) MvgPrintf(wand, "stroke-linejoin '%s'\n",CommandOptionToMnemonic(
5623 MagickLineJoinOptions,(ssize_t) linejoin));
5628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5632 % D r a w S e t S t r o k e M i t e r L i m i t %
5636 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5638 % DrawSetStrokeMiterLimit() specifies the miter limit. When two line
5639 % segments meet at a sharp angle and miter joins have been specified for
5640 % 'lineJoin', it is possible for the miter to extend far beyond the
5641 % thickness of the line stroking the path. The miterLimit' imposes a
5642 % limit on the ratio of the miter length to the 'lineWidth'.
5644 % The format of the DrawSetStrokeMiterLimit method is:
5646 % void DrawSetStrokeMiterLimit(DrawingWand *wand,
5647 % const size_t miterlimit)
5649 % A description of each parameter follows:
5651 % o wand: the drawing wand.
5653 % o miterlimit: miter limit
5656 WandExport void DrawSetStrokeMiterLimit(DrawingWand *wand,
5657 const size_t miterlimit)
5659 assert(wand != (DrawingWand *) NULL);
5660 assert(wand->signature == WandSignature);
5661 if (wand->debug != MagickFalse)
5662 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5663 if (CurrentContext->miterlimit != miterlimit)
5665 CurrentContext->miterlimit=miterlimit;
5666 (void) MvgPrintf(wand,"stroke-miterlimit %.20g\n",(double) miterlimit);
5671 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5675 % D r a w S e t S t r o k e O p a c i t y %
5679 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5681 % DrawSetStrokeOpacity() specifies the opacity of stroked object outlines.
5683 % The format of the DrawSetStrokeOpacity method is:
5685 % void DrawSetStrokeOpacity(DrawingWand *wand,
5686 % const double stroke_opacity)
5688 % A description of each parameter follows:
5690 % o wand: the drawing wand.
5692 % o stroke_opacity: stroke opacity. The value 1.0 is opaque.
5695 WandExport void DrawSetStrokeOpacity(DrawingWand *wand,
5696 const double stroke_opacity)
5701 assert(wand != (DrawingWand *) NULL);
5702 assert(wand->signature == WandSignature);
5703 if (wand->debug != MagickFalse)
5704 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5705 opacity=ClampToQuantum((double) QuantumRange*(1.0-stroke_opacity));
5706 if ((wand->filter_off != MagickFalse) ||
5707 (CurrentContext->stroke.alpha != opacity))
5709 CurrentContext->stroke.alpha=opacity;
5710 (void) MvgPrintf(wand,"stroke-opacity %g\n",stroke_opacity);
5715 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5719 % D r a w S e t S t r o k e W i d t h %
5723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5725 % DrawSetStrokeWidth() sets the width of the stroke used to draw object
5728 % The format of the DrawSetStrokeWidth method is:
5730 % void DrawSetStrokeWidth(DrawingWand *wand,
5731 % const double stroke_width)
5733 % A description of each parameter follows:
5735 % o wand: the drawing wand.
5737 % o stroke_width: stroke width
5740 WandExport void DrawSetStrokeWidth(DrawingWand *wand,const double stroke_width)
5742 assert(wand != (DrawingWand *) NULL);
5743 assert(wand->signature == WandSignature);
5744 if (wand->debug != MagickFalse)
5745 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5746 if ((wand->filter_off != MagickFalse) ||
5747 (fabs(CurrentContext->stroke_width-stroke_width) > MagickEpsilon))
5749 CurrentContext->stroke_width=stroke_width;
5750 (void) MvgPrintf(wand,"stroke-width %g\n",stroke_width);
5755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5759 % D r a w S e t T e x t A l i g n m e n t %
5763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5765 % DrawSetTextAlignment() specifies a text alignment to be applied when
5766 % annotating with text.
5768 % The format of the DrawSetTextAlignment method is:
5770 % void DrawSetTextAlignment(DrawingWand *wand,const AlignType alignment)
5772 % A description of each parameter follows:
5774 % o wand: the drawing wand.
5776 % o alignment: text alignment. One of UndefinedAlign, LeftAlign,
5777 % CenterAlign, or RightAlign.
5780 WandExport void DrawSetTextAlignment(DrawingWand *wand,
5781 const AlignType alignment)
5783 assert(wand != (DrawingWand *) NULL);
5784 assert(wand->signature == WandSignature);
5785 if (wand->debug != MagickFalse)
5786 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5787 if ((wand->filter_off != MagickFalse) ||
5788 (CurrentContext->align != alignment))
5790 CurrentContext->align=alignment;
5791 (void) MvgPrintf(wand,"text-align '%s'\n",CommandOptionToMnemonic(
5792 MagickAlignOptions,(ssize_t) alignment));
5797 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5801 % D r a w S e t T e x t A n t i a l i a s %
5805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5807 % DrawSetTextAntialias() controls whether text is antialiased. Text is
5808 % antialiased by default.
5810 % The format of the DrawSetTextAntialias method is:
5812 % void DrawSetTextAntialias(DrawingWand *wand,
5813 % const MagickBooleanType text_antialias)
5815 % A description of each parameter follows:
5817 % o wand: the drawing wand.
5819 % o text_antialias: antialias boolean. Set to false (0) to disable
5823 WandExport void DrawSetTextAntialias(DrawingWand *wand,
5824 const MagickBooleanType text_antialias)
5826 assert(wand != (DrawingWand *) NULL);
5827 assert(wand->signature == WandSignature);
5828 if (wand->debug != MagickFalse)
5829 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5830 if ((wand->filter_off != MagickFalse) ||
5831 (CurrentContext->text_antialias != text_antialias))
5833 CurrentContext->text_antialias=text_antialias;
5834 (void) MvgPrintf(wand,"text-antialias %i\n",text_antialias != 0 ? 1 : 0);
5839 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5843 % D r a w S e t T e x t D e c o r a t i o n %
5847 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5849 % DrawSetTextDecoration() specifies a decoration to be applied when
5850 % annotating with text.
5852 % The format of the DrawSetTextDecoration method is:
5854 % void DrawSetTextDecoration(DrawingWand *wand,
5855 % const DecorationType decoration)
5857 % A description of each parameter follows:
5859 % o wand: the drawing wand.
5861 % o decoration: text decoration. One of NoDecoration, UnderlineDecoration,
5862 % OverlineDecoration, or LineThroughDecoration
5865 WandExport void DrawSetTextDecoration(DrawingWand *wand,
5866 const DecorationType decoration)
5868 assert(wand != (DrawingWand *) NULL);
5869 assert(wand->signature == WandSignature);
5870 if (wand->debug != MagickFalse)
5871 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5872 if ((wand->filter_off != MagickFalse) ||
5873 (CurrentContext->decorate != decoration))
5875 CurrentContext->decorate=decoration;
5876 (void) MvgPrintf(wand,"decorate '%s'\n",CommandOptionToMnemonic(
5877 MagickDecorateOptions,(ssize_t) decoration));
5882 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5886 % D r a w S e t T e x t E n c o d i n g %
5890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5892 % DrawSetTextEncoding() specifies the code set to use for text
5893 % annotations. The only character encoding which may be specified
5894 % at this time is "UTF-8" for representing Unicode as a sequence of
5895 % bytes. Specify an empty string to set text encoding to the system's
5896 % default. Successful text annotation using Unicode may require fonts
5897 % designed to support Unicode.
5899 % The format of the DrawSetTextEncoding method is:
5901 % void DrawSetTextEncoding(DrawingWand *wand,const char *encoding)
5903 % A description of each parameter follows:
5905 % o wand: the drawing wand.
5907 % o encoding: character string specifying text encoding
5910 WandExport void DrawSetTextEncoding(DrawingWand *wand,const char *encoding)
5912 assert(wand != (DrawingWand *) NULL);
5913 assert(wand->signature == WandSignature);
5914 if (wand->debug != MagickFalse)
5915 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5916 assert(encoding != (char *) NULL);
5917 if ((wand->filter_off != MagickFalse) ||
5918 (CurrentContext->encoding == (char *) NULL) ||
5919 (LocaleCompare(CurrentContext->encoding,encoding) != 0))
5921 (void) CloneString(&CurrentContext->encoding,encoding);
5922 (void) MvgPrintf(wand,"encoding '%s'\n",encoding);
5927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5931 % D r a w S e t T e x t K e r n i n g %
5935 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5937 % DrawSetTextKerning() sets the spacing between characters in text.
5939 % The format of the DrawSetTextKerning method is:
5941 % void DrawSetTextKerning(DrawingWand *wand,const double kerning)
5943 % A description of each parameter follows:
5945 % o wand: the drawing wand.
5947 % o kerning: text kerning
5950 WandExport void DrawSetTextKerning(DrawingWand *wand,const double kerning)
5952 assert(wand != (DrawingWand *) NULL);
5953 assert(wand->signature == WandSignature);
5955 if (wand->debug != MagickFalse)
5956 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5957 if ((wand->filter_off != MagickFalse) &&
5958 (CurrentContext->kerning != kerning))
5960 CurrentContext->kerning=kerning;
5961 (void) MvgPrintf(wand,"kerning %lf\n",kerning);
5966 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5970 % D r a w S e t T e x t I n t e r L i n e S p a c i n g %
5974 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5976 % DrawSetTextInterwordSpacing() sets the spacing between line in text.
5978 % The format of the DrawSetInterwordSpacing method is:
5980 % void DrawSetTextInterwordSpacing(DrawingWand *wand,
5981 % const double interline_spacing)
5983 % A description of each parameter follows:
5985 % o wand: the drawing wand.
5987 % o interline_spacing: text line spacing
5990 WandExport void DrawSetTextInterlineSpacing(DrawingWand *wand,
5991 const double interline_spacing)
5993 assert(wand != (DrawingWand *) NULL);
5994 assert(wand->signature == WandSignature);
5996 if (wand->debug != MagickFalse)
5997 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
5998 if ((wand->filter_off != MagickFalse) &&
5999 (CurrentContext->interline_spacing != interline_spacing))
6001 CurrentContext->interline_spacing=interline_spacing;
6002 (void) MvgPrintf(wand,"interline-spacing %lf\n",interline_spacing);
6007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6011 % D r a w S e t T e x t I n t e r w o r d S p a c i n g %
6015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6017 % DrawSetTextInterwordSpacing() sets the spacing between words in text.
6019 % The format of the DrawSetInterwordSpacing method is:
6021 % void DrawSetTextInterwordSpacing(DrawingWand *wand,
6022 % const double interword_spacing)
6024 % A description of each parameter follows:
6026 % o wand: the drawing wand.
6028 % o interword_spacing: text word spacing
6031 WandExport void DrawSetTextInterwordSpacing(DrawingWand *wand,
6032 const double interword_spacing)
6034 assert(wand != (DrawingWand *) NULL);
6035 assert(wand->signature == WandSignature);
6037 if (wand->debug != MagickFalse)
6038 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6039 if ((wand->filter_off != MagickFalse) &&
6040 (CurrentContext->interword_spacing != interword_spacing))
6042 CurrentContext->interword_spacing=interword_spacing;
6043 (void) MvgPrintf(wand,"interword-spacing %lf\n",interword_spacing);
6048 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6052 % D r a w S e t T e x t U n d e r C o l o r %
6056 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6058 % DrawSetTextUnderColor() specifies the color of a background rectangle
6059 % to place under text annotations.
6061 % The format of the DrawSetTextUnderColor method is:
6063 % void DrawSetTextUnderColor(DrawingWand *wand,
6064 % const PixelWand *under_wand)
6066 % A description of each parameter follows:
6068 % o wand: the drawing wand.
6070 % o under_wand: text under wand.
6073 WandExport void DrawSetTextUnderColor(DrawingWand *wand,
6074 const PixelWand *under_wand)
6079 assert(wand != (DrawingWand *) NULL);
6080 assert(wand->signature == WandSignature);
6081 if (wand->debug != MagickFalse)
6082 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6083 assert(under_wand != (const PixelWand *) NULL);
6084 PixelGetQuantumPacket(under_wand,&under_color);
6085 if ((wand->filter_off != MagickFalse) ||
6086 (IsPixelPacketEquivalent(&CurrentContext->undercolor,&under_color) == MagickFalse))
6088 CurrentContext->undercolor=under_color;
6089 (void) MvgPrintf(wand,"text-undercolor '");
6090 MvgAppendColor(wand,&under_color);
6091 (void) MvgPrintf(wand,"'\n");
6096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6100 % D r a w S e t V e c t o r G r a p h i c s %
6104 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6106 % DrawSetVectorGraphics() sets the vector graphics associated with the
6107 % specified wand. Use this method with DrawGetVectorGraphics() as a method
6108 % to persist the vector graphics state.
6110 % The format of the DrawSetVectorGraphics method is:
6112 % MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
6115 % A description of each parameter follows:
6117 % o wand: the drawing wand.
6119 % o xml: the drawing wand XML.
6123 static inline MagickBooleanType IsPoint(const char *point)
6131 value=strtol(point,&p,10);
6133 return(p != point ? MagickTrue : MagickFalse);
6136 WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
6146 assert(wand != (DrawingWand *) NULL);
6147 assert(wand->signature == WandSignature);
6148 if (wand->debug != MagickFalse)
6149 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6150 CurrentContext=DestroyDrawInfo(CurrentContext);
6151 CurrentContext=CloneDrawInfo((ImageInfo *) NULL,(DrawInfo *) NULL);
6152 if (xml == (const char *) NULL)
6153 return(MagickFalse);
6154 xml_info=NewXMLTree(xml,wand->exception);
6155 if (xml_info == (XMLTreeInfo *) NULL)
6156 return(MagickFalse);
6157 child=GetXMLTreeChild(xml_info,"clip-path");
6158 if (child != (XMLTreeInfo *) NULL)
6159 (void) CloneString(&CurrentContext->clip_mask,GetXMLTreeContent(child));
6160 child=GetXMLTreeChild(xml_info,"clip-units");
6161 if (child != (XMLTreeInfo *) NULL)
6163 value=GetXMLTreeContent(child);
6164 if (value != (const char *) NULL)
6165 CurrentContext->clip_units=(ClipPathUnits) ParseCommandOption(
6166 MagickClipPathOptions,MagickFalse,value);
6168 child=GetXMLTreeChild(xml_info,"decorate");
6169 if (child != (XMLTreeInfo *) NULL)
6171 value=GetXMLTreeContent(child);
6172 if (value != (const char *) NULL)
6173 CurrentContext->decorate=(DecorationType) ParseCommandOption(
6174 MagickDecorateOptions,MagickFalse,value);
6176 child=GetXMLTreeChild(xml_info,"encoding");
6177 if (child != (XMLTreeInfo *) NULL)
6178 (void) CloneString(&CurrentContext->encoding,GetXMLTreeContent(child));
6179 child=GetXMLTreeChild(xml_info,"fill");
6180 if (child != (XMLTreeInfo *) NULL)
6182 value=GetXMLTreeContent(child);
6183 if (value != (const char *) NULL)
6184 (void) QueryColorDatabase(value,&CurrentContext->fill,wand->exception);
6186 child=GetXMLTreeChild(xml_info,"fill-opacity");
6187 if (child != (XMLTreeInfo *) NULL)
6189 value=GetXMLTreeContent(child);
6190 if (value != (const char *) NULL)
6191 CurrentContext->fill.alpha=ClampToQuantum((MagickRealType)
6192 QuantumRange*(1.0-InterpretLocaleValue(value,(char **) NULL)));
6194 child=GetXMLTreeChild(xml_info,"fill-rule");
6195 if (child != (XMLTreeInfo *) NULL)
6197 value=GetXMLTreeContent(child);
6198 if (value != (const char *) NULL)
6199 CurrentContext->fill_rule=(FillRule) ParseCommandOption(
6200 MagickFillRuleOptions,MagickFalse,value);
6202 child=GetXMLTreeChild(xml_info,"font");
6203 if (child != (XMLTreeInfo *) NULL)
6204 (void) CloneString(&CurrentContext->font,GetXMLTreeContent(child));
6205 child=GetXMLTreeChild(xml_info,"font-family");
6206 if (child != (XMLTreeInfo *) NULL)
6207 (void) CloneString(&CurrentContext->family,GetXMLTreeContent(child));
6208 child=GetXMLTreeChild(xml_info,"font-size");
6209 if (child != (XMLTreeInfo *) NULL)
6211 value=GetXMLTreeContent(child);
6212 if (value != (const char *) NULL)
6213 CurrentContext->pointsize=InterpretLocaleValue(value,(char **) NULL);
6215 child=GetXMLTreeChild(xml_info,"font-stretch");
6216 if (child != (XMLTreeInfo *) NULL)
6218 value=GetXMLTreeContent(child);
6219 if (value != (const char *) NULL)
6220 CurrentContext->stretch=(StretchType) ParseCommandOption(
6221 MagickStretchOptions,MagickFalse,value);
6223 child=GetXMLTreeChild(xml_info,"font-style");
6224 if (child != (XMLTreeInfo *) NULL)
6226 value=GetXMLTreeContent(child);
6227 if (value != (const char *) NULL)
6228 CurrentContext->style=(StyleType) ParseCommandOption(MagickStyleOptions,
6231 child=GetXMLTreeChild(xml_info,"font-weight");
6232 if (child != (XMLTreeInfo *) NULL)
6234 value=GetXMLTreeContent(child);
6235 if (value != (const char *) NULL)
6236 CurrentContext->weight=StringToUnsignedLong(value);
6238 child=GetXMLTreeChild(xml_info,"gravity");
6239 if (child != (XMLTreeInfo *) NULL)
6241 value=GetXMLTreeContent(child);
6242 if (value != (const char *) NULL)
6243 CurrentContext->gravity=(GravityType) ParseCommandOption(
6244 MagickGravityOptions,MagickFalse,value);
6246 child=GetXMLTreeChild(xml_info,"stroke");
6247 if (child != (XMLTreeInfo *) NULL)
6249 value=GetXMLTreeContent(child);
6250 if (value != (const char *) NULL)
6251 (void) QueryColorDatabase(value,&CurrentContext->stroke,
6254 child=GetXMLTreeChild(xml_info,"stroke-antialias");
6255 if (child != (XMLTreeInfo *) NULL)
6257 value=GetXMLTreeContent(child);
6258 if (value != (const char *) NULL)
6259 CurrentContext->stroke_antialias=StringToLong(value) != 0 ? MagickTrue :
6262 child=GetXMLTreeChild(xml_info,"stroke-dasharray");
6263 if (child != (XMLTreeInfo *) NULL)
6266 token[MaxTextExtent];
6277 value=GetXMLTreeContent(child);
6278 if (value != (const char *) NULL)
6280 if (CurrentContext->dash_pattern != (double *) NULL)
6281 CurrentContext->dash_pattern=(double *) RelinquishMagickMemory(
6282 CurrentContext->dash_pattern);
6284 if (IsPoint(q) != MagickFalse)
6290 GetMagickToken(p,&p,token);
6292 GetMagickToken(p,&p,token);
6293 for (x=0; IsPoint(token) != MagickFalse; x++)
6295 GetMagickToken(p,&p,token);
6297 GetMagickToken(p,&p,token);
6299 CurrentContext->dash_pattern=(double *) AcquireQuantumMemory(
6300 (size_t) (2UL*x)+1UL,sizeof(*CurrentContext->dash_pattern));
6301 if (CurrentContext->dash_pattern == (double *) NULL)
6302 ThrowWandFatalException(ResourceLimitFatalError,
6303 "MemoryAllocationFailed",wand->name);
6304 for (j=0; j < x; j++)
6306 GetMagickToken(q,&q,token);
6308 GetMagickToken(q,&q,token);
6309 CurrentContext->dash_pattern[j]=InterpretLocaleValue(token,
6312 if ((x & 0x01) != 0)
6313 for ( ; j < (2*x); j++)
6314 CurrentContext->dash_pattern[j]=
6315 CurrentContext->dash_pattern[j-x];
6316 CurrentContext->dash_pattern[j]=0.0;
6320 child=GetXMLTreeChild(xml_info,"stroke-dashoffset");
6321 if (child != (XMLTreeInfo *) NULL)
6323 value=GetXMLTreeContent(child);
6324 if (value != (const char *) NULL)
6325 CurrentContext->dash_offset=InterpretLocaleValue(value,(char **) NULL);
6327 child=GetXMLTreeChild(xml_info,"stroke-linecap");
6328 if (child != (XMLTreeInfo *) NULL)
6330 value=GetXMLTreeContent(child);
6331 if (value != (const char *) NULL)
6332 CurrentContext->linecap=(LineCap) ParseCommandOption(
6333 MagickLineCapOptions,MagickFalse,value);
6335 child=GetXMLTreeChild(xml_info,"stroke-linejoin");
6336 if (child != (XMLTreeInfo *) NULL)
6338 value=GetXMLTreeContent(child);
6339 if (value != (const char *) NULL)
6340 CurrentContext->linejoin=(LineJoin) ParseCommandOption(
6341 MagickLineJoinOptions,MagickFalse,value);
6343 child=GetXMLTreeChild(xml_info,"stroke-miterlimit");
6344 if (child != (XMLTreeInfo *) NULL)
6346 value=GetXMLTreeContent(child);
6347 if (value != (const char *) NULL)
6348 CurrentContext->miterlimit=StringToUnsignedLong(value);
6350 child=GetXMLTreeChild(xml_info,"stroke-opacity");
6351 if (child != (XMLTreeInfo *) NULL)
6353 value=GetXMLTreeContent(child);
6354 if (value != (const char *) NULL)
6355 CurrentContext->stroke.alpha=ClampToQuantum((MagickRealType)
6356 QuantumRange*(1.0-InterpretLocaleValue(value,(char **) NULL)));
6358 child=GetXMLTreeChild(xml_info,"stroke-width");
6359 if (child != (XMLTreeInfo *) NULL)
6361 value=GetXMLTreeContent(child);
6362 if (value != (const char *) NULL)
6363 CurrentContext->stroke_width=InterpretLocaleValue(value,(char **) NULL);
6365 child=GetXMLTreeChild(xml_info,"text-align");
6366 if (child != (XMLTreeInfo *) NULL)
6368 value=GetXMLTreeContent(child);
6369 if (value != (const char *) NULL)
6370 CurrentContext->align=(AlignType) ParseCommandOption(MagickAlignOptions,
6373 child=GetXMLTreeChild(xml_info,"text-antialias");
6374 if (child != (XMLTreeInfo *) NULL)
6376 value=GetXMLTreeContent(child);
6377 if (value != (const char *) NULL)
6378 CurrentContext->text_antialias=StringToLong(value) != 0 ? MagickTrue :
6381 child=GetXMLTreeChild(xml_info,"text-undercolor");
6382 if (child != (XMLTreeInfo *) NULL)
6384 value=GetXMLTreeContent(child);
6385 if (value != (const char *) NULL)
6386 (void) QueryColorDatabase(value,&CurrentContext->undercolor,
6389 child=GetXMLTreeChild(xml_info,"vector-graphics");
6390 if (child != (XMLTreeInfo *) NULL)
6392 (void) CloneString(&wand->mvg,GetXMLTreeContent(child));
6393 wand->mvg_length=strlen(wand->mvg);
6394 wand->mvg_alloc=wand->mvg_length+1;
6396 xml_info=DestroyXMLTree(xml_info);
6401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6405 % D r a w S k e w X %
6409 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6411 % DrawSkewX() skews the current coordinate system in the horizontal
6414 % The format of the DrawSkewX method is:
6416 % void DrawSkewX(DrawingWand *wand,const double degrees)
6418 % A description of each parameter follows:
6420 % o wand: the drawing wand.
6422 % o degrees: number of degrees to skew the coordinates
6425 WandExport void DrawSkewX(DrawingWand *wand,const double degrees)
6427 assert(wand != (DrawingWand *) NULL);
6428 assert(wand->signature == WandSignature);
6429 if (wand->debug != MagickFalse)
6430 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6431 (void) MvgPrintf(wand,"skewX %g\n",degrees);
6435 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6439 % D r a w S k e w Y %
6443 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6445 % DrawSkewY() skews the current coordinate system in the vertical
6448 % The format of the DrawSkewY method is:
6450 % void DrawSkewY(DrawingWand *wand,const double degrees)
6452 % A description of each parameter follows:
6454 % o wand: the drawing wand.
6456 % o degrees: number of degrees to skew the coordinates
6459 WandExport void DrawSkewY(DrawingWand *wand,const double degrees)
6461 assert(wand != (DrawingWand *) NULL);
6462 assert(wand->signature == WandSignature);
6463 if (wand->debug != MagickFalse)
6464 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6465 (void) MvgPrintf(wand,"skewY %g\n",degrees);
6469 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6473 % D r a w T r a n s l a t e %
6477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6479 % DrawTranslate() applies a translation to the current coordinate
6480 % system which moves the coordinate system origin to the specified
6483 % The format of the DrawTranslate method is:
6485 % void DrawTranslate(DrawingWand *wand,const double x,
6488 % A description of each parameter follows:
6490 % o wand: the drawing wand.
6492 % o x: new x ordinate for coordinate system origin
6494 % o y: new y ordinate for coordinate system origin
6497 WandExport void DrawTranslate(DrawingWand *wand,const double x,const double y)
6499 assert(wand != (DrawingWand *) NULL);
6500 assert(wand->signature == WandSignature);
6501 if (wand->debug != MagickFalse)
6502 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6503 (void) MvgPrintf(wand,"translate %g %g\n",x,y);
6507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6511 % D r a w S e t V i e w b o x %
6515 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6517 % DrawSetViewbox() sets the overall canvas size to be recorded with the
6518 % drawing vector data. Usually this will be specified using the same
6519 % size as the canvas image. When the vector data is saved to SVG or MVG
6520 % formats, the viewbox is use to specify the size of the canvas image that
6521 % a viewer will render the vector data on.
6523 % The format of the DrawSetViewbox method is:
6525 % void DrawSetViewbox(DrawingWand *wand,size_t x1,
6526 % size_t y1,size_t x2,size_t y2)
6528 % A description of each parameter follows:
6530 % o wand: the drawing wand.
6532 % o x1: left x ordinate
6534 % o y1: top y ordinate
6536 % o x2: right x ordinate
6538 % o y2: bottom y ordinate
6541 WandExport void DrawSetViewbox(DrawingWand *wand,ssize_t x1,ssize_t y1,
6542 ssize_t x2,ssize_t y2)
6544 assert(wand != (DrawingWand *) NULL);
6545 assert(wand->signature == WandSignature);
6546 if (wand->debug != MagickFalse)
6547 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6548 (void) MvgPrintf(wand,"viewbox %.20g %.20g %.20g %.20g\n",(double) x1,
6549 (double) y1,(double) x2,(double) y2);
6553 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6557 % I s D r a w i n g W a n d %
6561 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6563 % IsDrawingWand() returns MagickTrue if the wand is verified as a drawing wand.
6565 % The format of the IsDrawingWand method is:
6567 % MagickBooleanType IsDrawingWand(const DrawingWand *wand)
6569 % A description of each parameter follows:
6571 % o wand: the drawing wand.
6574 WandExport MagickBooleanType IsDrawingWand(const DrawingWand *wand)
6576 if (wand == (const DrawingWand *) NULL)
6577 return(MagickFalse);
6578 if (wand->signature != WandSignature)
6579 return(MagickFalse);
6580 if (LocaleNCompare(wand->name,DrawingWandId,strlen(DrawingWandId)) != 0)
6581 return(MagickFalse);
6586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6590 % N e w D r a w i n g W a n d %
6594 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6596 % NewDrawingWand() returns a drawing wand required for all other methods in
6599 % The format of the NewDrawingWand method is:
6601 % DrawingWand NewDrawingWand(void)
6604 WandExport DrawingWand *NewDrawingWand(void)
6615 quantum=GetMagickQuantumDepth(&depth);
6616 if (depth != MAGICKCORE_QUANTUM_DEPTH)
6617 ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
6618 wand=(DrawingWand *) AcquireMagickMemory(sizeof(*wand));
6619 if (wand == (DrawingWand *) NULL)
6620 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
6621 GetExceptionMessage(errno));
6622 (void) ResetMagickMemory(wand,0,sizeof(*wand));
6623 wand->id=AcquireWandId();
6624 (void) FormatLocaleString(wand->name,MaxTextExtent,"%s-%.20g",DrawingWandId,
6626 if (wand->debug != MagickFalse)
6627 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6628 wand->mvg=(char *) NULL;
6632 wand->pattern_id=(char *) NULL;
6633 wand->pattern_offset=0;
6634 wand->pattern_bounds.x=0;
6635 wand->pattern_bounds.y=0;
6636 wand->pattern_bounds.width=0;
6637 wand->pattern_bounds.height=0;
6639 wand->graphic_context=(DrawInfo **) AcquireMagickMemory(sizeof(
6640 *wand->graphic_context));
6641 if (wand->graphic_context == (DrawInfo **) NULL)
6642 ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
6643 GetExceptionMessage(errno));
6644 wand->filter_off=MagickTrue;
6645 wand->indent_depth=0;
6646 wand->path_operation=PathDefaultOperation;
6647 wand->path_mode=DefaultPathMode;
6648 wand->image=AcquireImage((const ImageInfo *) NULL);
6649 wand->exception=AcquireExceptionInfo();
6650 wand->destroy=MagickTrue;
6651 wand->debug=IsEventLogging();
6652 wand->signature=WandSignature;
6653 CurrentContext=CloneDrawInfo((ImageInfo *) NULL,(DrawInfo *) NULL);
6658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6662 % P e e k D r a w i n g W a n d %
6666 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6668 % PeekDrawingWand() returns the current drawing wand.
6670 % The format of the PeekDrawingWand method is:
6672 % DrawInfo *PeekDrawingWand(const DrawingWand *wand)
6674 % A description of each parameter follows:
6676 % o wand: the drawing wand.
6679 WandExport DrawInfo *PeekDrawingWand(const DrawingWand *wand)
6684 assert(wand != (const DrawingWand *) NULL);
6685 assert(wand->signature == WandSignature);
6686 if (wand->debug != MagickFalse)
6687 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6688 draw_info=CloneDrawInfo((ImageInfo *) NULL,CurrentContext);
6689 GetAffineMatrix(&draw_info->affine);
6690 (void) CloneString(&draw_info->primitive,wand->mvg);
6695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6699 % P o p D r a w i n g W a n d %
6703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6705 % PopDrawingWand() destroys the current drawing wand and returns to the
6706 % previously pushed drawing wand. Multiple drawing wands may exist. It is an
6707 % error to attempt to pop more drawing wands than have been pushed, and it is
6708 % proper form to pop all drawing wands which have been pushed.
6710 % The format of the PopDrawingWand method is:
6712 % MagickBooleanType PopDrawingWand(DrawingWand *wand)
6714 % A description of each parameter follows:
6716 % o wand: the drawing wand.
6719 WandExport MagickBooleanType PopDrawingWand(DrawingWand *wand)
6721 assert(wand != (DrawingWand *) NULL);
6722 assert(wand->signature == WandSignature);
6723 if (wand->debug != MagickFalse)
6724 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6725 if (wand->index == 0)
6727 ThrowDrawException(DrawError,"UnbalancedGraphicContextPushPop",wand->name)
6728 return(MagickFalse);
6731 Destroy clip path if not same in preceding wand.
6733 #if DRAW_BINARY_IMPLEMENTATION
6734 if (wand->image == (Image *) NULL)
6735 ThrowDrawException(WandError,"ContainsNoImages",wand->name);
6736 if (CurrentContext->clip_mask != (char *) NULL)
6737 if (LocaleCompare(CurrentContext->clip_mask,
6738 wand->graphic_context[wand->index-1]->clip_mask) != 0)
6739 (void) SetImageClipMask(wand->image,(Image *) NULL);
6741 CurrentContext=DestroyDrawInfo(CurrentContext);
6743 if (wand->indent_depth > 0)
6744 wand->indent_depth--;
6745 (void) MvgPrintf(wand,"pop graphic-context\n");
6750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6754 % P u s h D r a w i n g W a n d %
6758 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6760 % PushDrawingWand() clones the current drawing wand to create a new drawing
6761 % wand. The original drawing wand(s) may be returned to by invoking
6762 % PopDrawingWand(). The drawing wands are stored on a drawing wand stack.
6763 % For every Pop there must have already been an equivalent Push.
6765 % The format of the PushDrawingWand method is:
6767 % MagickBooleanType PushDrawingWand(DrawingWand *wand)
6769 % A description of each parameter follows:
6771 % o wand: the drawing wand.
6774 WandExport MagickBooleanType PushDrawingWand(DrawingWand *wand)
6776 assert(wand != (DrawingWand *) NULL);
6777 assert(wand->signature == WandSignature);
6778 if (wand->debug != MagickFalse)
6779 (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
6781 wand->graphic_context=(DrawInfo **) ResizeQuantumMemory(wand->graphic_context,
6782 (size_t) wand->index+1UL,sizeof(*wand->graphic_context));
6783 if (wand->graphic_context == (DrawInfo **) NULL)
6785 ThrowDrawException(ResourceLimitError,"MemoryAllocationFailed",
6787 return(MagickFalse);
6789 CurrentContext=CloneDrawInfo((ImageInfo *) NULL,
6790 wand->graphic_context[wand->index-1]);
6791 (void) MvgPrintf(wand,"push graphic-context\n");
6792 wand->indent_depth++;