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