Magick++  7.1.2-29
Convert, Edit, Or Compose Bitmap Images
Drawable.cpp
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4 //
5 // Copyright @ 2014 ImageMagick Studio LLC, a non-profit organization
6 // dedicated to making software imaging solutions freely available.
7 //
8 // Implementation of Drawable (Graphic objects)
9 //
10 
11 #define MAGICKCORE_IMPLEMENTATION 1
12 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
13 #define MAGICK_DRAWABLE_IMPLEMENTATION
14 
15 #include "Magick++/Include.h"
16 #include <math.h>
17 #include <string>
18 
19 #include "Magick++/Drawable.h"
20 #include "Magick++/Image.h"
21 
22 using namespace std;
23 
24 MagickPPExport int Magick::operator == (const Magick::Coordinate& left_,
25  const Magick::Coordinate& right_)
26 {
27  return((left_.x() == right_.x()) && (left_.y() == right_.y()));
28 }
29 
30 MagickPPExport int Magick::operator != (const Magick::Coordinate& left_,
31  const Magick::Coordinate& right_)
32 {
33  return(!(left_ == right_));
34 }
35 
36 MagickPPExport int Magick::operator > (const Magick::Coordinate& left_,
37  const Magick::Coordinate& right_)
38 {
39  return (!(left_ < right_) && (left_ != right_));
40 }
41 
42 MagickPPExport int Magick::operator < (const Magick::Coordinate& left_,
43  const Magick::Coordinate& right_)
44 {
45  // Based on distance from origin
46  return((sqrt(left_.x()*left_.x() + left_.y()*left_.y())) <
47  (sqrt(right_.x()*right_.x() + right_.y()*right_.y())));
48 }
49 
50 MagickPPExport int Magick::operator >= (const Magick::Coordinate& left_,
51  const Magick::Coordinate& right_)
52 {
53  return((left_ > right_) || (left_ == right_));
54 }
55 
56 MagickPPExport int Magick::operator <= (const Magick::Coordinate& left_,
57  const Magick::Coordinate& right_)
58 {
59  return((left_ < right_) || (left_ == right_));
60 }
61 
62 /* DrawableBase */
63 Magick::DrawableBase::DrawableBase()
64 {
65 }
66 
67 Magick::DrawableBase::~DrawableBase(void)
68 {
69 }
70 
71 void Magick::DrawableBase::operator()(MagickCore::DrawingWand * context_) const
72 {
73  (void) context_;
74 }
75 
76 Magick::DrawableBase* Magick::DrawableBase::copy() const
77 {
78  return new DrawableBase(*this);
79 }
80 
81 /* Drawable */
82 Magick::Drawable::Drawable(void)
83  : dp((Magick::DrawableBase *) NULL)
84 {
85 }
86 
87 Magick::Drawable::Drawable(const Magick::DrawableBase& original_)
88  : dp(original_.copy())
89 {
90 }
91 
92 Magick::Drawable::~Drawable(void)
93 {
94  delete dp;
95  dp=(Magick::DrawableBase *) NULL;
96 }
97 
98 Magick::Drawable::Drawable(const Magick::Drawable& original_)
99  : dp((original_.dp != (Magick::DrawableBase *) NULL ? original_.dp->copy() :
100  (Magick::DrawableBase *) NULL))
101 {
102 }
103 
104 Magick::Drawable& Magick::Drawable::operator= (
105  const Magick::Drawable& original_)
106 {
107  DrawableBase
108  *temp_dp;
109 
110  if (this != &original_)
111  {
112  temp_dp=(original_.dp != (Magick::DrawableBase *) NULL ?
113  original_.dp->copy() : (Magick::DrawableBase *) NULL);
114  delete dp;
115  dp=temp_dp;
116  }
117  return(*this);
118 }
119 
120 void Magick::Drawable::operator()(MagickCore::DrawingWand * context_) const
121 {
122  if (dp != (Magick::DrawableBase *) NULL)
123  dp->operator()(context_);
124 }
125 
126 /*virtual*/
127 Magick::VPathBase::~VPathBase ( void )
128 {
129 }
130 
131 // Constructor
132 Magick::VPath::VPath ( void )
133  : dp(0)
134 {
135 }
136 
137 // Construct from VPathBase
138 Magick::VPath::VPath ( const Magick::VPathBase& original_ )
139  : dp(original_.copy())
140 {
141 }
142 
143 // Destructor
144 /* virtual */ Magick::VPath::~VPath ( void )
145 {
146  delete dp;
147  dp = 0;
148 }
149 
150 // Copy constructor
151 Magick::VPath::VPath ( const Magick::VPath& original_ )
152  : dp(original_.dp? original_.dp->copy(): 0)
153 {
154 }
155 
156 // Assignment operator
157 Magick::VPath& Magick::VPath::operator= (const Magick::VPath& original_ )
158 {
159  if (this != &original_)
160  {
161  VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
162  delete dp;
163  dp = temp_dp;
164  }
165  return *this;
166 }
167 
168 // Operator to invoke contained object
169 void Magick::VPath::operator()( MagickCore::DrawingWand * context_ ) const
170 {
171  if(dp)
172  dp->operator()( context_ );
173 }
174 
175 //
176 // Drawable Objects
177 //
178 
179 // Affine (scaling, rotation, and translation)
180 Magick::DrawableAffine::DrawableAffine( double sx_, double sy_,
181  double rx_, double ry_,
182  double tx_, double ty_ )
183 {
184  _affine.sx = sx_;
185  _affine.rx = rx_;
186  _affine.ry = ry_;
187  _affine.sy = sy_;
188  _affine.tx = tx_;
189  _affine.ty = ty_;
190 }
191 Magick::DrawableAffine::DrawableAffine( void )
192 {
193  GetAffineMatrix(&_affine);
194 }
195 Magick::DrawableAffine::~DrawableAffine( void )
196 {
197 }
198 void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ ) const
199 {
200  DrawAffine( context_, &_affine );
201 }
202 Magick::DrawableBase* Magick::DrawableAffine::copy() const
203 {
204  return new DrawableAffine(*this);
205 }
206 
207 Magick::DrawableAlpha::~DrawableAlpha(void)
208 {
209 }
210 
211 void Magick::DrawableAlpha::operator()(MagickCore::DrawingWand * context_) const
212 {
213  DrawAlpha(context_,_x,_y,_paintMethod);
214 }
215 
216 Magick::DrawableBase* Magick::DrawableAlpha::copy() const
217 {
218  return new DrawableAlpha(*this);
219 }
220 
221 // Arc
222 Magick::DrawableArc::~DrawableArc( void )
223 {
224 }
225 void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ ) const
226 {
227  DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
228 }
229 Magick::DrawableBase* Magick::DrawableArc::copy() const
230 {
231  return new DrawableArc(*this);
232 }
233 
234 //
235 // Bezier curve
236 //
237 // Construct from coordinates (Coordinate list must contain at least three members)
238 Magick::DrawableBezier::DrawableBezier ( const CoordinateList &coordinates_ )
239  : _coordinates(coordinates_)
240 {
241 }
242 // Copy constructor
243 Magick::DrawableBezier::DrawableBezier( const Magick::DrawableBezier& original_ )
244  : DrawableBase (original_),
245  _coordinates(original_._coordinates)
246 {
247 }
248 // Destructor
249 Magick::DrawableBezier::~DrawableBezier( void )
250 {
251 }
252 void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ ) const
253 {
254  size_t num_coords = (size_t) _coordinates.size();
255  PointInfo *coordinates = new PointInfo[num_coords];
256 
257  PointInfo *q = coordinates;
258  CoordinateList::const_iterator p = _coordinates.begin();
259 
260  while( p != _coordinates.end() )
261  {
262  q->x = p->x();
263  q->y = p->y();
264  q++;
265  p++;
266  }
267 
268  DrawBezier( context_, num_coords, coordinates );
269  delete [] coordinates;
270 }
271 Magick::DrawableBase* Magick::DrawableBezier::copy() const
272 {
273  return new DrawableBezier(*this);
274 }
275 
276 
277 /* DrawableBorderColor */
278 Magick::DrawableBorderColor::DrawableBorderColor(const Magick::Color &color_)
279  : _color(color_)
280 {
281 }
282 
283 Magick::DrawableBorderColor::DrawableBorderColor
284  (const Magick::DrawableBorderColor &original_)
285  : DrawableBase(original_),
286  _color(original_._color)
287 {
288 }
289 
290 Magick::DrawableBorderColor::~DrawableBorderColor(void)
291 {
292 }
293 
294 void Magick::DrawableBorderColor::operator()(
295  MagickCore::DrawingWand *context_) const
296 {
297  PixelInfo
298  color;
299 
300  PixelWand
301  *pixel_wand;
302 
303  color=static_cast<PixelInfo>(_color);
304  pixel_wand=NewPixelWand();
305  PixelSetPixelColor(pixel_wand,&color);
306  DrawSetBorderColor(context_,pixel_wand);
307  pixel_wand=DestroyPixelWand(pixel_wand);
308 }
309 
310 void Magick::DrawableBorderColor::color(const Color &color_)
311 {
312  _color=color_;
313 }
314 
315 Magick::Color Magick::DrawableBorderColor::color(void) const
316 {
317  return(_color);
318 }
319 
320 Magick::DrawableBase* Magick::DrawableBorderColor::copy() const
321 {
322  return(new DrawableBorderColor(*this));
323 }
324 
325 
326 /* DrawableClipRule */
327 Magick::DrawableClipRule::DrawableClipRule(const FillRule fillRule_)
328 {
329  _fillRule=fillRule_;
330 }
331 
332 Magick::DrawableClipRule::~DrawableClipRule(void)
333 {
334 }
335 
336 void Magick::DrawableClipRule::operator()(
337  MagickCore::DrawingWand * context_) const
338 {
339  DrawSetClipRule(context_,_fillRule);
340 }
341 
342 void Magick::DrawableClipRule::fillRule(const FillRule fillRule_)
343 {
344  _fillRule=fillRule_;
345 }
346 
347 Magick::FillRule Magick::DrawableClipRule::fillRule(void) const
348 {
349  return(_fillRule);
350 }
351 
352 Magick::DrawableBase* Magick::DrawableClipRule::copy() const
353 {
354  return(new DrawableClipRule(*this));
355 }
356 
357 
358 /* DrawableClipUnits */
359 Magick::DrawableClipUnits::DrawableClipUnits(const ClipPathUnits units_)
360 {
361  _units = units_;
362 }
363 
364 Magick::DrawableClipUnits::~DrawableClipUnits(void)
365 {
366 }
367 
368 void Magick::DrawableClipUnits::operator()(
369  MagickCore::DrawingWand * context_) const
370 {
371  DrawSetClipUnits(context_, _units);
372 }
373 
374 void Magick::DrawableClipUnits::units(const ClipPathUnits units_)
375 {
376  _units = units_;
377 }
378 
379 Magick::ClipPathUnits Magick::DrawableClipUnits::units(void) const
380 {
381  return(_units);
382 }
383 
384 Magick::DrawableBase* Magick::DrawableClipUnits::copy() const
385 {
386  return(new DrawableClipUnits(*this));
387 }
388 
389 
390 //
391 //Clip Path
392 //
393 
394 // Pop (terminate) Clip path definition
395 Magick::DrawablePopClipPath::~DrawablePopClipPath ( void )
396 {
397 }
398 void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ ) const
399 {
400  DrawPopClipPath( context_ );
401  DrawPopDefs(context_);
402 }
403 Magick::DrawableBase* Magick::DrawablePopClipPath::copy() const
404 {
405  return new DrawablePopClipPath(*this);
406 }
407 
408 // Push clip path definition
409 Magick::DrawablePushClipPath::DrawablePushClipPath( const std::string &id_)
410  : _id(id_.c_str()) //multithread safe const char*
411 {
412 }
413 Magick::DrawablePushClipPath::DrawablePushClipPath
414 ( const Magick::DrawablePushClipPath& original_ ) //multithread safe const char*
415  : DrawableBase (original_),
416  _id(original_._id.c_str())
417 {
418 }
419 Magick::DrawablePushClipPath::~DrawablePushClipPath( void )
420 {
421 }
422 void Magick::DrawablePushClipPath::operator()
423  ( MagickCore::DrawingWand * context_ ) const
424 {
425  DrawPushDefs(context_);
426  DrawPushClipPath( context_, _id.c_str());
427 }
428 Magick::DrawableBase* Magick::DrawablePushClipPath::copy() const
429 {
430  return new DrawablePushClipPath(*this);
431 }
432 //
433 // ClipPath
434 //
435 Magick::DrawableClipPath::DrawableClipPath( const std::string &id_ )
436 :_id(id_.c_str())
437 {
438 }
439 
440 Magick::DrawableClipPath::DrawableClipPath ( const Magick::DrawableClipPath& original_ )
441  : DrawableBase (original_),
442  _id(original_._id.c_str())
443 {
444 }
445 Magick::DrawableClipPath::~DrawableClipPath( void )
446 {
447 }
448 void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ ) const
449 {
450  (void) DrawSetClipPath( context_, _id.c_str());
451 }
452 Magick::DrawableBase* Magick::DrawableClipPath::copy() const
453 {
454  return new DrawableClipPath(*this);
455 }
456 
457 // Circle
458 Magick::DrawableCircle::~DrawableCircle ( void )
459 {
460 }
461 void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ ) const
462 {
463  DrawCircle( context_, _originX, _originY, _perimX, _perimY );
464 }
465 Magick::DrawableBase* Magick::DrawableCircle::copy() const
466 {
467  return new DrawableCircle(*this);
468 }
469 
470 // Colorize at point using PaintMethod
471 Magick::DrawableColor::~DrawableColor( void )
472 {
473 }
474 void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ ) const
475 {
476  DrawColor( context_, _x, _y, _paintMethod );
477 }
478 Magick::DrawableBase* Magick::DrawableColor::copy() const
479 {
480  return new DrawableColor(*this);
481 }
482 
483 // Draw image at point
484 Magick::DrawableCompositeImage::DrawableCompositeImage
485 ( double x_, double y_,
486  double width_, double height_,
487  const std::string &filename_,
488  Magick::CompositeOperator composition_ )
489  : _composition(composition_),
490  _x(x_),
491  _y(y_),
492  _width(width_),
493  _height(height_),
494  _image(new Image(filename_))
495 {
496 }
497 Magick::DrawableCompositeImage::DrawableCompositeImage
498 ( double x_, double y_,
499  double width_, double height_,
500  const Magick::Image &image_,
501  Magick::CompositeOperator composition_ )
502  : _composition(composition_),
503  _x(x_),
504  _y(y_),
505  _width(width_),
506  _height(height_),
507  _image(new Image(image_))
508 {
509 }
510 Magick::DrawableCompositeImage::DrawableCompositeImage
511 ( double x_, double y_,
512  double width_, double height_,
513  const std::string &filename_ )
514  :_composition(CopyCompositeOp),
515  _x(x_),
516  _y(y_),
517  _width(width_),
518  _height(height_),
519  _image(new Image(filename_))
520 {
521 }
522 Magick::DrawableCompositeImage::DrawableCompositeImage
523 ( double x_, double y_,
524  double width_, double height_,
525  const Magick::Image &image_ )
526  :_composition(CopyCompositeOp),
527  _x(x_),
528  _y(y_),
529  _width(width_),
530  _height(height_),
531  _image(new Image(image_))
532 {
533 }
534 Magick::DrawableCompositeImage::DrawableCompositeImage
535 ( double x_, double y_,
536  const std::string &filename_ )
537  : _composition(CopyCompositeOp),
538  _x(x_),
539  _y(y_),
540  _width(0),
541  _height(0),
542  _image(new Image(filename_))
543 {
544  _width=(double) _image->columns();
545  _height=(double) _image->rows();
546 }
547 Magick::DrawableCompositeImage::DrawableCompositeImage
548 ( double x_, double y_,
549  const Magick::Image &image_ )
550  : _composition(CopyCompositeOp),
551  _x(x_),
552  _y(y_),
553  _width(0),
554  _height(0),
555  _image(new Image(image_))
556 {
557  _width=(double) _image->columns();
558  _height=(double) _image->rows();
559 }
560 // Copy constructor
561 Magick::DrawableCompositeImage::DrawableCompositeImage
562 ( const Magick::DrawableCompositeImage& original_ )
563  : Magick::DrawableBase(original_),
564  _composition(original_._composition),
565  _x(original_._x),
566  _y(original_._y),
567  _width(original_._width),
568  _height(original_._height),
569  _image(new Image(*original_._image))
570 {
571 }
572 Magick::DrawableCompositeImage::~DrawableCompositeImage( void )
573 {
574  delete _image;
575 }
576 // Assignment operator
577 Magick::DrawableCompositeImage& Magick::DrawableCompositeImage::operator=
578 (const Magick::DrawableCompositeImage& original_ )
579 {
580  // If not being set to ourself
581  if ( this != &original_ )
582  {
583  _composition = original_._composition;
584  _x = original_._x;
585  _y = original_._y;
586  _width = original_._width;
587  _height = original_._height;
588  Image* temp_image = new Image(*original_._image);
589  delete _image;
590  _image = temp_image;
591  }
592  return *this;
593 }
594 void Magick::DrawableCompositeImage::filename( const std::string &filename_ )
595 {
596  Image* temp_image = new Image(filename_);
597  delete _image;
598  _image = temp_image;
599 }
600 std::string Magick::DrawableCompositeImage::filename( void ) const
601 {
602  return _image->fileName();
603 }
604 
605 void Magick::DrawableCompositeImage::image( const Magick::Image &image_ )
606 {
607  Image* temp_image = new Image(image_);
608  delete _image;
609  _image = temp_image;
610 }
611 Magick::Image Magick::DrawableCompositeImage::image( void ) const
612 {
613  return *_image;
614 }
615 
616 // Specify image format used to output Base64 inlined image data.
617 void Magick::DrawableCompositeImage::magick( std::string magick_ )
618 {
619  _image->magick( magick_ );
620 }
621 std::string Magick::DrawableCompositeImage::magick( void )
622 {
623  return _image->magick();
624 }
625 
626 void Magick::DrawableCompositeImage::operator()
627  ( MagickCore::DrawingWand * context_ ) const
628 {
629  MagickWand
630  *magick_wand;
631 
632  magick_wand=NewMagickWandFromImage(_image->constImage());
633  (void) DrawComposite( context_, _composition, _x, _y, _width, _height,
634  magick_wand );
635  magick_wand=DestroyMagickWand(magick_wand);
636 }
637 
638 Magick::DrawableBase* Magick::DrawableCompositeImage::copy() const
639 {
640  return new DrawableCompositeImage(*this);
641 }
642 
643 Magick::DrawableDensity::DrawableDensity(const Point &density_)
644  : _density(density_)
645 {
646 }
647 
648 Magick::DrawableDensity::DrawableDensity(const std::string &density_)
649  : _density(density_)
650 {
651 }
652 
653 Magick::DrawableDensity::~DrawableDensity(void)
654 {
655 }
656 
657 void Magick::DrawableDensity::operator()(
658  MagickCore::DrawingWand *context_) const
659 {
660  DrawSetDensity(context_,_density.c_str());
661 }
662 
663 Magick::DrawableBase* Magick::DrawableDensity::copy() const
664 {
665  return(new DrawableDensity(*this));
666 }
667 
668 // Ellipse
669 Magick::DrawableEllipse::~DrawableEllipse( void )
670 {
671 }
672 void Magick::DrawableEllipse::operator()
673  ( MagickCore::DrawingWand * context_ ) const
674 {
675  DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
676  _arcStart, _arcEnd );
677 }
678 Magick::DrawableBase* Magick::DrawableEllipse::copy() const
679 {
680  return new DrawableEllipse(*this);
681 }
682 
683 // Specify drawing fill color
684 Magick::DrawableFillColor::DrawableFillColor( const Magick::Color &color_ )
685  : _color(color_)
686 {
687 }
688 Magick::DrawableFillColor::DrawableFillColor
689 ( const Magick::DrawableFillColor& original_ )
690  : DrawableBase (original_),
691  _color(original_._color)
692 {
693 }
694 Magick::DrawableFillColor::~DrawableFillColor( void )
695 {
696 }
697 void Magick::DrawableFillColor::operator()
698  ( MagickCore::DrawingWand * context_ ) const
699 {
700  PixelInfo color = static_cast<PixelInfo>(_color);
701  PixelWand *pixel_wand=NewPixelWand();
702  PixelSetPixelColor(pixel_wand,&color);
703  DrawSetFillColor(context_,pixel_wand);
704  pixel_wand=DestroyPixelWand(pixel_wand);
705 }
706 Magick::DrawableBase* Magick::DrawableFillColor::copy() const
707 {
708  return new DrawableFillColor(*this);
709 }
710 
711 /* DrawableFillPatternUrl */
712 Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(const std::string &url_)
713  : _url(url_)
714 {
715 }
716 
717 Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
718  const Magick::DrawableFillPatternUrl& original_)
719  : DrawableBase(original_),
720  _url(original_._url)
721 {
722 }
723 
724 Magick::DrawableFillPatternUrl::~DrawableFillPatternUrl(void)
725 {
726 }
727 
728 void Magick::DrawableFillPatternUrl::operator()(
729  MagickCore::DrawingWand * context_) const
730 {
731  DrawSetFillPatternURL(context_, _url.c_str());
732 }
733 
734 void Magick::DrawableFillPatternUrl::url(const std::string &url_)
735 {
736  _url = url_;
737 }
738 
739 std::string Magick::DrawableFillPatternUrl::url(void) const
740 {
741  return(_url);
742 }
743 
744 Magick::DrawableBase* Magick::DrawableFillPatternUrl::copy() const
745 {
746  return(new DrawableFillPatternUrl(*this));
747 }
748 
749 // Specify drawing fill rule
750 Magick::DrawableFillRule::~DrawableFillRule ( void )
751 {
752 }
753 void Magick::DrawableFillRule::operator()
754  ( MagickCore::DrawingWand * context_ ) const
755 {
756  DrawSetFillRule( context_, _fillRule );
757 }
758 Magick::DrawableBase* Magick::DrawableFillRule::copy() const
759 {
760  return new DrawableFillRule(*this);
761 }
762 
763 Magick::DrawableFillOpacity::~DrawableFillOpacity(void)
764 {
765 }
766 
767 void Magick::DrawableFillOpacity::operator()
768  (MagickCore::DrawingWand *context_) const
769 {
770  DrawSetFillOpacity(context_,_opacity);
771 }
772 
773 Magick::DrawableBase* Magick::DrawableFillOpacity::copy() const
774 {
775  return new DrawableFillOpacity(*this);
776 }
777 
778 // Specify text font
779 Magick::DrawableFont::DrawableFont ( const std::string &font_ )
780  : _font(font_),
781  _family(),
782  _style(Magick::AnyStyle),
783  _weight(400),
784  _stretch(Magick::NormalStretch)
785 {
786 }
787 Magick::DrawableFont::DrawableFont ( const std::string &family_,
788  Magick::StyleType style_,
789  const unsigned int weight_,
790  Magick::StretchType stretch_ )
791  : _font(),
792  _family(family_),
793  _style(style_),
794  _weight(weight_),
795  _stretch(stretch_)
796 {
797 }
798 Magick::DrawableFont::DrawableFont ( const Magick::DrawableFont& original_ )
799  : DrawableBase (original_),
800  _font(original_._font),
801  _family(original_._family),
802  _style(original_._style),
803  _weight(original_._weight),
804  _stretch(original_._stretch)
805 {
806 }
807 Magick::DrawableFont::~DrawableFont ( void )
808 {
809 }
810 void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ ) const
811 {
812  // font
813  if(_font.length())
814  {
815  (void) DrawSetFont( context_, _font.c_str() );
816  }
817 
818  if(_family.length())
819  {
820  // font-family
821  (void) DrawSetFontFamily( context_, _family.c_str() );
822 
823  // font-style
824  DrawSetFontStyle( context_, _style );
825 
826  // font-weight
827  DrawSetFontWeight( context_, _weight );
828 
829  // font-stretch
830  DrawSetFontStretch( context_, _stretch );
831  }
832 }
833 Magick::DrawableBase* Magick::DrawableFont::copy() const
834 {
835  return new DrawableFont(*this);
836 }
837 
838 // Specify text positioning gravity
839 Magick::DrawableGravity::~DrawableGravity ( void )
840 {
841 }
842 void Magick::DrawableGravity::operator()
843  ( MagickCore::DrawingWand * context_ ) const
844 {
845  DrawSetGravity( context_, _gravity );
846 }
847 Magick::DrawableBase* Magick::DrawableGravity::copy() const
848 {
849  return new DrawableGravity(*this);
850 }
851 
852 // Line
853 Magick::DrawableLine::~DrawableLine ( void )
854 {
855 }
856 void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ ) const
857 {
858  DrawLine( context_, _startX, _startY, _endX, _endY );
859 }
860 Magick::DrawableBase* Magick::DrawableLine::copy() const
861 {
862  return new DrawableLine(*this);
863 }
864 
865 // Drawable Path
866 Magick::DrawablePath::DrawablePath ( const VPathList &path_ )
867  : _path(path_)
868 {
869 }
870 Magick::DrawablePath::DrawablePath ( const Magick::DrawablePath& original_ )
871  : DrawableBase (original_),
872  _path(original_._path)
873 {
874 }
875 Magick::DrawablePath::~DrawablePath ( void )
876 {
877 }
878 void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ ) const
879 {
880  DrawPathStart( context_ );
881 
882  for( VPathList::const_iterator p = _path.begin();
883  p != _path.end(); p++ )
884  p->operator()( context_ ); // FIXME, how to quit loop on error?
885 
886  DrawPathFinish( context_ );
887 }
888 Magick::DrawableBase* Magick::DrawablePath::copy() const
889 {
890  return new DrawablePath(*this);
891 }
892 
893 // Point
894 Magick::DrawablePoint::~DrawablePoint ( void )
895 {
896 }
897 void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ ) const
898 {
899  DrawPoint( context_, _x, _y );
900 }
901 Magick::DrawableBase* Magick::DrawablePoint::copy() const
902 {
903  return new DrawablePoint(*this);
904 }
905 
906 // Text pointsize
907 Magick::DrawablePointSize::~DrawablePointSize ( void )
908 {
909 }
910 void Magick::DrawablePointSize::operator()
911  ( MagickCore::DrawingWand * context_ ) const
912 {
913  DrawSetFontSize( context_, _pointSize );
914 }
915 Magick::DrawableBase* Magick::DrawablePointSize::copy() const
916 {
917  return new DrawablePointSize(*this);
918 }
919 
920 // Polygon (Coordinate list must contain at least three members)
921 Magick::DrawablePolygon::DrawablePolygon ( const CoordinateList &coordinates_ )
922  : _coordinates(coordinates_)
923 {
924 }
925 Magick::DrawablePolygon::DrawablePolygon
926 ( const Magick::DrawablePolygon& original_ )
927  : DrawableBase (original_),
928  _coordinates(original_._coordinates)
929 {
930 }
931 Magick::DrawablePolygon::~DrawablePolygon ( void )
932 {
933 }
934 void Magick::DrawablePolygon::operator()
935  ( MagickCore::DrawingWand * context_ ) const
936 {
937  size_t num_coords = (size_t) _coordinates.size();
938  PointInfo *coordinates = new PointInfo[num_coords];
939 
940  PointInfo *q = coordinates;
941  CoordinateList::const_iterator p = _coordinates.begin();
942 
943  while( p != _coordinates.end() )
944  {
945  q->x = p->x();
946  q->y = p->y();
947  q++;
948  p++;
949  }
950 
951  DrawPolygon( context_, num_coords, coordinates );
952  delete [] coordinates;
953 }
954 Magick::DrawableBase* Magick::DrawablePolygon::copy() const
955 {
956  return new DrawablePolygon(*this);
957 }
958 
959 // Polyline (Coordinate list must contain at least three members)
960 Magick::DrawablePolyline::DrawablePolyline
961 ( const CoordinateList &coordinates_ )
962  : _coordinates(coordinates_)
963 {
964 }
965 Magick::DrawablePolyline::DrawablePolyline
966 ( const Magick::DrawablePolyline& original_ )
967  : DrawableBase (original_),
968  _coordinates(original_._coordinates)
969 {
970 }
971 Magick::DrawablePolyline::~DrawablePolyline ( void )
972 {
973 }
974 void Magick::DrawablePolyline::operator()
975  ( MagickCore::DrawingWand * context_ ) const
976 {
977  size_t num_coords = (size_t) _coordinates.size();
978  PointInfo *coordinates = new PointInfo[num_coords];
979 
980  PointInfo *q = coordinates;
981  CoordinateList::const_iterator p = _coordinates.begin();
982 
983  while( p != _coordinates.end() )
984  {
985  q->x = p->x();
986  q->y = p->y();
987  q++;
988  p++;
989  }
990 
991  DrawPolyline( context_, num_coords, coordinates );
992  delete [] coordinates;
993 }
994 Magick::DrawableBase* Magick::DrawablePolyline::copy() const
995 {
996  return new DrawablePolyline(*this);
997 }
998 
999 // Pop Graphic Context
1000 Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext ( void )
1001 {
1002 }
1003 void Magick::DrawablePopGraphicContext::operator()
1004  ( MagickCore::DrawingWand * context_ ) const
1005 {
1006  PopDrawingWand( context_ );
1007 }
1008 Magick::DrawableBase* Magick::DrawablePopGraphicContext::copy() const
1009 {
1010  return new DrawablePopGraphicContext(*this);
1011 }
1012 
1013 // Push Graphic Context
1014 Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext ( void )
1015 {
1016 }
1017 void Magick::DrawablePushGraphicContext::operator()
1018  ( MagickCore::DrawingWand * context_ ) const
1019 {
1020  PushDrawingWand( context_ );
1021 }
1022 Magick::DrawableBase* Magick::DrawablePushGraphicContext::copy() const
1023 {
1024  return new DrawablePushGraphicContext(*this);
1025 }
1026 
1027 // Pop (terminate) Pattern definition
1028 Magick::DrawablePopPattern::~DrawablePopPattern ( void )
1029 {
1030 }
1031 void Magick::DrawablePopPattern::operator()
1032  ( MagickCore::DrawingWand * context_ ) const
1033 {
1034  (void) DrawPopPattern( context_ );
1035 }
1036 Magick::DrawableBase* Magick::DrawablePopPattern::copy() const
1037 {
1038  return new DrawablePopPattern(*this);
1039 }
1040 
1041 // Push Pattern definition
1042 Magick::DrawablePushPattern::DrawablePushPattern
1043 ( const std::string &id_, ssize_t x_, ssize_t y_,
1044  size_t width_, size_t height_ )
1045  : _id(id_),
1046  _x(x_),
1047  _y(y_),
1048  _width(width_),
1049  _height(height_)
1050 {
1051 }
1052 Magick::DrawablePushPattern::DrawablePushPattern
1053 ( const Magick::DrawablePushPattern& original_ )
1054  : DrawableBase (original_),
1055  _id(original_._id),
1056  _x(original_._x),
1057  _y(original_._y),
1058  _width(original_._width),
1059  _height(original_._height)
1060 {
1061 }
1062 Magick::DrawablePushPattern::~DrawablePushPattern ( void )
1063 {
1064 }
1065 void Magick::DrawablePushPattern::operator()
1066  ( MagickCore::DrawingWand * context_ ) const
1067 {
1068  (void) DrawPushPattern( context_, _id.c_str(), (double) _x, (double) _y,
1069  (double) _width, (double) _height);
1070 }
1071 Magick::DrawableBase* Magick::DrawablePushPattern::copy() const
1072 {
1073  return new DrawablePushPattern(*this);
1074 }
1075 
1076 // Rectangle
1077 Magick::DrawableRectangle::~DrawableRectangle ( void )
1078 {
1079 }
1080 void Magick::DrawableRectangle::operator()
1081  ( MagickCore::DrawingWand * context_ ) const
1082 {
1083  DrawRectangle( context_, _upperLeftX, _upperLeftY,
1084  _lowerRightX, _lowerRightY );
1085 }
1086 Magick::DrawableBase* Magick::DrawableRectangle::copy() const
1087 {
1088  return new DrawableRectangle(*this);
1089 }
1090 
1091 // Apply Rotation
1092 Magick::DrawableRotation::~DrawableRotation ( void )
1093 {
1094 }
1095 void Magick::DrawableRotation::operator()
1096  ( MagickCore::DrawingWand * context_ ) const
1097 {
1098  DrawRotate( context_, _angle );
1099 }
1100 Magick::DrawableBase* Magick::DrawableRotation::copy() const
1101 {
1102  return new DrawableRotation(*this);
1103 }
1104 
1105 // Round Rectangle
1106 Magick::DrawableRoundRectangle::~DrawableRoundRectangle ( void )
1107 {
1108 }
1109 void Magick::DrawableRoundRectangle::operator()
1110  ( MagickCore::DrawingWand * context_ ) const
1111 {
1112  DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX,
1113  _lowerRightY,_cornerWidth, _cornerHeight);
1114 }
1115 Magick::DrawableBase* Magick::DrawableRoundRectangle::copy() const
1116 {
1117  return new DrawableRoundRectangle(*this);
1118 }
1119 
1120 // Apply Scaling
1121 Magick::DrawableScaling::~DrawableScaling ( void )
1122 {
1123 }
1124 void Magick::DrawableScaling::operator()
1125  ( MagickCore::DrawingWand * context_ ) const
1126 {
1127  DrawScale( context_, _x, _y );
1128 }
1129 Magick::DrawableBase* Magick::DrawableScaling::copy() const
1130 {
1131  return new DrawableScaling(*this);
1132 }
1133 
1134 // Apply Skew in the X direction
1135 Magick::DrawableSkewX::~DrawableSkewX ( void )
1136 {
1137 }
1138 void Magick::DrawableSkewX::operator()
1139  ( MagickCore::DrawingWand * context_ ) const
1140 {
1141  DrawSkewX( context_, _angle );
1142 }
1143 Magick::DrawableBase* Magick::DrawableSkewX::copy() const
1144 {
1145  return new DrawableSkewX(*this);
1146 }
1147 
1148 // Apply Skew in the Y direction
1149 Magick::DrawableSkewY::~DrawableSkewY ( void )
1150 {
1151 }
1152 void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ ) const
1153 {
1154  DrawSkewY( context_, _angle );
1155 }
1156 Magick::DrawableBase* Magick::DrawableSkewY::copy() const
1157 {
1158  return new DrawableSkewY(*this);
1159 }
1160 
1161 /* DrawableStrokeDashArray */
1162 Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(const double* dasharray_)
1163  : _size(0),
1164  _dasharray(0)
1165 {
1166  dasharray(dasharray_);
1167 }
1168 
1169 Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
1170  const Magick::DrawableStrokeDashArray& original_)
1171  : DrawableBase (original_),
1172  _size(original_._size),
1173  _dasharray(new double[_size+1])
1174 {
1175  // Copy elements
1176  {
1177  for (size_t i=0; i < _size; i++)
1178  _dasharray[i]=original_._dasharray[i];
1179  _dasharray[_size]=0.0;
1180  }
1181 }
1182 
1183 Magick::DrawableStrokeDashArray::~DrawableStrokeDashArray(void)
1184 {
1185  delete [] _dasharray;
1186  _size=0;
1187  _dasharray=(double *) NULL;
1188 }
1189 
1190 Magick::DrawableStrokeDashArray& Magick::DrawableStrokeDashArray::operator=(
1191  const Magick::DrawableStrokeDashArray &original_)
1192 {
1193  if (this != &original_)
1194  {
1195  delete [] _dasharray;
1196  _size=original_._size;
1197  _dasharray = new double[_size+1];
1198  // Copy elements
1199  {
1200  for (size_t i=0; i < _size; i++)
1201  _dasharray[i]=original_._dasharray[i];
1202  _dasharray[_size]=0.0;
1203  }
1204  }
1205  return(*this);
1206 }
1207 
1208 void Magick::DrawableStrokeDashArray::operator()(
1209  MagickCore::DrawingWand *context_) const
1210 {
1211  (void) DrawSetStrokeDashArray(context_,(unsigned long) _size,_dasharray);
1212 }
1213 
1214 Magick::DrawableBase *Magick::DrawableStrokeDashArray::copy() const
1215 {
1216  return(new DrawableStrokeDashArray(*this));
1217 }
1218 
1219 void Magick::DrawableStrokeDashArray::dasharray(const double* dasharray_)
1220 {
1221  size_t
1222  n;
1223 
1224  delete [] _dasharray;
1225  _size=0;
1226  _dasharray=0;
1227 
1228  if (dasharray_ != (const double *) NULL)
1229  {
1230  const double
1231  *p;
1232 
1233  // Count elements in dash array
1234  n=0;
1235  {
1236  p = dasharray_;
1237  while(*p++ != 0.0)
1238  n++;
1239  }
1240  _size=n;
1241 
1242  // Allocate elements
1243  _dasharray=new double[_size+1];
1244  // Copy elements
1245  {
1246  for (size_t i=0; i < _size; i++)
1247  _dasharray[i]=dasharray_[i];
1248  _dasharray[_size]=0.0;
1249  }
1250  }
1251 }
1252 
1253 const double* Magick::DrawableStrokeDashArray::dasharray(void) const
1254 {
1255  return(_dasharray);
1256 }
1257 
1258 /* DrawableStrokeDashOffset */
1259 Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(void)
1260 {
1261 }
1262 
1263 void Magick::DrawableStrokeDashOffset::operator()
1264  ( MagickCore::DrawingWand * context_) const
1265 {
1266  DrawSetStrokeDashOffset(context_,_offset);
1267 }
1268 
1269 Magick::DrawableBase* Magick::DrawableStrokeDashOffset::copy() const
1270 {
1271  return(new DrawableStrokeDashOffset(*this));
1272 }
1273 
1274 void Magick::DrawableStrokeDashOffset::offset(const double offset_)
1275 {
1276  _offset=offset_;
1277 }
1278 
1279 double Magick::DrawableStrokeDashOffset::offset(void) const
1280 {
1281  return(_offset);
1282 }
1283 
1284 // Stroke linecap
1285 Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void )
1286 {
1287 }
1288 void Magick::DrawableStrokeLineCap::operator()
1289  ( MagickCore::DrawingWand * context_ ) const
1290 {
1291  DrawSetStrokeLineCap( context_, _linecap );
1292 }
1293 Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const
1294 {
1295  return new DrawableStrokeLineCap(*this);
1296 }
1297 
1298 // Stroke linejoin
1299 Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void )
1300 {
1301 }
1302 void Magick::DrawableStrokeLineJoin::operator()
1303  ( MagickCore::DrawingWand * context_ ) const
1304 {
1305  DrawSetStrokeLineJoin( context_, _linejoin );
1306 }
1307 Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const
1308 {
1309  return new DrawableStrokeLineJoin(*this);
1310 }
1311 
1312 // Stroke miterlimit
1313 Magick::DrawableMiterLimit::~DrawableMiterLimit ( void )
1314 {
1315 }
1316 void Magick::DrawableMiterLimit::operator()
1317  ( MagickCore::DrawingWand * context_ ) const
1318 {
1319  DrawSetStrokeMiterLimit( context_, _miterlimit );
1320 }
1321 Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const
1322 {
1323  return new DrawableMiterLimit(*this);
1324 }
1325 
1326 
1327 /* DrawableStrokePatternUrl */
1328 Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1329  const std::string &url_)
1330  : _url(url_)
1331 {
1332 }
1333 
1334 Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1335  const Magick::DrawableStrokePatternUrl& original_)
1336  : DrawableBase(original_),
1337  _url(original_._url)
1338 {
1339 }
1340 
1341 Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(void)
1342 {
1343 }
1344 
1345 void Magick::DrawableStrokePatternUrl::operator()(
1346  MagickCore::DrawingWand * context_) const
1347 {
1348  DrawSetStrokePatternURL(context_, _url.c_str());
1349 }
1350 
1351 void Magick::DrawableStrokePatternUrl::url(const std::string &url_)
1352 {
1353  _url = url_;
1354 }
1355 
1356 std::string Magick::DrawableStrokePatternUrl::url(void) const
1357 {
1358  return(_url);
1359 }
1360 
1361 Magick::DrawableBase* Magick::DrawableStrokePatternUrl::copy() const
1362 {
1363  return(new DrawableStrokePatternUrl(*this));
1364 }
1365 
1366 // Stroke antialias
1367 Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void )
1368 {
1369 }
1370 void Magick::DrawableStrokeAntialias::operator()
1371 ( MagickCore::DrawingWand * context_ ) const
1372 {
1373  DrawSetStrokeAntialias( context_, static_cast<MagickBooleanType>
1374  (_flag ? MagickTrue : MagickFalse) );
1375 }
1376 Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const
1377 {
1378  return new DrawableStrokeAntialias(*this);
1379 }
1380 
1381 // Stroke color
1382 Magick::DrawableStrokeColor::DrawableStrokeColor
1383 ( const Magick::Color &color_ )
1384  : _color(color_)
1385 {
1386 }
1387 Magick::DrawableStrokeColor::DrawableStrokeColor
1388 ( const Magick::DrawableStrokeColor& original_ )
1389  : DrawableBase (original_),
1390  _color(original_._color)
1391 {
1392 }
1393 Magick::DrawableStrokeColor::~DrawableStrokeColor ( void )
1394 {
1395 }
1396 void Magick::DrawableStrokeColor::operator()
1397  ( MagickCore::DrawingWand * context_ ) const
1398 {
1399  PixelInfo color = static_cast<PixelInfo>(_color);
1400  PixelWand *pixel_wand=NewPixelWand();
1401  PixelSetPixelColor(pixel_wand,&color);
1402  DrawSetStrokeColor(context_,pixel_wand);
1403  pixel_wand=DestroyPixelWand(pixel_wand);
1404 }
1405 Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const
1406 {
1407  return new DrawableStrokeColor(*this);
1408 }
1409 
1410 Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(void)
1411 {
1412 }
1413 
1414 void Magick::DrawableStrokeOpacity::operator()
1415  (MagickCore::DrawingWand * context_) const
1416 {
1417  DrawSetStrokeOpacity(context_,_opacity);
1418 }
1419 
1420 Magick::DrawableBase* Magick::DrawableStrokeOpacity::copy() const
1421 {
1422  return new DrawableStrokeOpacity(*this);
1423 }
1424 
1425 // Stroke width
1426 Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void )
1427 {
1428 }
1429 void Magick::DrawableStrokeWidth::operator()
1430  ( MagickCore::DrawingWand * context_ ) const
1431 {
1432  DrawSetStrokeWidth( context_, _width );
1433 }
1434 Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const
1435 {
1436  return new DrawableStrokeWidth(*this);
1437 }
1438 
1439 // Draw text at point
1440 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1441  const std::string &text_ )
1442  : _x(x_),
1443  _y(y_),
1444  _text(text_),
1445  _encoding()
1446 {
1447 }
1448 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1449  const std::string &text_, const std::string &encoding_)
1450  : _x(x_),
1451  _y(y_),
1452  _text(text_),
1453  _encoding(encoding_)
1454 {
1455 }
1456 Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ )
1457  : DrawableBase (original_),
1458  _x(original_._x),
1459  _y(original_._y),
1460  _text(original_._text),
1461  _encoding(original_._encoding)
1462 {
1463 }
1464 Magick::DrawableText::~DrawableText ( void )
1465 {
1466 }
1467 void Magick::DrawableText::operator()
1468  ( MagickCore::DrawingWand * context_ ) const
1469 {
1470  DrawSetTextEncoding( context_, _encoding.c_str() );
1471  DrawAnnotation( context_, _x, _y,
1472  reinterpret_cast<const unsigned char*>(_text.c_str()) );
1473 }
1474 Magick::DrawableBase* Magick::DrawableText::copy() const
1475 {
1476  return new DrawableText(*this);
1477 }
1478 
1479 /* DrawableTextAlignment */
1480 Magick::DrawableTextAlignment::DrawableTextAlignment(
1481  Magick::AlignType alignment_)
1482  : _alignment(alignment_)
1483 {
1484 }
1485 
1486 Magick::DrawableTextAlignment::DrawableTextAlignment
1487 (const Magick::DrawableTextAlignment &original_)
1488  : DrawableBase(original_),
1489  _alignment(original_._alignment)
1490 {
1491 }
1492 
1493 Magick::DrawableTextAlignment::~DrawableTextAlignment(void)
1494 {
1495 }
1496 
1497 void Magick::DrawableTextAlignment::operator()(
1498  MagickCore::DrawingWand * context_) const
1499 {
1500  DrawSetTextAlignment(context_, _alignment);
1501 }
1502 
1503 void Magick::DrawableTextAlignment::alignment(AlignType alignment_)
1504 {
1505  _alignment=alignment_;
1506 }
1507 
1508 Magick::AlignType Magick::DrawableTextAlignment::alignment(void) const
1509 {
1510  return(_alignment);
1511 }
1512 
1513 Magick::DrawableBase* Magick::DrawableTextAlignment::copy() const
1514 {
1515  return new DrawableTextAlignment(*this);
1516 }
1517 
1518 // Text antialias
1519 Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ )
1520  : _flag(flag_)
1521 {
1522 }
1523 Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ )
1524  : DrawableBase (original_),
1525  _flag(original_._flag)
1526 {
1527 }
1528 Magick::DrawableTextAntialias::~DrawableTextAntialias ( void )
1529 {
1530 }
1531 void Magick::DrawableTextAntialias::operator()
1532  ( MagickCore::DrawingWand * context_ ) const
1533 {
1534  DrawSetTextAntialias( context_, static_cast<MagickBooleanType>
1535  (_flag ? MagickTrue : MagickFalse) );
1536 }
1537 Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const
1538 {
1539  return new DrawableTextAntialias(*this);
1540 }
1541 
1542 
1543 // Decoration (text decoration)
1544 Magick::DrawableTextDecoration::DrawableTextDecoration
1545  ( Magick::DecorationType decoration_ )
1546  : _decoration(decoration_)
1547 {
1548 }
1549 Magick::DrawableTextDecoration::DrawableTextDecoration
1550  ( const Magick::DrawableTextDecoration &original_ )
1551  : DrawableBase (original_),
1552  _decoration(original_._decoration)
1553 {
1554 }
1555 Magick::DrawableTextDecoration::~DrawableTextDecoration( void )
1556 {
1557 }
1558 void Magick::DrawableTextDecoration::operator()
1559  ( MagickCore::DrawingWand * context_ ) const
1560 {
1561  DrawSetTextDecoration( context_, _decoration );
1562 }
1563 Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const
1564 {
1565  return new DrawableTextDecoration(*this);
1566 }
1567 
1568 // DrawableTextDirection
1569 Magick::DrawableTextDirection::DrawableTextDirection(
1570  DirectionType direction_)
1571  : _direction(direction_)
1572 {
1573 }
1574 
1575 Magick::DrawableTextDirection::~DrawableTextDirection(void)
1576 {
1577 }
1578 
1579 void Magick::DrawableTextDirection::operator()(
1580  MagickCore::DrawingWand *context_) const
1581 {
1582  DrawSetTextDirection(context_,_direction);
1583 }
1584 
1585 void Magick::DrawableTextDirection::direction(DirectionType direction_)
1586 {
1587  _direction=direction_;
1588 }
1589 
1590 Magick::DirectionType Magick::DrawableTextDirection::direction(void) const
1591 {
1592  return(_direction);
1593 }
1594 
1595 Magick::DrawableBase *Magick::DrawableTextDirection::copy() const
1596 {
1597  return new DrawableTextDirection(*this);
1598 }
1599 
1600 // DrawableTextInterlineSpacing
1601 Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1602  double spacing_)
1603  : _spacing(spacing_)
1604 {
1605 }
1606 
1607 Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(void)
1608 {
1609 }
1610 
1611 void Magick::DrawableTextInterlineSpacing::operator()(
1612  MagickCore::DrawingWand *context_) const
1613 {
1614  DrawSetTextInterlineSpacing(context_,_spacing);
1615 }
1616 
1617 void Magick::DrawableTextInterlineSpacing::spacing(double spacing_)
1618 {
1619  _spacing=spacing_;
1620 }
1621 
1622 double Magick::DrawableTextInterlineSpacing::spacing(void) const
1623 {
1624  return(_spacing);
1625 }
1626 
1627 Magick::DrawableBase *Magick::DrawableTextInterlineSpacing::copy() const
1628 {
1629  return new DrawableTextInterlineSpacing(*this);
1630 }
1631 
1632 // DrawableTextInterwordSpacing
1633 Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1634  double spacing_)
1635  : _spacing(spacing_)
1636 {
1637 }
1638 
1639 Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(void)
1640 {
1641 }
1642 
1643 void Magick::DrawableTextInterwordSpacing::operator()(
1644  MagickCore::DrawingWand *context_) const
1645 {
1646  DrawSetTextInterwordSpacing(context_,_spacing);
1647 }
1648 
1649 void Magick::DrawableTextInterwordSpacing::spacing(double spacing_)
1650 {
1651  _spacing=spacing_;
1652 }
1653 
1654 double Magick::DrawableTextInterwordSpacing::spacing(void) const
1655 {
1656  return(_spacing);
1657 }
1658 
1659 Magick::DrawableBase *Magick::DrawableTextInterwordSpacing::copy() const
1660 {
1661  return new DrawableTextInterwordSpacing(*this);
1662 }
1663 
1664 // DrawableTextKerning
1665 Magick::DrawableTextKerning::DrawableTextKerning(
1666  double kerning_)
1667  : _kerning(kerning_)
1668 {
1669 }
1670 
1671 Magick::DrawableTextKerning::~DrawableTextKerning(void)
1672 {
1673 }
1674 
1675 void Magick::DrawableTextKerning::operator()(
1676  MagickCore::DrawingWand *context_) const
1677 {
1678  DrawSetTextKerning(context_,_kerning);
1679 }
1680 
1681 void Magick::DrawableTextKerning::kerning(double kerning_)
1682 {
1683  _kerning=kerning_;
1684 }
1685 
1686 double Magick::DrawableTextKerning::kerning(void) const
1687 {
1688  return(_kerning);
1689 }
1690 
1691 Magick::DrawableBase *Magick::DrawableTextKerning::copy() const
1692 {
1693  return new DrawableTextKerning(*this);
1694 }
1695 
1696 // Set text undercolor
1697 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1698 ( const Magick::Color &color_ )
1699  : _color(color_)
1700 {
1701 }
1702 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1703 ( const Magick::DrawableTextUnderColor& original_ )
1704  : DrawableBase (original_),
1705  _color(original_._color)
1706 {
1707 }
1708 Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void )
1709 {
1710 }
1711 void Magick::DrawableTextUnderColor::operator()
1712  ( MagickCore::DrawingWand * context_ ) const
1713 {
1714  PixelInfo color = static_cast<PixelInfo>(_color);
1715  PixelWand *pixel_wand=NewPixelWand();
1716  PixelSetPixelColor(pixel_wand,&color);
1717  DrawSetTextUnderColor(context_,pixel_wand);
1718  pixel_wand=DestroyPixelWand(pixel_wand);
1719 }
1720 Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const
1721 {
1722  return new DrawableTextUnderColor(*this);
1723 }
1724 
1725 // Apply Translation
1726 Magick::DrawableTranslation::~DrawableTranslation ( void )
1727 {
1728 }
1729 void Magick::DrawableTranslation::operator()
1730  ( MagickCore::DrawingWand * context_ ) const
1731 {
1732  DrawTranslate( context_, _x, _y );
1733 }
1734 Magick::DrawableBase* Magick::DrawableTranslation::copy() const
1735 {
1736  return new DrawableTranslation(*this);
1737 }
1738 
1739 // Set the size of the viewbox
1740 Magick::DrawableViewbox::~DrawableViewbox ( void )
1741 {
1742 }
1743 void Magick::DrawableViewbox::operator()
1744  ( MagickCore::DrawingWand * context_ ) const
1745 {
1746  DrawSetViewbox( context_, (double) _x1, (double) _y1, (double) _x2,
1747  (double) _y2 );
1748 }
1749 Magick::DrawableBase* Magick::DrawableViewbox::copy() const
1750 {
1751  return new DrawableViewbox(*this);
1752 }
1753 
1754 //
1755 // Path Classes
1756 //
1757 
1758 //
1759 // PathArcArgs
1760 //
1761 MagickPPExport int Magick::operator == ( const Magick::PathArcArgs& /*left_*/,
1762  const Magick::PathArcArgs& /*right_*/ )
1763 {
1764  return ( 1 );
1765 }
1766 MagickPPExport int Magick::operator != ( const Magick::PathArcArgs& /*left_*/,
1767  const Magick::PathArcArgs& /*right_*/ )
1768 {
1769  return ( 0 );
1770 }
1771 MagickPPExport int Magick::operator > ( const Magick::PathArcArgs& /*left_*/,
1772  const Magick::PathArcArgs& /*right_*/ )
1773 {
1774  return ( 0 );
1775 }
1776 MagickPPExport int Magick::operator < ( const Magick::PathArcArgs& /*left_*/,
1777  const Magick::PathArcArgs& /*right_*/ )
1778 {
1779  return ( false );
1780 }
1781 MagickPPExport int Magick::operator >= ( const Magick::PathArcArgs& left_,
1782  const Magick::PathArcArgs& right_ )
1783 {
1784  return ( ( left_ > right_ ) || ( left_ == right_ ) );
1785 }
1786 MagickPPExport int Magick::operator <= ( const Magick::PathArcArgs& left_,
1787  const Magick::PathArcArgs& right_ )
1788 {
1789  return ( ( left_ < right_ ) || ( left_ == right_ ) );
1790 }
1791 // Default constructor
1792 Magick::PathArcArgs::PathArcArgs( void )
1793  : _radiusX(0),
1794  _radiusY(0),
1795  _xAxisRotation(0),
1796  _largeArcFlag(false),
1797  _sweepFlag(false),
1798  _x(0),
1799  _y(0)
1800 {
1801 }
1802 // Normal constructor
1803 Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_,
1804  double xAxisRotation_, bool largeArcFlag_,
1805  bool sweepFlag_, double x_, double y_ )
1806  : _radiusX(radiusX_),
1807  _radiusY(radiusY_),
1808  _xAxisRotation(xAxisRotation_),
1809  _largeArcFlag(largeArcFlag_),
1810  _sweepFlag(sweepFlag_),
1811  _x(x_),
1812  _y(y_)
1813 {
1814 }
1815 // Copy constructor
1816 Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ )
1817  : _radiusX(original_._radiusX),
1818  _radiusY(original_._radiusY),
1819  _xAxisRotation(original_._xAxisRotation),
1820  _largeArcFlag(original_._largeArcFlag),
1821  _sweepFlag(original_._sweepFlag),
1822  _x(original_._x),
1823  _y(original_._y)
1824 {
1825 }
1826 // Destructor
1827 Magick::PathArcArgs::~PathArcArgs ( void )
1828 {
1829 }
1830 
1831 // Path Arc
1832 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ )
1833  : _coordinates(1,coordinates_)
1834 {
1835 }
1836 Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ )
1837  : _coordinates(coordinates_)
1838 {
1839 }
1840 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ )
1841  : VPathBase (original_),
1842  _coordinates(original_._coordinates)
1843 {
1844 }
1845 Magick::PathArcAbs::~PathArcAbs ( void )
1846 {
1847 }
1848 void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ ) const
1849 {
1850  for( PathArcArgsList::const_iterator p = _coordinates.begin();
1851  p != _coordinates.end(); p++ )
1852  {
1853  DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1854  p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1855  (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1856  }
1857 }
1858 Magick::VPathBase* Magick::PathArcAbs::copy() const
1859 {
1860  return new PathArcAbs(*this);
1861 }
1862 
1863 Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ )
1864  : _coordinates(1,coordinates_)
1865 {
1866 }
1867 Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ )
1868  : _coordinates(coordinates_)
1869 {
1870 }
1871 Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ )
1872  : VPathBase (original_),
1873  _coordinates(original_._coordinates)
1874 {
1875 }
1876 Magick::PathArcRel::~PathArcRel ( void )
1877 {
1878 }
1879 void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ ) const
1880 {
1881  for( PathArcArgsList::const_iterator p = _coordinates.begin();
1882  p != _coordinates.end(); p++ )
1883  {
1884  DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1885  p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1886  (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1887  }
1888 }
1889 Magick::VPathBase* Magick::PathArcRel::copy() const
1890 {
1891  return new PathArcRel(*this);
1892 }
1893 
1894 //
1895 // Path Closepath
1896 //
1897 Magick::PathClosePath::~PathClosePath ( void )
1898 {
1899 }
1900 void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ ) const
1901 {
1902  DrawPathClose( context_ );
1903 }
1904 Magick::VPathBase* Magick::PathClosePath::copy() const
1905 {
1906  return new PathClosePath(*this);
1907 }
1908 
1909 //
1910 // Path Curveto (Cubic Bezier)
1911 //
1912 MagickPPExport int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/,
1913  const Magick::PathCurvetoArgs& /*right_*/ )
1914 {
1915  return ( 1 );
1916 }
1917 MagickPPExport int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/,
1918  const Magick::PathCurvetoArgs& /*right_*/ )
1919 {
1920  return ( 0 );
1921 }
1922 MagickPPExport int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/,
1923  const Magick::PathCurvetoArgs& /*right_*/ )
1924 {
1925  return ( 0 );
1926 }
1927 MagickPPExport int Magick::operator < ( const Magick::PathCurvetoArgs& /*left_*/,
1928  const Magick::PathCurvetoArgs& /*right_*/ )
1929 {
1930  return ( false );
1931 }
1932 MagickPPExport int Magick::operator >= ( const Magick::PathCurvetoArgs& left_,
1933  const Magick::PathCurvetoArgs& right_ )
1934 {
1935  return ( ( left_ > right_ ) || ( left_ == right_ ) );
1936 }
1937 MagickPPExport int Magick::operator <= ( const Magick::PathCurvetoArgs& left_,
1938  const Magick::PathCurvetoArgs& right_ )
1939 {
1940  return ( ( left_ < right_ ) || ( left_ == right_ ) );
1941 }
1942 // Default constructor
1943 Magick::PathCurvetoArgs::PathCurvetoArgs( void )
1944  : _x1(0),
1945  _y1(0),
1946  _x2(0),
1947  _y2(0),
1948  _x(0),
1949  _y(0)
1950 {
1951 }
1952 // Normal constructor
1953 Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_,
1954  double x2_, double y2_,
1955  double x_, double y_ )
1956  : _x1(x1_),
1957  _y1(y1_),
1958  _x2(x2_),
1959  _y2(y2_),
1960  _x(x_),
1961  _y(y_)
1962 {
1963 }
1964 // Copy constructor
1965 Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ )
1966  : _x1(original_._x1),
1967  _y1(original_._y1),
1968  _x2(original_._x2),
1969  _y2(original_._y2),
1970  _x(original_._x),
1971  _y(original_._y)
1972 {
1973 }
1974 // Destructor
1975 Magick::PathCurvetoArgs::~PathCurvetoArgs ( void )
1976 {
1977 }
1978 
1979 Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ )
1980  : _args(1,args_)
1981 {
1982 }
1983 Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ )
1984  : _args(args_)
1985 {
1986 }
1987 Magick::PathCurvetoAbs::PathCurvetoAbs
1988  ( const Magick::PathCurvetoAbs& original_ )
1989  : VPathBase (original_),
1990  _args(original_._args)
1991 {
1992 }
1993 Magick::PathCurvetoAbs::~PathCurvetoAbs ( void )
1994 {
1995 }
1996 void Magick::PathCurvetoAbs::operator()
1997  ( MagickCore::DrawingWand * context_ ) const
1998 {
1999  for( PathCurveToArgsList::const_iterator p = _args.begin();
2000  p != _args.end(); p++ )
2001  {
2002  DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2003  p->x(), p->y() );
2004  }
2005 }
2006 Magick::VPathBase* Magick::PathCurvetoAbs::copy() const
2007 {
2008  return new PathCurvetoAbs(*this);
2009 }
2010 Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ )
2011  : _args(1,args_)
2012 {
2013 }
2014 Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ )
2015  : _args(args_)
2016 {
2017 }
2018 Magick::PathCurvetoRel::PathCurvetoRel
2019 ( const Magick::PathCurvetoRel& original_ )
2020  : VPathBase (original_),
2021  _args(original_._args)
2022 {
2023 }
2024 Magick::PathCurvetoRel::~PathCurvetoRel ( void )
2025 {
2026 }
2027 void Magick::PathCurvetoRel::operator()
2028  ( MagickCore::DrawingWand * context_ ) const
2029 {
2030  for( PathCurveToArgsList::const_iterator p = _args.begin();
2031  p != _args.end(); p++ )
2032  {
2033  DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2034  p->x(), p->y() );
2035  }
2036 }
2037 Magick::VPathBase* Magick::PathCurvetoRel::copy() const
2038 {
2039  return new PathCurvetoRel(*this);
2040 }
2041 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2042 ( const Magick::Coordinate &coordinates_ )
2043  : _coordinates(1,coordinates_)
2044 {
2045 }
2046 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2047 ( const CoordinateList &coordinates_ )
2048  : _coordinates(coordinates_)
2049 {
2050 }
2051 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2052 ( const Magick::PathSmoothCurvetoAbs& original_ )
2053  : VPathBase (original_),
2054  _coordinates(original_._coordinates)
2055 {
2056 }
2057 Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void )
2058 {
2059 }
2060 void Magick::PathSmoothCurvetoAbs::operator()
2061  ( MagickCore::DrawingWand * context_ ) const
2062 {
2063  for( CoordinateList::const_iterator p = _coordinates.begin();
2064  p != _coordinates.end(); p++ )
2065  {
2066  double x2 = p->x();
2067  double y2 = p->y();
2068  p++;
2069  if (p == _coordinates.end() )
2070  break;
2071  DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
2072  }
2073 }
2074 Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const
2075 {
2076  return new PathSmoothCurvetoAbs(*this);
2077 }
2078 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2079 ( const Magick::Coordinate &coordinates_ )
2080  : _coordinates(1,coordinates_)
2081 {
2082 }
2083 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2084 ( const CoordinateList &coordinates_ )
2085  : _coordinates(coordinates_)
2086 {
2087 }
2088 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2089 ( const Magick::PathSmoothCurvetoRel& original_ )
2090  : VPathBase (original_),
2091  _coordinates(original_._coordinates)
2092 {
2093 }
2094 Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void )
2095 {
2096 }
2097 void Magick::PathSmoothCurvetoRel::operator()
2098  ( MagickCore::DrawingWand * context_ ) const
2099 {
2100  for( CoordinateList::const_iterator p = _coordinates.begin();
2101  p != _coordinates.end(); p++ )
2102  {
2103  double x2 = p->x();
2104  double y2 = p->y();
2105  p++;
2106  if (p == _coordinates.end() )
2107  break;
2108  DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
2109  }
2110 }
2111 Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const
2112 {
2113  return new PathSmoothCurvetoRel(*this);
2114 }
2115 
2116 //
2117 // Quadratic Curveto (Quadratic Bezier)
2118 //
2119 MagickPPExport int Magick::operator ==
2120 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
2121  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
2122 {
2123  return ( 1 );
2124 }
2125 MagickPPExport int Magick::operator !=
2126 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
2127  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
2128 {
2129  return ( 0 );
2130 }
2131 MagickPPExport int Magick::operator >
2132 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
2133  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
2134 {
2135  return ( 0 );
2136 }
2137 MagickPPExport int Magick::operator <
2138 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
2139  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
2140 {
2141  return ( 0 );
2142 }
2143 MagickPPExport int Magick::operator >=
2144 ( const Magick::PathQuadraticCurvetoArgs& left_,
2145  const Magick::PathQuadraticCurvetoArgs& right_ )
2146 {
2147  return ( ( left_ > right_ ) || ( left_ == right_ ) );
2148 }
2149 MagickPPExport int Magick::operator <=
2150 ( const Magick::PathQuadraticCurvetoArgs& left_,
2151  const Magick::PathQuadraticCurvetoArgs& right_ )
2152 {
2153  return ( ( left_ < right_ ) || ( left_ == right_ ) );
2154 }
2155 // Default Constructor
2156 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void )
2157  : _x1(0),
2158  _y1(0),
2159  _x(0),
2160  _y(0)
2161 {
2162 }
2163 // Normal Constructor
2164 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_,
2165  double y1_,
2166  double x_,
2167  double y_ )
2168  : _x1(x1_),
2169  _y1(y1_),
2170  _x(x_),
2171  _y(y_)
2172 {
2173 }
2174 // Copy Constructor
2175 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ )
2176  : _x1(original_._x1),
2177  _y1(original_._y1),
2178  _x(original_._x),
2179  _y(original_._y)
2180 {
2181 }
2182 // Destructor
2183 Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void )
2184 {
2185 }
2186 
2187 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2188 ( const Magick::PathQuadraticCurvetoArgs &args_ )
2189  : _args(1,args_)
2190 {
2191 }
2192 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2193 ( const PathQuadraticCurvetoArgsList &args_ )
2194  : _args(args_)
2195 {
2196 }
2197 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2198 ( const Magick::PathQuadraticCurvetoAbs& original_ )
2199  : VPathBase (original_),
2200  _args(original_._args)
2201 {
2202 }
2203 Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void )
2204 {
2205 }
2206 void Magick::PathQuadraticCurvetoAbs::operator()
2207  ( MagickCore::DrawingWand * context_ ) const
2208 {
2209  for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2210  p != _args.end(); p++ )
2211  {
2212  DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
2213  p->x(), p->y() );
2214  }
2215 }
2216 Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const
2217 {
2218  return new PathQuadraticCurvetoAbs(*this);
2219 }
2220 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2221 ( const Magick::PathQuadraticCurvetoArgs &args_ )
2222  : _args(1,args_)
2223 {
2224 }
2225 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2226 ( const PathQuadraticCurvetoArgsList &args_ )
2227  : _args(args_)
2228 {
2229 }
2230 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2231 ( const Magick::PathQuadraticCurvetoRel& original_ )
2232  : VPathBase (original_),
2233  _args(original_._args)
2234 {
2235 }
2236 Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void )
2237 {
2238 }
2239 void Magick::PathQuadraticCurvetoRel::operator()
2240  ( MagickCore::DrawingWand * context_ ) const
2241 {
2242  for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2243  p != _args.end(); p++ )
2244  {
2245  DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
2246  p->x(), p->y() );
2247  }
2248 }
2249 Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const
2250 {
2251  return new PathQuadraticCurvetoRel(*this);
2252 }
2253 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2254 ( const Magick::Coordinate &coordinate_ )
2255  : _coordinates(1,coordinate_)
2256 {
2257 }
2258 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2259 ( const CoordinateList &coordinates_ )
2260  : _coordinates(coordinates_)
2261 {
2262 }
2263 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2264 ( const Magick::PathSmoothQuadraticCurvetoAbs& original_ )
2265  : VPathBase (original_),
2266  _coordinates(original_._coordinates)
2267 {
2268 }
2269 Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void )
2270 {
2271 }
2272 void Magick::PathSmoothQuadraticCurvetoAbs::operator()
2273  ( MagickCore::DrawingWand * context_ ) const
2274 {
2275  for( CoordinateList::const_iterator p = _coordinates.begin();
2276  p != _coordinates.end(); p++ )
2277  {
2278  DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
2279  }
2280 }
2281 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const
2282 {
2283  return new PathSmoothQuadraticCurvetoAbs(*this);
2284 }
2285 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2286 ( const Magick::Coordinate &coordinate_ )
2287  : _coordinates(1,coordinate_)
2288 {
2289 }
2290 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2291 ( const CoordinateList &coordinates_ )
2292  : _coordinates(coordinates_)
2293 {
2294 }
2295 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2296 ( const PathSmoothQuadraticCurvetoRel& original_ )
2297  : VPathBase (original_),
2298  _coordinates(original_._coordinates)
2299 {
2300 }
2301 Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void )
2302 {
2303 }
2304 void Magick::PathSmoothQuadraticCurvetoRel::operator()
2305  ( MagickCore::DrawingWand * context_ ) const
2306 {
2307  for( CoordinateList::const_iterator p = _coordinates.begin();
2308  p != _coordinates.end(); p++ )
2309  {
2310  DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
2311  }
2312 }
2313 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const
2314 {
2315  return new PathSmoothQuadraticCurvetoRel(*this);
2316 }
2317 
2318 //
2319 // Path Lineto
2320 //
2321 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_ )
2322  : _coordinates(1,coordinate_)
2323 {
2324 }
2325 Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ )
2326  : _coordinates(coordinates_)
2327 {
2328 }
2329 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ )
2330  : VPathBase (original_),
2331  _coordinates(original_._coordinates)
2332 {
2333 }
2334 Magick::PathLinetoAbs::~PathLinetoAbs ( void )
2335 {
2336 }
2337 void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
2338 {
2339  for( CoordinateList::const_iterator p = _coordinates.begin();
2340  p != _coordinates.end(); p++ )
2341  {
2342  DrawPathLineToAbsolute( context_, p->x(), p->y() );
2343  }
2344 }
2345 Magick::VPathBase* Magick::PathLinetoAbs::copy() const
2346 {
2347  return new PathLinetoAbs(*this);
2348 }
2349 Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_ )
2350  : _coordinates(1,coordinate_)
2351 {
2352 }
2353 Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ )
2354  : _coordinates(coordinates_)
2355 {
2356 }
2357 Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ )
2358  : VPathBase (original_),
2359  _coordinates(original_._coordinates)
2360 {
2361 }
2362 Magick::PathLinetoRel::~PathLinetoRel ( void )
2363 {
2364 }
2365 void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2366 {
2367  for( CoordinateList::const_iterator p = _coordinates.begin();
2368  p != _coordinates.end(); p++ )
2369  {
2370  DrawPathLineToRelative( context_, p->x(), p->y() );
2371  }
2372 }
2373 Magick::VPathBase* Magick::PathLinetoRel::copy() const
2374 {
2375  return new PathLinetoRel(*this);
2376 }
2377 
2378 //
2379 // Path Horizontal Lineto
2380 //
2381 
2382 Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void )
2383 {
2384 }
2385 void Magick::PathLinetoHorizontalAbs::operator()
2386  ( MagickCore::DrawingWand * context_ ) const
2387 {
2388  DrawPathLineToHorizontalAbsolute( context_, _x );
2389 }
2390 Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const
2391 {
2392  return new PathLinetoHorizontalAbs(*this);
2393 }
2394 Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void )
2395 {
2396 }
2397 void Magick::PathLinetoHorizontalRel::operator()
2398  ( MagickCore::DrawingWand * context_ ) const
2399 {
2400  DrawPathLineToHorizontalRelative( context_, _x );
2401 }
2402 Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const
2403 {
2404  return new PathLinetoHorizontalRel(*this);
2405 }
2406 
2407 //
2408 // Path Vertical Lineto
2409 //
2410 Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void )
2411 {
2412 }
2413 void Magick::PathLinetoVerticalAbs::operator()
2414  ( MagickCore::DrawingWand * context_ ) const
2415 {
2416  DrawPathLineToVerticalAbsolute( context_, _y );
2417 }
2418 Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const
2419 {
2420  return new PathLinetoVerticalAbs(*this);
2421 }
2422 Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void )
2423 {
2424 }
2425 void Magick::PathLinetoVerticalRel::operator()
2426  ( MagickCore::DrawingWand * context_ ) const
2427 {
2428  DrawPathLineToVerticalRelative( context_, _y );
2429 }
2430 Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const
2431 {
2432  return new PathLinetoVerticalRel(*this);
2433 }
2434 
2435 //
2436 // Path Moveto
2437 //
2438 
2439 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ )
2440  : _coordinates(1,coordinate_)
2441 {
2442 }
2443 Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ )
2444  : _coordinates(coordinates_)
2445 {
2446 }
2447 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ )
2448  : VPathBase (original_),
2449  _coordinates(original_._coordinates)
2450 {
2451 }
2452 Magick::PathMovetoAbs::~PathMovetoAbs ( void )
2453 {
2454 }
2455 void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
2456 {
2457  for( CoordinateList::const_iterator p = _coordinates.begin();
2458  p != _coordinates.end(); p++ )
2459  {
2460  DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2461  }
2462 }
2463 Magick::VPathBase* Magick::PathMovetoAbs::copy() const
2464 {
2465  return new PathMovetoAbs(*this);
2466 }
2467 Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ )
2468  : _coordinates(1,coordinate_)
2469 {
2470 }
2471 Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ )
2472  : _coordinates(coordinates_)
2473 {
2474 }
2475 Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ )
2476  : VPathBase (original_),
2477  _coordinates(original_._coordinates)
2478 {
2479 }
2480 Magick::PathMovetoRel::~PathMovetoRel ( void )
2481 {
2482 }
2483 void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2484 {
2485  for( CoordinateList::const_iterator p = _coordinates.begin();
2486  p != _coordinates.end(); p++ )
2487  {
2488  DrawPathMoveToRelative( context_, p->x(), p->y() );
2489  }
2490 }
2491 Magick::VPathBase* Magick::PathMovetoRel::copy() const
2492 {
2493  return new PathMovetoRel(*this);
2494 }