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