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