• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
4 // Copyright Dirk Lemstra 2014-2017
5 //
6 // Definition of Drawable (Graphic objects)
7 //
8 // The technique used for instantiating classes which derive from STL
9 // templates is described in Microsoft MSDN Article ID: Q168958
10 // "HOWTO: Exporting STL Components Inside & Outside of a Class".
11 // "http://support.microsoft.com/kb/168958"
12 //
13 // Note that version 3.0 of this article says that that only STL
14 // container template which supports DLL export is <vector> and we are
15 // not using <vector> as part of the Drawable implementation.
16 //
17 
18 #if !defined(Magick_Drawable_header)
19 #define Magick_Drawable_header
20 
21 #include "Magick++/Include.h"
22 
23 #include <functional>
24 #include <string>
25 #include <vector>
26 #include <utility>
27 #include "Magick++/Color.h"
28 #include "Magick++/Geometry.h"
29 
30 #if defined(MagickDLLExplicitTemplate)
31 #  if defined(MAGICK_PLUSPLUS_IMPLEMENTATION)
32 #    define MagickDrawableExtern
33 #  else
34 #   pragma warning( disable: 4231 ) // Disable warning regarding using extern
35 #    define MagickDrawableExtern extern
36 #  endif // MAGICK_PLUSPLUS_IMPLEMENTATION
37 #else
38 #  define MagickDrawableExtern
39 #endif // MagickDLLExplicitTemplate
40 
41 namespace Magick
42 {
43   //
44   // Representation of an x,y coordinate
45   //
46   class MagickPPExport Coordinate
47   {
48   public:
49 
Coordinate(void)50     Coordinate(void)
51       : _x(0),
52         _y(0) {}
53 
Coordinate(double x_,double y_)54     Coordinate(double x_,double y_)
55       : _x(x_),
56         _y(y_) {}
57 
~Coordinate()58     virtual ~Coordinate() {}
59 
x(double x_)60     void x(double x_) { _x=x_; }
x(void)61     double x(void) const { return _x; }
62 
y(double y_)63     void y(double y_) { _y=y_; }
y(void)64     double y(void) const { return _y; }
65 
66   private:
67     double _x;
68     double _y;
69   };
70 
71   typedef std::vector<Magick::Coordinate> CoordinateList;
72 
73 #if defined(MagickDLLExplicitTemplate)
74 
75   MagickDrawableExtern template class MagickPPExport
76   std::allocator<Magick::Coordinate>;
77 
78 #endif // MagickDLLExplicitTemplate
79 
80   // Compare two Coordinate objects regardless of LHS/RHS
81   extern MagickPPExport int operator ==
82     (const Coordinate& left_,const Coordinate& right_);
83   extern MagickPPExport int operator !=
84     (const Coordinate& left_, const Coordinate& right_);
85   extern MagickPPExport int operator >
86     (const Coordinate& left_, const Coordinate& right_);
87   extern MagickPPExport int operator <
88     (const Coordinate& left_, const Coordinate& right_);
89   extern MagickPPExport int operator >=
90     (const Coordinate& left_, const Coordinate& right_);
91   extern MagickPPExport int operator <=
92     (const Coordinate& left_, const Coordinate& right_);
93 
94   //
95   // Base class for all drawable objects
96   //
97   class MagickPPExport DrawableBase
98   {
99   public:
100 
101     // Default constructor
102     DrawableBase(void);
103 
104     // Destructor
105     virtual ~DrawableBase(void);
106 
107     // Operator to invoke equivalent draw API call
108     virtual void operator()(MagickCore::DrawingWand *) const;
109 
110     // Return polymorphic copy of object
111     virtual DrawableBase* copy() const;
112   };
113 
114   //
115   // Representation of a drawable surrogate object to manage drawable objects
116   //
117   #undef Drawable // Conflict with <X11/Xproto.h>
118   class MagickPPExport Drawable
119   {
120   public:
121 
122     // Default constructor
123     Drawable(void);
124 
125     // Construct from DrawableBase
126     Drawable(const DrawableBase& original_);
127 
128     // Destructor
129     ~Drawable(void);
130 
131     // Copy constructor
132     Drawable(const Drawable& original_);
133 
134     // Assignment operator
135     Drawable& operator=(const Drawable& original_);
136 
137     // Operator to invoke contained object
138     void operator()(MagickCore::DrawingWand *) const;
139 
140   private:
141     DrawableBase* dp;
142   };
143 
144   typedef std::vector<Magick::Drawable> DrawableList;
145 
146 #if defined(MagickDLLExplicitTemplate)
147 
148   MagickDrawableExtern template class MagickPPExport
149   std::allocator<Magick::Drawable>;
150 
151 #endif // MagickDLLExplicitTemplate
152 
153 //
154 // Base class for all drawable path elements for use with
155 // DrawablePath
156 //
157 class MagickPPExport VPathBase
158 {
159 public:
160   // Constructor
VPathBase(void)161   VPathBase ( void )
162     { }
163 
164   // Destructor
165   virtual ~VPathBase ( void );
166 
167   // Assignment operator
168   //    const VPathBase& operator= (const VPathBase& original_ );
169 
170   // Operator to invoke equivalent draw API call
171   virtual void operator()( MagickCore::DrawingWand *context_ ) const = 0;
172 
173   // Return polymorphic copy of object
174   virtual VPathBase* copy() const = 0;
175 };
176 
177 //
178 // Representation of a drawable path element surrogate object to
179 // manage drawable path elements so they may be passed as a list to
180 // DrawablePath.
181 //
182 class MagickPPExport VPath
183 {
184 public:
185   // Constructor
186   VPath ( void );
187 
188   // Construct from VPathBase
189   VPath ( const VPathBase& original_ );
190 
191   // Destructor
192   virtual ~VPath ( void );
193 
194   // Copy constructor
195   VPath ( const VPath& original_ );
196 
197   // Assignment operator
198   VPath& operator= (const VPath& original_ );
199 
200   // Operator to invoke contained object
201   void operator()( MagickCore::DrawingWand *context_ ) const;
202 
203 private:
204   VPathBase* dp;
205 };
206 
207 typedef std::vector<Magick::VPath> VPathList;
208 
209 #if defined(MagickDLLExplicitTemplate)
210 
211 MagickDrawableExtern template class MagickPPExport
212 std::allocator<Magick::VPath>;
213 
214 // MagickDrawableExtern template class MagickPPExport
215 // std::vector<Magick::VPath, std::allocator<Magick::VPath> >;
216 
217 #endif // MagickDLLExplicitTemplate
218 
219 //
220 // Drawable Objects
221 //
222 
223 // Affine (scaling, rotation, and translation)
224 class MagickPPExport DrawableAffine  : public DrawableBase
225 {
226 public:
227   DrawableAffine ( double sx_, double sy_,
228                    double rx_, double ry_,
229                    double tx_, double ty_ );
230 
231   DrawableAffine ( void );
232 
233   /*virtual*/ ~DrawableAffine( void );
234 
235   // Operator to invoke equivalent draw API call
236   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
237 
238   // Return polymorphic copy of object
239   /*virtual*/
240   DrawableBase* copy() const;
241 
sx(const double sx_)242   void sx( const double sx_ )
243     {
244       _affine.sx = sx_;
245     }
sx(void)246   double sx( void ) const
247     {
248       return _affine.sx;
249     }
250 
sy(const double sy_)251   void sy( const double sy_ )
252     {
253       _affine.sy = sy_;
254     }
sy(void)255   double sy( void ) const
256     {
257       return _affine.sy;
258     }
259 
rx(const double rx_)260   void rx( const double rx_ )
261     {
262       _affine.rx = rx_;
263     }
rx(void)264   double rx( void ) const
265     {
266       return _affine.rx;
267     }
268 
ry(const double ry_)269   void ry( const double ry_ )
270     {
271       _affine.ry = ry_;
272     }
ry(void)273   double ry( void ) const
274     {
275       return _affine.ry;
276     }
277 
tx(const double tx_)278   void tx( const double tx_ )
279     {
280       _affine.tx = tx_;
281     }
tx(void)282   double tx( void ) const
283     {
284       return _affine.tx;
285     }
286 
ty(const double ty_)287   void ty( const double ty_ )
288     {
289       _affine.ty = ty_;
290     }
ty(void)291   double ty( void ) const
292     {
293       return _affine.ty;
294     }
295 
296 private:
297   MagickCore::AffineMatrix  _affine;
298 };
299 
300 // Change pixel alpha value to transparent using PaintMethod
301 class MagickPPExport DrawableAlpha : public DrawableBase
302 {
303 public:
304 
DrawableAlpha(double x_,double y_,PaintMethod paintMethod_)305     DrawableAlpha(double x_, double y_,PaintMethod paintMethod_)
306       : _x(x_),
307         _y(y_),
308         _paintMethod(paintMethod_)
309     {
310     }
311 
312     ~DrawableAlpha(void);
313 
314     // Operator to invoke equivalent draw API call
315     void operator()(MagickCore::DrawingWand *context_) const;
316 
317     // Return polymorphic copy of object
318     DrawableBase* copy() const;
319 
x(double x_)320     void x(double x_)
321     {
322       _x=x_;
323     }
324 
x(void)325     double x(void) const
326     {
327       return(_x);
328     }
329 
y(double y_)330     void y(double y_)
331     {
332       _y=y_;
333     }
334 
y(void)335     double y(void) const
336     {
337       return(_y);
338     }
339 
paintMethod(PaintMethod paintMethod_)340     void paintMethod(PaintMethod paintMethod_)
341     {
342       _paintMethod=paintMethod_;
343     }
344 
paintMethod(void)345     PaintMethod paintMethod(void) const
346     {
347       return(_paintMethod);
348     }
349 
350   private:
351 
352     double _x;
353     double _y;
354     PaintMethod _paintMethod;
355 };
356 
357 // Arc
358 class MagickPPExport DrawableArc : public DrawableBase
359 {
360 public:
DrawableArc(double startX_,double startY_,double endX_,double endY_,double startDegrees_,double endDegrees_)361   DrawableArc ( double startX_, double startY_,
362                 double endX_, double endY_,
363                 double startDegrees_, double endDegrees_ )
364     : _startX(startX_),
365       _startY(startY_),
366       _endX(endX_),
367       _endY(endY_),
368       _startDegrees(startDegrees_),
369       _endDegrees(endDegrees_)
370     { }
371 
372   /*virtual*/ ~DrawableArc( void );
373 
374   // Operator to invoke equivalent draw API call
375   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
376 
377   // Return polymorphic copy of object
378   /*virtual*/ DrawableBase* copy() const;
379 
startX(double startX_)380   void startX( double startX_ )
381     {
382       _startX = startX_;
383     }
startX(void)384   double startX( void ) const
385     {
386       return _startX;
387     }
388 
startY(double startY_)389   void startY( double startY_ )
390     {
391       _startY = startY_;
392     }
startY(void)393   double startY( void ) const
394     {
395       return _startY;
396     }
397 
endX(double endX_)398   void endX( double endX_ )
399     {
400       _endX = endX_;
401     }
endX(void)402   double endX( void ) const
403     {
404       return _endX;
405     }
406 
endY(double endY_)407   void endY( double endY_ )
408     {
409       _endY = endY_;
410     }
endY(void)411   double endY( void ) const
412     {
413       return _endY;
414     }
415 
startDegrees(double startDegrees_)416   void startDegrees( double startDegrees_ )
417     {
418       _startDegrees = startDegrees_;
419     }
startDegrees(void)420   double startDegrees( void ) const
421     {
422       return _startDegrees;
423     }
424 
endDegrees(double endDegrees_)425   void endDegrees( double endDegrees_ )
426     {
427       _endDegrees = endDegrees_;
428     }
endDegrees(void)429   double endDegrees( void ) const
430     {
431       return _endDegrees;
432     }
433 
434 private:
435   double _startX;
436   double _startY;
437   double _endX;
438   double _endY;
439   double _startDegrees;
440   double _endDegrees;
441 };
442 
443 // Bezier curve (Coordinate list must contain at least three members)
444 class MagickPPExport DrawableBezier : public DrawableBase
445 {
446 public:
447   // Construct from coordinates
448   DrawableBezier ( const CoordinateList &coordinates_ );
449 
450   // Copy constructor
451   DrawableBezier ( const DrawableBezier& original_ );
452 
453   // Destructor
454   /*virtual*/ ~DrawableBezier ( void );
455 
456   // Operator to invoke equivalent draw API call
457   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
458 
459   // Return polymorphic copy of object
460   /*virtual*/ DrawableBase* copy() const;
461 
462 private:
463   CoordinateList _coordinates;
464 };
465 
466   // Sets the border color to be used for drawing bordered objects.
467   class MagickPPExport DrawableBorderColor : public DrawableBase
468   {
469   public:
470 
471     DrawableBorderColor(const Color &color_);
472 
473     DrawableBorderColor(const DrawableBorderColor &original_);
474 
475     ~DrawableBorderColor(void);
476 
477     // Operator to invoke equivalent draw API call
478     void operator()(MagickCore::DrawingWand *context_) const;
479 
480     void color(const Color &color_);
481     Color color(void) const;
482 
483     // Return polymorphic copy of object
484     DrawableBase* copy() const;
485 
486   private:
487     Color _color;
488   };
489 
490   // Sets the polygon fill rule to be used by the clipping path.
491   class MagickPPExport DrawableClipRule : public DrawableBase
492   {
493   public:
494 
495     DrawableClipRule(const FillRule fillRule_);
496 
497     ~DrawableClipRule(void);
498 
499     // Operator to invoke equivalent draw API call
500     void operator()(MagickCore::DrawingWand *context_) const;
501 
502     void fillRule(const FillRule fillRule_);
503     FillRule fillRule(void) const;
504 
505     // Return polymorphic copy of object
506     DrawableBase* copy() const;
507 
508   private:
509     FillRule _fillRule;
510   };
511 
512   // Sets the interpretation of clip path units.
513   class MagickPPExport DrawableClipUnits : public DrawableBase
514   {
515   public:
516 
517     DrawableClipUnits(const ClipPathUnits units_);
518 
519     ~DrawableClipUnits(void);
520 
521     // Operator to invoke equivalent draw API call
522     void operator()(MagickCore::DrawingWand *context_) const;
523 
524     void units(const ClipPathUnits units_);
525     ClipPathUnits units(void) const;
526 
527     // Return polymorphic copy of object
528     DrawableBase* copy() const;
529 
530   private:
531     ClipPathUnits _units;
532   };
533 
534 // Pop (terminate) clip path definition
535 class MagickPPExport DrawablePopClipPath : public DrawableBase
536 {
537 public:
DrawablePopClipPath(void)538   DrawablePopClipPath ( void )
539     : _dummy(0)
540     {
541     }
542 
543   /*virtual*/ ~DrawablePopClipPath ( void );
544 
545   // Operator to invoke equivalent draw API call
546   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
547 
548   // Return polymorphic copy of object
549   /*virtual*/ DrawableBase* copy() const;
550 
551 private:
552   ::ssize_t   _dummy;
553 };
554 
555 // Push (create) Clip path definition
556 class MagickPPExport DrawablePushClipPath : public DrawableBase
557 {
558 public:
559   DrawablePushClipPath ( const std::string &id_);
560 
561   DrawablePushClipPath ( const DrawablePushClipPath& original_ );
562 
563   /*virtual*/ ~DrawablePushClipPath ( void );
564 
565   // Operator to invoke equivalent draw API call
566   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
567 
568   // Return polymorphic copy of object
569   /*virtual*/ DrawableBase* copy() const;
570 
571 private:
572   std::string _id;
573 };
574 
575 // Named Clip Path
576 class MagickPPExport DrawableClipPath : public DrawableBase
577 {
578 public:
579   DrawableClipPath ( const std::string &id_ );
580   DrawableClipPath ( const DrawableClipPath& original_ );
581 
582   /*virtual*/ ~DrawableClipPath ( void );
583 
584   // Operator to invoke equivalent draw API call
585   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
586 
587   // Return polymorphic copy of object
588   /*virtual*/ DrawableBase* copy() const;
589 
clip_path(const std::string & id_)590   void clip_path( const std::string &id_ )
591     {
592       _id = id_.c_str(); //multithread safe
593     }
clip_path(void)594   std::string clip_path( void ) const
595     {
596       return _id;
597     }
598 
599 private:
600   std::string   _id;
601 };
602 
603 // Circle
604 class MagickPPExport DrawableCircle : public DrawableBase
605 {
606 public:
DrawableCircle(double originX_,double originY_,double perimX_,double perimY_)607   DrawableCircle ( double originX_, double originY_,
608                    double perimX_, double perimY_ )
609     : _originX(originX_),
610       _originY(originY_),
611       _perimX(perimX_),
612       _perimY(perimY_)
613     {
614     }
615 
616   /*virtual*/ ~DrawableCircle ( void );
617 
618   // Operator to invoke equivalent draw API call
619   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
620 
621   // Return polymorphic copy of object
622   /*virtual*/ DrawableBase* copy() const;
623 
originX(double originX_)624   void originX( double originX_ )
625     {
626       _originX = originX_;
627     }
originX(void)628   double originX( void ) const
629     {
630       return _originX;
631     }
632 
originY(double originY_)633   void originY( double originY_ )
634     {
635       _originY = originY_;
636     }
originY(void)637   double originY( void ) const
638     {
639       return _originY;
640     }
641 
perimX(double perimX_)642   void perimX( double perimX_ )
643     {
644       _perimX = perimX_;
645     }
perimX(void)646   double perimX( void ) const
647     {
648       return _perimX;
649     }
650 
perimY(double perimY_)651   void perimY( double perimY_ )
652     {
653       _perimY = perimY_;
654     }
perimY(void)655   double perimY( void ) const
656     {
657       return _perimY;
658     }
659 
660 private:
661   double _originX;
662   double _originY;
663   double _perimX;
664   double _perimY;
665 };
666 
667 // Colorize at point using PaintMethod
668 class MagickPPExport DrawableColor : public DrawableBase
669 {
670 public:
DrawableColor(double x_,double y_,PaintMethod paintMethod_)671   DrawableColor ( double x_, double y_,
672                   PaintMethod paintMethod_ )
673     : _x(x_),
674       _y(y_),
675       _paintMethod(paintMethod_)
676     { }
677 
678   /*virtual*/ ~DrawableColor ( void );
679 
680   // Operator to invoke equivalent draw API call
681   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
682 
683   // Return polymorphic copy of object
684   /*virtual*/ DrawableBase* copy() const;
685 
x(double x_)686   void x( double x_ )
687     {
688       _x = x_;
689     }
x(void)690   double x( void ) const
691     {
692       return _x;
693     }
694 
y(double y_)695   void y( double y_ )
696     {
697       _y = y_;
698     }
y(void)699   double y( void ) const
700     {
701       return _y;
702     }
703 
paintMethod(PaintMethod paintMethod_)704   void paintMethod( PaintMethod paintMethod_ )
705     {
706       _paintMethod = paintMethod_;
707     }
paintMethod(void)708   PaintMethod paintMethod( void ) const
709     {
710       return _paintMethod;
711     }
712 
713 private:
714   double _x;
715   double _y;
716   PaintMethod _paintMethod;
717 };
718 
719 // Draw image at point, scaled to size specified by width and height
720 class MagickPPExport Image;
721 class MagickPPExport DrawableCompositeImage : public DrawableBase
722 {
723 public:
724   DrawableCompositeImage ( double x_, double y_,
725                            const std::string &filename_ );
726 
727   DrawableCompositeImage ( double x_, double y_,
728                            const Image &image_ );
729 
730   DrawableCompositeImage ( double x_, double y_,
731                            double width_, double height_,
732                            const std::string &filename_ );
733 
734   DrawableCompositeImage ( double x_, double y_,
735                            double width_, double height_,
736                            const Image &image_ );
737 
738   DrawableCompositeImage ( double x_, double y_,
739                            double width_, double height_,
740                            const std::string &filename_,
741                            CompositeOperator composition_ );
742 
743   DrawableCompositeImage ( double x_, double y_,
744                            double width_, double height_,
745                            const Image &image_,
746                            CompositeOperator composition_ );
747 
748   // Copy constructor
749   DrawableCompositeImage ( const DrawableCompositeImage& original_ );
750 
751   // Destructor
752   /*virtual*/ ~DrawableCompositeImage( void );
753 
754   // Assignment operator
755   DrawableCompositeImage& operator=
756   (const DrawableCompositeImage& original_ );
757 
758   // Operator to invoke equivalent draw API call
759   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
760 
761   // Return polymorphic copy of object
762   /*virtual*/ DrawableBase* copy() const;
763 
composition(CompositeOperator composition_)764   void composition( CompositeOperator composition_ )
765     {
766       _composition = composition_;
767     }
composition(void)768   CompositeOperator composition( void ) const
769     {
770       return _composition;
771     }
772 
773   void filename( const std::string &image_ );
774   std::string filename( void ) const;
775 
x(double x_)776   void x( double x_ )
777     {
778       _x = x_;
779     }
x(void)780   double x( void ) const
781     {
782       return _x;
783     }
784 
y(double y_)785   void y( double y_ )
786     {
787       _y = y_;
788     }
y(void)789   double y( void ) const
790     {
791       return _y;
792     }
793 
width(double width_)794   void width( double width_ )
795     {
796       _width = width_;
797     }
width(void)798   double width( void ) const
799     {
800       return _width;
801     }
802 
height(double height_)803   void height( double height_ )
804     {
805       _height = height_;
806     }
height(void)807   double height( void ) const
808     {
809       return _height;
810     }
811 
812   void image( const Image &image_ );
813   Magick::Image image( void ) const;
814 
815   // Specify image format used to output Base64 inlined image data.
816   void magick( std::string magick_ );
817   std::string magick( void );
818 
819 private:
820   CompositeOperator  _composition;
821   double             _x;
822   double             _y;
823   double             _width;
824   double             _height;
825   Image*             _image;
826 };
827 
828 // Density
829 class MagickPPExport DrawableDensity : public DrawableBase
830 {
831 public:
832 
833   DrawableDensity(const Point &density_);
834 
835   DrawableDensity(const std::string &density_);
836 
837   ~DrawableDensity(void);
838 
839   void operator()(MagickCore::DrawingWand *context_) const;
840 
841   DrawableBase* copy() const;
842 
843 private:
844   std::string _density;
845 };
846 
847 // Ellipse
848 class MagickPPExport DrawableEllipse : public DrawableBase
849 {
850 public:
DrawableEllipse(double originX_,double originY_,double radiusX_,double radiusY_,double arcStart_,double arcEnd_)851   DrawableEllipse ( double originX_, double originY_,
852                     double radiusX_, double radiusY_,
853                     double arcStart_, double arcEnd_ )
854     : _originX(originX_),
855       _originY(originY_),
856       _radiusX(radiusX_),
857       _radiusY(radiusY_),
858       _arcStart(arcStart_),
859       _arcEnd(arcEnd_)
860     { }
861 
862   /*virtual*/ ~DrawableEllipse( void );
863 
864   // Operator to invoke equivalent draw API call
865   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
866 
867   // Return polymorphic copy of object
868   /*virtual*/ DrawableBase* copy() const;
869 
originX(double originX_)870   void originX( double originX_ )
871     {
872       _originX = originX_;
873     }
originX(void)874   double originX( void ) const
875     {
876       return _originX;
877     }
878 
originY(double originY_)879   void originY( double originY_ )
880     {
881       _originY = originY_;
882     }
originY(void)883   double originY( void ) const
884     {
885       return _originY;
886     }
887 
radiusX(double radiusX_)888   void radiusX( double radiusX_ )
889     {
890       _radiusX = radiusX_;
891     }
radiusX(void)892   double radiusX( void ) const
893     {
894       return _radiusX;
895     }
896 
radiusY(double radiusY_)897   void radiusY( double radiusY_ )
898     {
899       _radiusY = radiusY_;
900     }
radiusY(void)901   double radiusY( void ) const
902     {
903       return _radiusY;
904     }
905 
arcStart(double arcStart_)906   void arcStart( double arcStart_ )
907     {
908       _arcStart = arcStart_;
909     }
arcStart(void)910   double arcStart( void ) const
911     {
912       return _arcStart;
913     }
914 
arcEnd(double arcEnd_)915   void arcEnd( double arcEnd_ )
916     {
917       _arcEnd = arcEnd_;
918     }
arcEnd(void)919   double arcEnd( void ) const
920     {
921       return _arcEnd;
922     }
923 
924 private:
925   double _originX;
926   double _originY;
927   double _radiusX;
928   double _radiusY;
929   double _arcStart;
930   double _arcEnd;
931 };
932 
933 // Specify drawing fill color
934 class MagickPPExport DrawableFillColor : public DrawableBase
935 {
936 public:
937   DrawableFillColor ( const Color &color_ );
938 
939   DrawableFillColor ( const DrawableFillColor& original_ );
940 
941   /*virtual*/ ~DrawableFillColor( void );
942 
943   // Operator to invoke equivalent draw API call
944   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
945 
946   // Return polymorphic copy of object
947   /*virtual*/ DrawableBase* copy() const;
948 
color(const Color & color_)949   void color( const Color &color_ )
950     {
951       _color = color_;
952     }
color(void)953   Color color( void ) const
954     {
955       return _color;
956     }
957 
958 private:
959   Color _color;
960 };
961 
962   // Sets the URL to use as a fill pattern for filling objects. Only local
963   // URLs("#identifier") are supported at this time. These local URLs are
964   // normally created by defining a named fill pattern with
965   // DrawablePushPattern/DrawablePopPattern.
966   class MagickPPExport DrawableFillPatternUrl : public DrawableBase
967   {
968   public:
969 
970     DrawableFillPatternUrl(const std::string &url_);
971 
972     ~DrawableFillPatternUrl(void);
973 
974     DrawableFillPatternUrl(const DrawableFillPatternUrl& original_);
975 
976     // Operator to invoke equivalent draw API call
977     void operator()(MagickCore::DrawingWand *context_) const;
978 
979     void url(const std::string &url_);
980     std::string url(void) const;
981 
982     // Return polymorphic copy of object
983     DrawableBase* copy() const;
984 
985   private:
986     std::string _url;
987   };
988 
989 // Specify fill rule (fill-rule)
990 class MagickPPExport DrawableFillRule : public DrawableBase
991 {
992 public:
DrawableFillRule(const FillRule fillRule_)993   DrawableFillRule ( const FillRule fillRule_ )
994     : _fillRule(fillRule_)
995     {
996     }
997 
998   /*virtual*/ ~DrawableFillRule ( void );
999 
1000   // Operator to invoke equivalent draw API call
1001   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1002 
1003   // Return polymorphic copy of object
1004   /*virtual*/ DrawableBase* copy() const;
1005 
fillRule(const FillRule fillRule_)1006   void fillRule( const FillRule fillRule_ )
1007     {
1008       _fillRule = fillRule_;
1009     }
fillRule(void)1010   FillRule fillRule( void ) const
1011     {
1012       return _fillRule;
1013     }
1014 
1015 private:
1016   FillRule _fillRule;
1017 };
1018 
1019 // Specify drawing fill alpha
1020 class MagickPPExport DrawableFillOpacity : public DrawableBase
1021 {
1022 public:
1023 
DrawableFillOpacity(double opacity_)1024   DrawableFillOpacity(double opacity_)
1025     : _opacity(opacity_)
1026   {
1027   }
1028 
1029   ~DrawableFillOpacity ( void );
1030 
1031   // Operator to invoke equivalent draw API call
1032   void operator()(MagickCore::DrawingWand *context_) const;
1033 
1034   // Return polymorphic copy of object
1035   DrawableBase* copy() const;
1036 
opacity(double opacity_)1037   void opacity(double opacity_)
1038   {
1039     _opacity=opacity_;
1040   }
1041 
opacity(void)1042   double opacity(void) const
1043   {
1044     return(_opacity);
1045   }
1046 
1047 private:
1048   double _opacity;
1049 };
1050 
1051 // Specify text font
1052 class MagickPPExport DrawableFont : public DrawableBase
1053 {
1054 public:
1055   DrawableFont ( const std::string &font_ );
1056 
1057   DrawableFont ( const std::string &family_,
1058                  StyleType style_,
1059                  const unsigned int weight_,
1060                  StretchType stretch_ );
1061   DrawableFont ( const DrawableFont& original_ );
1062 
1063   /*virtual*/ ~DrawableFont ( void );
1064 
1065   // Operator to invoke equivalent draw API call
1066   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1067 
1068   // Return polymorphic copy of object
1069   /*virtual*/ DrawableBase* copy() const;
1070 
font(const std::string & font_)1071   void font( const std::string &font_ )
1072     {
1073       _font = font_;
1074     }
font(void)1075   std::string font( void ) const
1076     {
1077       return _font;
1078     }
1079 
1080 private:
1081   std::string   _font;
1082   std::string   _family;
1083   StyleType     _style;
1084   unsigned int _weight;
1085   StretchType   _stretch;
1086 };
1087 
1088 // Specify text positioning gravity
1089 class MagickPPExport DrawableGravity : public DrawableBase
1090 {
1091 public:
DrawableGravity(GravityType gravity_)1092   DrawableGravity ( GravityType gravity_ )
1093     : _gravity(gravity_)
1094     {
1095     }
1096 
1097   /*virtual*/ ~DrawableGravity ( void );
1098 
1099   // Operator to invoke equivalent draw API call
1100   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1101 
1102   // Return polymorphic copy of object
1103   /*virtual*/ DrawableBase* copy() const;
1104 
gravity(GravityType gravity_)1105   void gravity( GravityType gravity_ )
1106     {
1107       _gravity = gravity_;
1108     }
gravity(void)1109   GravityType gravity( void ) const
1110     {
1111       return _gravity;
1112     }
1113 
1114 private:
1115   GravityType _gravity;
1116 };
1117 
1118 // Line
1119 class MagickPPExport DrawableLine : public DrawableBase
1120 {
1121 public:
DrawableLine(double startX_,double startY_,double endX_,double endY_)1122   DrawableLine ( double startX_, double startY_,
1123                  double endX_, double endY_ )
1124     : _startX(startX_),
1125       _startY(startY_),
1126       _endX(endX_),
1127       _endY(endY_)
1128     { }
1129 
1130   /*virtual*/ ~DrawableLine ( void );
1131 
1132   // Operator to invoke equivalent draw API call
1133   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1134 
1135   // Return polymorphic copy of object
1136   /*virtual*/ DrawableBase* copy() const;
1137 
startX(double startX_)1138   void startX( double startX_ )
1139     {
1140       _startX = startX_;
1141     }
startX(void)1142   double startX( void ) const
1143     {
1144       return _startX;
1145     }
1146 
startY(double startY_)1147   void startY( double startY_ )
1148     {
1149       _startY = startY_;
1150     }
startY(void)1151   double startY( void ) const
1152     {
1153       return _startY;
1154     }
1155 
endX(double endX_)1156   void endX( double endX_ )
1157     {
1158       _endX = endX_;
1159     }
endX(void)1160   double endX( void ) const
1161     {
1162       return _endX;
1163     }
1164 
endY(double endY_)1165   void endY( double endY_ )
1166     {
1167       _endY = endY_;
1168     }
endY(void)1169   double endY( void ) const
1170     {
1171       return _endY;
1172     }
1173 
1174 private:
1175   double _startX;
1176   double _startY;
1177   double _endX;
1178   double _endY;
1179 };
1180 
1181 // Drawable Path
1182 class MagickPPExport DrawablePath : public DrawableBase
1183 {
1184 public:
1185   DrawablePath ( const VPathList &path_ );
1186 
1187   DrawablePath ( const DrawablePath& original_ );
1188 
1189   /*virtual*/ ~DrawablePath ( void );
1190 
1191   // Operator to invoke equivalent draw API call
1192   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1193 
1194   // Return polymorphic copy of object
1195   /*virtual*/ DrawableBase* copy() const;
1196 
1197 private:
1198   VPathList _path;
1199 };
1200 
1201 // Point
1202 class MagickPPExport DrawablePoint : public DrawableBase
1203 {
1204 public:
DrawablePoint(double x_,double y_)1205   DrawablePoint ( double x_, double y_ )
1206     : _x(x_),
1207       _y(y_)
1208     { }
1209 
1210   /*virtual*/ ~DrawablePoint ( void );
1211 
1212   // Operator to invoke equivalent draw API call
1213   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1214 
1215   // Return polymorphic copy of object
1216   /*virtual*/ DrawableBase* copy() const;
1217 
x(double x_)1218   void x( double x_ )
1219     {
1220       _x = x_;
1221     }
x(void)1222   double x( void ) const
1223     {
1224       return _x;
1225     }
1226 
y(double y_)1227   void y( double y_ )
1228     {
1229       _y = y_;
1230     }
y(void)1231   double y( void ) const
1232     {
1233       return _y;
1234     }
1235 
1236 private:
1237   double _x;
1238   double _y;
1239 };
1240 
1241 // Text pointsize
1242 class MagickPPExport DrawablePointSize : public DrawableBase
1243 {
1244 public:
DrawablePointSize(double pointSize_)1245   DrawablePointSize ( double pointSize_ )
1246     : _pointSize(pointSize_)
1247     { }
1248 
1249   /*virtual*/ ~DrawablePointSize ( void );
1250 
1251   // Operator to invoke equivalent draw API call
1252   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1253 
1254   // Return polymorphic copy of object
1255   /*virtual*/ DrawableBase* copy() const;
1256 
pointSize(double pointSize_)1257   void pointSize( double pointSize_ )
1258     {
1259       _pointSize = pointSize_;
1260     }
pointSize(void)1261   double pointSize( void ) const
1262     {
1263       return _pointSize;
1264     }
1265 
1266 private:
1267   double _pointSize;
1268 };
1269 
1270 // Polygon (Coordinate list must contain at least three members)
1271 class MagickPPExport DrawablePolygon : public DrawableBase
1272 {
1273 public:
1274   DrawablePolygon ( const CoordinateList &coordinates_ );
1275 
1276   DrawablePolygon ( const DrawablePolygon& original_ );
1277 
1278   /*virtual*/ ~DrawablePolygon ( void );
1279 
1280   // Operator to invoke equivalent draw API call
1281   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1282 
1283   // Return polymorphic copy of object
1284   /*virtual*/ DrawableBase* copy() const;
1285 
1286 private:
1287   CoordinateList _coordinates;
1288 };
1289 
1290 // Polyline (Coordinate list must contain at least three members)
1291 class MagickPPExport DrawablePolyline : public DrawableBase
1292 {
1293 public:
1294   DrawablePolyline ( const CoordinateList &coordinates_ );
1295 
1296   DrawablePolyline ( const DrawablePolyline& original_ );
1297 
1298   /*virtual*/ ~DrawablePolyline ( void );
1299 
1300   // Operator to invoke equivalent draw API call
1301   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1302 
1303   // Return polymorphic copy of object
1304   /*virtual*/ DrawableBase* copy() const;
1305 
1306 private:
1307   CoordinateList _coordinates;
1308 };
1309 
1310 // Pop Graphic Context
1311 class MagickPPExport DrawablePopGraphicContext : public DrawableBase
1312 {
1313 public:
DrawablePopGraphicContext(void)1314   DrawablePopGraphicContext ( void )
1315     : _dummy(0)
1316     {
1317     }
1318 
1319   /*virtual*/ ~DrawablePopGraphicContext ( void );
1320 
1321   // Operator to invoke equivalent draw API call
1322   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1323 
1324   // Return polymorphic copy of object
1325   /*virtual*/ DrawableBase* copy() const;
1326 
1327 private:
1328   ::ssize_t   _dummy;
1329 };
1330 
1331 // Push Graphic Context
1332 class MagickPPExport DrawablePushGraphicContext : public DrawableBase
1333 {
1334 public:
DrawablePushGraphicContext(void)1335   DrawablePushGraphicContext ( void )
1336     : _dummy(0)
1337     {
1338     }
1339 
1340   /*virtual*/ ~DrawablePushGraphicContext ( void );
1341 
1342   // Operator to invoke equivalent draw API call
1343   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1344 
1345   // Return polymorphic copy of object
1346   /*virtual*/ DrawableBase* copy() const;
1347 
1348 private:
1349   ::ssize_t   _dummy;
1350 };
1351 
1352 // Pop (terminate) Pattern definition
1353 class MagickPPExport DrawablePopPattern : public DrawableBase
1354 {
1355 public:
DrawablePopPattern(void)1356   DrawablePopPattern ( void )
1357     : _dummy(0)
1358     {
1359     }
1360 
1361   /*virtual*/ ~DrawablePopPattern ( void );
1362 
1363   // Operator to invoke equivalent draw API call
1364   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1365 
1366   // Return polymorphic copy of object
1367   /*virtual*/ DrawableBase* copy() const;
1368 
1369 private:
1370   ::ssize_t   _dummy;
1371 };
1372 
1373 // Push (create) Pattern definition
1374 class MagickPPExport DrawablePushPattern : public DrawableBase
1375 {
1376 public:
1377   DrawablePushPattern ( const std::string &id_, ::ssize_t x_, ::ssize_t y_,
1378                         size_t width_, size_t height_ );
1379 
1380   DrawablePushPattern ( const DrawablePushPattern& original_ );
1381 
1382   /*virtual*/ ~DrawablePushPattern ( void );
1383 
1384   // Operator to invoke equivalent draw API call
1385   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1386 
1387   // Return polymorphic copy of object
1388   /*virtual*/ DrawableBase* copy() const;
1389 
1390 private:
1391   std::string         _id;
1392   ::ssize_t		_x;
1393   ::ssize_t		_y;
1394   size_t		_width;
1395   size_t		_height;
1396 };
1397 
1398 // Rectangle
1399 class MagickPPExport DrawableRectangle : public DrawableBase
1400 {
1401 public:
DrawableRectangle(double upperLeftX_,double upperLeftY_,double lowerRightX_,double lowerRightY_)1402   DrawableRectangle ( double upperLeftX_, double upperLeftY_,
1403                       double lowerRightX_, double lowerRightY_ )
1404     : _upperLeftX(upperLeftX_),
1405       _upperLeftY(upperLeftY_),
1406       _lowerRightX(lowerRightX_),
1407       _lowerRightY(lowerRightY_)
1408     { }
1409 
1410   /*virtual*/ ~DrawableRectangle ( void );
1411 
1412   // Operator to invoke equivalent draw API call
1413   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1414 
1415   // Return polymorphic copy of object
1416   /*virtual*/ DrawableBase* copy() const;
1417 
upperLeftX(double upperLeftX_)1418   void upperLeftX( double upperLeftX_ )
1419     {
1420       _upperLeftX = upperLeftX_;
1421     }
upperLeftX(void)1422   double upperLeftX( void ) const
1423     {
1424       return _upperLeftX;
1425     }
1426 
upperLeftY(double upperLeftY_)1427   void upperLeftY( double upperLeftY_ )
1428     {
1429       _upperLeftY = upperLeftY_;
1430     }
upperLeftY(void)1431   double upperLeftY( void ) const
1432     {
1433       return _upperLeftY;
1434     }
1435 
lowerRightX(double lowerRightX_)1436   void lowerRightX( double lowerRightX_ )
1437     {
1438       _lowerRightX = lowerRightX_;
1439     }
lowerRightX(void)1440   double lowerRightX( void ) const
1441     {
1442       return _lowerRightX;
1443     }
1444 
lowerRightY(double lowerRightY_)1445   void lowerRightY( double lowerRightY_ )
1446     {
1447       _lowerRightY = lowerRightY_;
1448     }
lowerRightY(void)1449   double lowerRightY( void ) const
1450     {
1451       return _lowerRightY;
1452     }
1453 
1454 private:
1455   double _upperLeftX;
1456   double _upperLeftY;
1457   double _lowerRightX;
1458   double _lowerRightY;
1459 };
1460 
1461 // Apply Rotation
1462 class MagickPPExport DrawableRotation : public DrawableBase
1463 {
1464 public:
DrawableRotation(double angle_)1465   DrawableRotation ( double angle_ )
1466     : _angle( angle_ )
1467     { }
1468 
1469   /*virtual*/ ~DrawableRotation ( void );
1470 
1471   // Operator to invoke equivalent draw API call
1472   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1473 
1474   // Return polymorphic copy of object
1475   /*virtual*/ DrawableBase* copy() const;
1476 
angle(double angle_)1477   void angle( double angle_ )
1478     {
1479       _angle = angle_;
1480     }
angle(void)1481   double angle( void ) const
1482     {
1483       return _angle;
1484     }
1485 
1486 private:
1487   double _angle;
1488 };
1489 
1490 // Round Rectangle
1491 class MagickPPExport DrawableRoundRectangle : public DrawableBase
1492 {
1493 public:
DrawableRoundRectangle(double upperLeftX_,double upperLeftY_,double lowerRightX_,double lowerRightY_,double cornerWidth_,double cornerHeight_)1494   DrawableRoundRectangle ( double upperLeftX_, double upperLeftY_,
1495                            double lowerRightX_, double lowerRightY_,
1496                            double cornerWidth_, double cornerHeight_ )
1497     : _upperLeftX(upperLeftX_),
1498       _upperLeftY(upperLeftY_),
1499       _lowerRightX(lowerRightX_),
1500       _lowerRightY(lowerRightY_),
1501       _cornerWidth(cornerWidth_),
1502       _cornerHeight(cornerHeight_)
1503     { }
1504 
1505   /*virtual*/ ~DrawableRoundRectangle ( void );
1506 
1507   // Operator to invoke equivalent draw API call
1508   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1509 
1510   // Return polymorphic copy of object
1511   /*virtual*/ DrawableBase* copy() const;
1512 
1513 #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED)
1514 
centerX(double centerX_)1515   void centerX( double centerX_ )
1516     {
1517       _upperLeftX = centerX_;
1518     }
centerX(void)1519   double centerX( void ) const
1520     {
1521       return _upperLeftX;
1522     }
1523 
centerY(double centerY_)1524   void centerY( double centerY_ )
1525     {
1526       _upperLeftY = centerY_;
1527     }
centerY(void)1528   double centerY( void ) const
1529     {
1530       return _upperLeftY;
1531     }
1532 
width(double width_)1533   void width( double width_ )
1534     {
1535       _lowerRightX = width_;
1536     }
width(void)1537   double width( void ) const
1538     {
1539       return _lowerRightX;
1540     }
1541 
hight(double hight_)1542   void hight( double hight_ )
1543     {
1544       _lowerRightY = hight_;
1545     }
hight(void)1546   double hight( void ) const
1547     {
1548       return _lowerRightY;
1549     }
1550 
1551 #endif
1552 
upperLeftX(double upperLeftX_)1553   void upperLeftX( double upperLeftX_ )
1554     {
1555       _upperLeftX = upperLeftX_;
1556     }
upperLeftX(void)1557   double upperLeftX( void ) const
1558     {
1559       return _upperLeftX;
1560     }
1561 
upperLeftY(double upperLeftY_)1562   void upperLeftY( double upperLeftY_ )
1563     {
1564       _upperLeftY = upperLeftY_;
1565     }
upperLeftY(void)1566   double upperLeftY( void ) const
1567     {
1568       return _upperLeftY;
1569     }
1570 
lowerRightX(double lowerRightX_)1571   void lowerRightX( double lowerRightX_ )
1572     {
1573       _lowerRightX = lowerRightX_;
1574     }
lowerRightX(void)1575   double lowerRightX( void ) const
1576     {
1577       return _lowerRightX;
1578     }
1579 
lowerRightY(double lowerRightY_)1580   void lowerRightY( double lowerRightY_ )
1581     {
1582       _lowerRightY = lowerRightY_;
1583     }
lowerRightY(void)1584   double lowerRightY( void ) const
1585     {
1586       return _lowerRightY;
1587     }
1588 
cornerWidth(double cornerWidth_)1589   void cornerWidth( double cornerWidth_ )
1590     {
1591       _cornerWidth = cornerWidth_;
1592     }
cornerWidth(void)1593   double cornerWidth( void ) const
1594     {
1595       return _cornerWidth;
1596     }
1597 
cornerHeight(double cornerHeight_)1598   void cornerHeight( double cornerHeight_ )
1599     {
1600       _cornerHeight = cornerHeight_;
1601     }
cornerHeight(void)1602   double cornerHeight( void ) const
1603     {
1604       return _cornerHeight;
1605     }
1606 
1607 private:
1608   double _upperLeftX;
1609   double _upperLeftY;
1610   double _lowerRightX;
1611   double _lowerRightY;
1612   double _cornerWidth;
1613   double _cornerHeight;
1614 };
1615 
1616 // Apply Scaling
1617 class MagickPPExport DrawableScaling : public DrawableBase
1618 {
1619 public:
DrawableScaling(double x_,double y_)1620   DrawableScaling ( double x_, double y_ )
1621     : _x(x_),
1622       _y(y_)
1623     { }
1624 
1625   /*virtual*/ ~DrawableScaling ( void );
1626 
1627   // Operator to invoke equivalent draw API call
1628   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1629 
1630   // Return polymorphic copy of object
1631   /*virtual*/ DrawableBase* copy() const;
1632 
x(double x_)1633   void x( double x_ )
1634     {
1635       _x = x_;
1636     }
x(void)1637   double x( void ) const
1638     {
1639       return _x;
1640     }
1641 
y(double y_)1642   void y( double y_ )
1643     {
1644       _y = y_;
1645     }
y(void)1646   double y( void ) const
1647     {
1648       return _y;
1649     }
1650 
1651 private:
1652   double _x;
1653   double _y;
1654 };
1655 
1656 // Apply Skew in X direction
1657 class MagickPPExport DrawableSkewX : public DrawableBase
1658 {
1659 public:
DrawableSkewX(double angle_)1660   DrawableSkewX ( double angle_ )
1661     : _angle(angle_)
1662     { }
1663 
1664   /*virtual*/ ~DrawableSkewX ( void );
1665 
1666   // Operator to invoke equivalent draw API call
1667   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1668 
1669   // Return polymorphic copy of object
1670   /*virtual*/ DrawableBase* copy() const;
1671 
angle(double angle_)1672   void angle( double angle_ )
1673     {
1674       _angle = angle_;
1675     }
angle(void)1676   double angle( void ) const
1677     {
1678       return _angle;
1679     }
1680 
1681 private:
1682   double _angle;
1683 };
1684 
1685 // Apply Skew in Y direction
1686 class MagickPPExport DrawableSkewY : public DrawableBase
1687 {
1688 public:
DrawableSkewY(double angle_)1689   DrawableSkewY ( double angle_ )
1690     : _angle(angle_)
1691     { }
1692 
1693   /*virtual*/ ~DrawableSkewY ( void );
1694 
1695   // Operator to invoke equivalent draw API call
1696   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1697 
1698   // Return polymorphic copy of object
1699   /*virtual*/ DrawableBase* copy() const;
1700 
angle(double angle_)1701   void angle( double angle_ )
1702     {
1703       _angle = angle_;
1704     }
angle(void)1705   double angle( void ) const
1706     {
1707       return _angle;
1708     }
1709 
1710 private:
1711   double _angle;
1712 };
1713 
1714   // Stroke dasharray
1715   //
1716   // dasharray_ is an allocated array terminated by value 0.0 or 0.
1717   // The array is copied so the original does not need to be preserved.
1718   // Pass a null pointer to clear an existing dash array setting.
1719   class MagickPPExport DrawableStrokeDashArray : public DrawableBase
1720   {
1721   public:
1722 
1723       DrawableStrokeDashArray(const double* dasharray_);
1724 
1725       DrawableStrokeDashArray(const Magick::DrawableStrokeDashArray &original_);
1726 
1727       ~DrawableStrokeDashArray(void);
1728 
1729       // Operator to invoke equivalent draw API call
1730       void operator()(MagickCore::DrawingWand *context_) const;
1731 
1732       // Return polymorphic copy of object
1733       DrawableBase* copy() const;
1734 
1735       void dasharray(const double* dasharray_);
1736       const double* dasharray(void) const;
1737 
1738       DrawableStrokeDashArray& operator=(
1739         const Magick::DrawableStrokeDashArray &original_);
1740 
1741   private:
1742       size_t _size;
1743       double *_dasharray;
1744   };
1745 
1746   // Stroke dashoffset
1747   class MagickPPExport DrawableStrokeDashOffset : public DrawableBase
1748   {
1749   public:
DrawableStrokeDashOffset(const double offset_)1750     DrawableStrokeDashOffset(const double offset_)
1751       : _offset(offset_)
1752       { }
1753 
1754      ~DrawableStrokeDashOffset(void);
1755 
1756     // Operator to invoke equivalent draw API call
1757     void operator()(MagickCore::DrawingWand *context_) const;
1758 
1759     // Return polymorphic copy of object
1760     DrawableBase* copy() const;
1761 
1762     void offset(const double offset_);
1763     double offset(void) const;
1764 
1765   private:
1766     double _offset;
1767   };
1768 
1769 // Stroke linecap
1770 class MagickPPExport DrawableStrokeLineCap : public DrawableBase
1771 {
1772 public:
DrawableStrokeLineCap(LineCap linecap_)1773   DrawableStrokeLineCap ( LineCap linecap_ )
1774     : _linecap(linecap_)
1775     { }
1776 
1777   /*virtual*/ ~DrawableStrokeLineCap ( void );
1778 
1779   // Operator to invoke equivalent draw API call
1780   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1781 
1782   // Return polymorphic copy of object
1783   /*virtual*/ DrawableBase* copy() const;
1784 
linecap(LineCap linecap_)1785   void linecap( LineCap linecap_ )
1786     {
1787       _linecap = linecap_;
1788     }
linecap(void)1789   LineCap linecap( void ) const
1790     {
1791       return _linecap;
1792     }
1793 
1794 private:
1795   LineCap _linecap;
1796 };
1797 
1798 // Stroke linejoin
1799 class MagickPPExport DrawableStrokeLineJoin : public DrawableBase
1800 {
1801 public:
DrawableStrokeLineJoin(LineJoin linejoin_)1802   DrawableStrokeLineJoin ( LineJoin linejoin_ )
1803     : _linejoin(linejoin_)
1804     { }
1805 
1806   /*virtual*/ ~DrawableStrokeLineJoin ( void );
1807 
1808   // Operator to invoke equivalent draw API call
1809   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1810 
1811   // Return polymorphic copy of object
1812   /*virtual*/ DrawableBase* copy() const;
1813 
linejoin(LineJoin linejoin_)1814   void linejoin( LineJoin linejoin_ )
1815     {
1816       _linejoin = linejoin_;
1817     }
linejoin(void)1818   LineJoin linejoin( void ) const
1819     {
1820       return _linejoin;
1821     }
1822 
1823 private:
1824   LineJoin _linejoin;
1825 };
1826 
1827 // Stroke miterlimit
1828 class MagickPPExport DrawableMiterLimit : public DrawableBase
1829 {
1830 public:
DrawableMiterLimit(size_t miterlimit_)1831   DrawableMiterLimit ( size_t miterlimit_ )
1832     : _miterlimit(miterlimit_)
1833     { }
1834 
1835   /*virtual*/ ~DrawableMiterLimit ( void );
1836 
1837   // Operator to invoke equivalent draw API call
1838   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1839 
1840   // Return polymorphic copy of object
1841   /*virtual*/ DrawableBase* copy() const;
1842 
miterlimit(size_t miterlimit_)1843   void miterlimit( size_t miterlimit_ )
1844     {
1845       _miterlimit = miterlimit_;
1846     }
miterlimit(void)1847   size_t miterlimit( void ) const
1848     {
1849       return _miterlimit;
1850     }
1851 
1852 private:
1853   size_t _miterlimit;
1854 };
1855 
1856 // Sets the pattern used for stroking object outlines.
1857 class MagickPPExport DrawableStrokePatternUrl : public DrawableBase
1858 {
1859 public:
1860 
1861   DrawableStrokePatternUrl(const std::string &url_);
1862 
1863   ~DrawableStrokePatternUrl(void);
1864 
1865   DrawableStrokePatternUrl(const DrawableStrokePatternUrl& original_);
1866 
1867   // Operator to invoke equivalent draw API call
1868   void operator()(MagickCore::DrawingWand *context_) const;
1869 
1870   void url(const std::string &url_);
1871   std::string url(void) const;
1872 
1873   // Return polymorphic copy of object
1874   DrawableBase* copy() const;
1875 
1876 private:
1877   std::string _url;
1878 };
1879 
1880 // Stroke antialias
1881 class MagickPPExport DrawableStrokeAntialias : public DrawableBase
1882 {
1883 public:
DrawableStrokeAntialias(bool flag_)1884   DrawableStrokeAntialias ( bool flag_ )
1885     : _flag(flag_)
1886     { }
1887 
1888   /*virtual*/ ~DrawableStrokeAntialias ( void );
1889 
1890   // Operator to invoke equivalent draw API call
1891   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1892 
1893   // Return polymorphic copy of object
1894   /*virtual*/ DrawableBase* copy() const;
1895 
flag(bool flag_)1896   void flag( bool flag_ )
1897     {
1898       _flag = flag_;
1899     }
flag(void)1900   bool flag( void ) const
1901     {
1902       return _flag;
1903     }
1904 
1905 private:
1906   bool _flag;
1907 };
1908 
1909 // Stroke color
1910 class MagickPPExport DrawableStrokeColor : public DrawableBase
1911 {
1912 public:
1913   DrawableStrokeColor ( const Color &color_ );
1914 
1915   DrawableStrokeColor ( const DrawableStrokeColor& original_ );
1916 
1917   /*virtual*/ ~DrawableStrokeColor ( void );
1918 
1919   // Operator to invoke equivalent draw API call
1920   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1921 
1922   // Return polymorphic copy of object
1923   /*virtual*/ DrawableBase* copy() const;
1924 
color(const Color & color_)1925   void color( const Color& color_ )
1926     {
1927       _color = color_;
1928     }
color(void)1929   Color color( void ) const
1930     {
1931       return _color;
1932     }
1933 
1934 private:
1935   Color _color;
1936 };
1937 
1938 // Stroke opacity
1939 class MagickPPExport DrawableStrokeOpacity : public DrawableBase
1940 {
1941 public:
1942 
DrawableStrokeOpacity(double opacity_)1943   DrawableStrokeOpacity(double opacity_)
1944     : _opacity(opacity_)
1945   {
1946   }
1947 
1948   ~DrawableStrokeOpacity(void);
1949 
1950   // Operator to invoke equivalent draw API call
1951   void operator()(MagickCore::DrawingWand *context_) const;
1952 
1953   // Return polymorphic copy of object
1954   DrawableBase* copy() const;
1955 
opacity(double opacity_)1956   void opacity(double opacity_)
1957   {
1958     _opacity=opacity_;
1959   }
1960 
opacity(void)1961   double opacity(void) const
1962   {
1963     return(_opacity);
1964   }
1965 
1966 private:
1967   double _opacity;
1968 };
1969 
1970 // Stroke width
1971 class MagickPPExport DrawableStrokeWidth : public DrawableBase
1972 {
1973 public:
DrawableStrokeWidth(double width_)1974   DrawableStrokeWidth ( double width_ )
1975     : _width(width_)
1976     { }
1977 
1978   /*virtual*/ ~DrawableStrokeWidth ( void );
1979 
1980   // Operator to invoke equivalent draw API call
1981   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
1982 
1983   // Return polymorphic copy of object
1984   /*virtual*/ DrawableBase* copy() const;
1985 
width(double width_)1986   void width( double width_ )
1987     {
1988       _width = width_;
1989     }
width(void)1990   double width( void ) const
1991     {
1992       return _width;
1993     }
1994 
1995 private:
1996   double _width;
1997 };
1998 
1999 // Draw text at point
2000 class MagickPPExport DrawableText : public DrawableBase
2001 {
2002 public:
2003   DrawableText ( const double x_, const double y_,
2004                  const std::string &text_ );
2005   DrawableText ( const double x_, const double y_,
2006                  const std::string &text_, const std::string &encoding_);
2007 
2008   DrawableText ( const DrawableText& original_ );
2009 
2010   /*virtual*/ ~DrawableText ( void );
2011 
2012   // Operator to invoke equivalent draw API call
2013   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2014 
2015   // Return polymorphic copy of object
2016   /*virtual*/ DrawableBase* copy() const;
2017 
encoding(const std::string & encoding_)2018   void encoding(const std::string &encoding_)
2019     {
2020       _encoding = encoding_;
2021     }
2022 
x(double x_)2023   void x( double x_ )
2024     {
2025       _x = x_;
2026     }
x(void)2027   double x( void ) const
2028     {
2029       return _x;
2030     }
2031 
y(double y_)2032   void y( double y_ )
2033     {
2034       _y = y_;
2035     }
y(void)2036   double y( void ) const
2037     {
2038       return _y;
2039     }
2040 
text(const std::string & text_)2041   void text( const std::string &text_ )
2042     {
2043       _text = text_;
2044     }
text(void)2045   std::string text( void ) const
2046     {
2047       return _text;
2048     }
2049 
2050 private:
2051   double      _x;
2052   double      _y;
2053   std::string _text;
2054   std::string _encoding;
2055 };
2056 
2057 // Text alignment
2058 class MagickPPExport DrawableTextAlignment : public DrawableBase
2059 {
2060 public:
2061 
2062   DrawableTextAlignment(AlignType alignment_);
2063 
2064   DrawableTextAlignment(const DrawableTextAlignment& original_);
2065 
2066   ~DrawableTextAlignment(void);
2067 
2068   // Operator to invoke equivalent draw API call
2069   void operator()(MagickCore::DrawingWand *context_) const;
2070 
2071   void alignment(AlignType alignment_);
2072   AlignType alignment(void) const;
2073 
2074   // Return polymorphic copy of object
2075   DrawableBase* copy() const;
2076 
2077 private:
2078   AlignType _alignment;
2079 };
2080 
2081 // Text antialias
2082 class MagickPPExport DrawableTextAntialias : public DrawableBase
2083 {
2084 public:
2085   DrawableTextAntialias ( bool flag_ );
2086 
2087   DrawableTextAntialias( const DrawableTextAntialias &original_ );
2088 
2089   /*virtual*/ ~DrawableTextAntialias ( void );
2090 
2091   // Operator to invoke equivalent draw API call
2092   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2093 
2094   // Return polymorphic copy of object
2095   /*virtual*/ DrawableBase* copy() const;
2096 
flag(bool flag_)2097   void flag( bool flag_ )
2098     {
2099       _flag = flag_;
2100     }
flag(void)2101   bool flag( void ) const
2102     {
2103       return _flag;
2104     }
2105 
2106 private:
2107   bool _flag;
2108 };
2109 
2110 // Decoration (text decoration)
2111 class MagickPPExport DrawableTextDecoration : public DrawableBase
2112 {
2113 public:
2114   DrawableTextDecoration ( DecorationType decoration_ );
2115 
2116   DrawableTextDecoration ( const DrawableTextDecoration& original_ );
2117 
2118   /*virtual*/ ~DrawableTextDecoration( void );
2119 
2120   // Operator to invoke equivalent draw API call
2121   /*virtual*/  void operator()( MagickCore::DrawingWand *context_ ) const;
2122 
2123   // Return polymorphic copy of object
2124   /*virtual*/ DrawableBase* copy() const;
2125 
decoration(DecorationType decoration_)2126   void decoration( DecorationType decoration_ )
2127     {
2128       _decoration = decoration_;
2129     }
decoration(void)2130   DecorationType decoration( void ) const
2131     {
2132       return _decoration;
2133     }
2134 
2135 private:
2136   DecorationType _decoration;
2137 };
2138 
2139   // Render text right-to-left or left-to-right.
2140   class MagickPPExport DrawableTextDirection : public DrawableBase
2141   {
2142   public:
2143 
2144     DrawableTextDirection(DirectionType direction_);
2145 
2146     ~DrawableTextDirection(void);
2147 
2148     void operator()(MagickCore::DrawingWand *context_) const;
2149 
2150     void direction(DirectionType direction_);
2151     DirectionType direction(void) const;
2152 
2153     DrawableBase* copy() const;
2154 
2155   private:
2156     DirectionType _direction;
2157   };
2158 
2159   // Specify text inter-line spacing
2160   class MagickPPExport DrawableTextInterlineSpacing : public DrawableBase
2161   {
2162   public:
2163 
2164     DrawableTextInterlineSpacing(double spacing_);
2165 
2166     ~DrawableTextInterlineSpacing(void);
2167 
2168     void operator()(MagickCore::DrawingWand *context_) const;
2169 
2170     void spacing(double spacing_);
2171     double spacing(void) const;
2172 
2173     DrawableBase* copy() const;
2174 
2175   private:
2176     double _spacing;
2177   };
2178 
2179   // Specify text inter-word spacing
2180   class MagickPPExport DrawableTextInterwordSpacing : public DrawableBase
2181   {
2182   public:
2183 
2184     DrawableTextInterwordSpacing(double spacing_);
2185 
2186     ~DrawableTextInterwordSpacing(void);
2187 
2188     void operator()(MagickCore::DrawingWand *context_) const;
2189 
2190     void spacing(double spacing_);
2191     double spacing(void) const;
2192 
2193     DrawableBase *copy() const;
2194 
2195   private:
2196     double _spacing;
2197   };
2198 
2199   // Specify text kerning
2200   class MagickPPExport DrawableTextKerning : public DrawableBase
2201   {
2202   public:
2203 
2204     DrawableTextKerning(double kerning_);
2205 
2206     ~DrawableTextKerning(void);
2207 
2208     void operator()(MagickCore::DrawingWand *context_) const;
2209 
2210     void kerning(double kerning_);
2211     double kerning(void) const;
2212 
2213     DrawableBase *copy() const;
2214 
2215   private:
2216     double _kerning;
2217   };
2218 
2219 // Text undercolor box
2220 class MagickPPExport DrawableTextUnderColor : public DrawableBase
2221 {
2222 public:
2223   DrawableTextUnderColor ( const Color &color_ );
2224 
2225   DrawableTextUnderColor ( const DrawableTextUnderColor& original_ );
2226 
2227   /*virtual*/ ~DrawableTextUnderColor ( void );
2228 
2229   // Operator to invoke equivalent draw API call
2230   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2231 
2232   // Return polymorphic copy of object
2233   /*virtual*/ DrawableBase* copy() const;
2234 
color(const Color & color_)2235   void color( const Color& color_ )
2236     {
2237       _color = color_;
2238     }
color(void)2239   Color color( void ) const
2240     {
2241       return _color;
2242     }
2243 
2244 private:
2245   Color _color;
2246 };
2247 
2248 // Apply Translation
2249 class MagickPPExport DrawableTranslation : public DrawableBase
2250 {
2251 public:
DrawableTranslation(double x_,double y_)2252   DrawableTranslation ( double x_, double y_ )
2253     : _x(x_),
2254       _y(y_)
2255     { }
2256 
2257   /*virtual*/ ~DrawableTranslation ( void );
2258 
2259   // Operator to invoke equivalent draw API call
2260   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2261 
2262   // Return polymorphic copy of object
2263   /*virtual*/ DrawableBase* copy() const;
2264 
x(double x_)2265   void x( double x_ )
2266     {
2267       _x = x_;
2268     }
x(void)2269   double x( void ) const
2270     {
2271       return _x;
2272     }
2273 
y(double y_)2274   void y( double y_ )
2275     {
2276       _y = y_;
2277     }
y(void)2278   double y( void ) const
2279     {
2280       return _y;
2281     }
2282 
2283 private:
2284   double _x;
2285   double _y;
2286 };
2287 
2288 // Set the size of the viewbox
2289 class MagickPPExport DrawableViewbox : public DrawableBase
2290 {
2291 public:
DrawableViewbox(::ssize_t x1_,::ssize_t y1_,::ssize_t x2_,::ssize_t y2_)2292   DrawableViewbox(::ssize_t x1_, ::ssize_t y1_,
2293                   ::ssize_t x2_, ::ssize_t y2_)
2294     : _x1(x1_),
2295       _y1(y1_),
2296       _x2(x2_),
2297       _y2(y2_) { }
2298 
2299   /*virtual*/ ~DrawableViewbox ( void );
2300 
2301   // Operator to invoke equivalent draw API call
2302   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2303 
2304   // Return polymorphic copy of object
2305   /*virtual*/
2306   DrawableBase* copy() const;
2307 
x1(::ssize_t x1_)2308   void x1( ::ssize_t x1_ )
2309     {
2310       _x1 = x1_;
2311     }
x1(void)2312   ::ssize_t x1( void ) const
2313     {
2314       return _x1;
2315     }
2316 
y1(::ssize_t y1_)2317   void y1( ::ssize_t y1_ )
2318     {
2319       _y1 = y1_;
2320     }
y1(void)2321   ::ssize_t y1( void ) const
2322     {
2323       return _y1;
2324     }
2325 
x2(::ssize_t x2_)2326   void x2( ::ssize_t x2_ )
2327     {
2328       _x2 = x2_;
2329     }
x2(void)2330   ::ssize_t x2( void ) const
2331     {
2332       return _x2;
2333     }
2334 
y2(::ssize_t y2_)2335   void y2( ::ssize_t y2_ )
2336     {
2337       _y2 = y2_;
2338     }
y2(void)2339   ::ssize_t y2( void ) const
2340     {
2341       return _y2;
2342     }
2343 
2344 private:
2345   ::ssize_t _x1;
2346   ::ssize_t _y1;
2347   ::ssize_t _x2;
2348   ::ssize_t _y2;
2349 };
2350 
2351 //
2352 // Path Element Classes To Support DrawablePath
2353 //
2354 class MagickPPExport PathArcArgs
2355 {
2356 public:
2357   PathArcArgs( void );
2358 
2359   PathArcArgs( double radiusX_, double radiusY_,
2360                double xAxisRotation_, bool largeArcFlag_,
2361                bool sweepFlag_, double x_, double y_ );
2362 
2363   PathArcArgs( const PathArcArgs &original_ );
2364 
2365   ~PathArcArgs ( void );
2366 
radiusX(double radiusX_)2367   void radiusX( double radiusX_ )
2368     {
2369       _radiusX = radiusX_;
2370     }
radiusX(void)2371   double radiusX( void ) const
2372     {
2373       return _radiusX;
2374     }
2375 
radiusY(double radiusY_)2376   void radiusY( double radiusY_ )
2377     {
2378       _radiusY = radiusY_;
2379     }
radiusY(void)2380   double radiusY( void ) const
2381     {
2382       return _radiusY;
2383     }
2384 
xAxisRotation(double xAxisRotation_)2385   void xAxisRotation( double xAxisRotation_ )
2386     {
2387       _xAxisRotation = xAxisRotation_;
2388     }
xAxisRotation(void)2389   double xAxisRotation( void ) const
2390     {
2391       return _xAxisRotation;
2392     }
2393 
largeArcFlag(bool largeArcFlag_)2394   void largeArcFlag( bool largeArcFlag_ )
2395     {
2396       _largeArcFlag = largeArcFlag_;
2397     }
largeArcFlag(void)2398   bool largeArcFlag( void ) const
2399     {
2400       return _largeArcFlag;
2401     }
2402 
sweepFlag(bool sweepFlag_)2403   void sweepFlag( bool sweepFlag_ )
2404     {
2405       _sweepFlag = sweepFlag_;
2406     }
sweepFlag(void)2407   bool sweepFlag( void ) const
2408     {
2409       return _sweepFlag;
2410     }
2411 
x(double x_)2412   void x( double x_ )
2413     {
2414       _x = x_;
2415     }
x(void)2416   double x( void ) const
2417     {
2418       return _x;
2419     }
2420 
y(double y_)2421   void y( double y_ )
2422     {
2423       _y = y_;
2424     }
y(void)2425   double y( void ) const
2426     {
2427       return _y;
2428     }
2429 
2430 private:
2431   double	_radiusX;	// X radius
2432   double	_radiusY;	// Y radius
2433   double	_xAxisRotation;	// Rotation relative to X axis
2434   bool        _largeArcFlag;	// Draw longer of the two matching arcs
2435   bool        _sweepFlag;	// Draw arc matching clock-wise rotation
2436   double	_x;		// End-point X
2437   double	_y;		// End-point Y
2438 };
2439 
2440 // Compare two PathArcArgs objects regardless of LHS/RHS
2441 extern MagickPPExport int operator == ( const PathArcArgs& left_,
2442                                       const PathArcArgs& right_ );
2443 extern MagickPPExport int operator != ( const PathArcArgs& left_,
2444                                       const PathArcArgs& right_ );
2445 extern MagickPPExport int operator >  ( const PathArcArgs& left_,
2446                                       const PathArcArgs& right_ );
2447 extern MagickPPExport int operator <  ( const PathArcArgs& left_,
2448                                       const PathArcArgs& right_ );
2449 extern MagickPPExport int operator >= ( const PathArcArgs& left_,
2450                                       const PathArcArgs& right_ );
2451 extern MagickPPExport int operator <= ( const PathArcArgs& left_,
2452                                       const PathArcArgs& right_ );
2453 
2454 typedef std::vector<Magick::PathArcArgs> PathArcArgsList;
2455 
2456 #if defined(MagickDLLExplicitTemplate)
2457 
2458 MagickDrawableExtern template class MagickPPExport
2459 std::allocator<Magick::PathArcArgs>;
2460 
2461 // MagickDrawableExtern template class MagickPPExport
2462 // std::vector<Magick::PathArcArgs, std::allocator<Magick::PathArcArgs> >;
2463 
2464 #endif // MagickDLLExplicitTemplate
2465 
2466 // Path Arc (Elliptical Arc)
2467 class MagickPPExport PathArcAbs : public VPathBase
2468 {
2469 public:
2470   // Draw a single arc segment
2471   PathArcAbs ( const PathArcArgs &coordinates_ );
2472 
2473   // Draw multiple arc segments
2474   PathArcAbs ( const PathArcArgsList &coordinates_ );
2475 
2476   // Copy constructor
2477   PathArcAbs ( const PathArcAbs& original_ );
2478 
2479   // Destructor
2480   /*virtual*/ ~PathArcAbs ( void );
2481 
2482   // Operator to invoke equivalent draw API call
2483   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2484 
2485   // Return polymorphic copy of object
2486   /*virtual*/ VPathBase* copy() const;
2487 
2488 private:
2489   PathArcArgsList _coordinates;
2490 };
2491 class MagickPPExport PathArcRel : public VPathBase
2492 {
2493 public:
2494   // Draw a single arc segment
2495   PathArcRel ( const PathArcArgs &coordinates_ );
2496 
2497   // Draw multiple arc segments
2498   PathArcRel ( const PathArcArgsList &coordinates_ );
2499 
2500   PathArcRel ( const PathArcRel& original_ );
2501 
2502   /*virtual*/ ~PathArcRel ( void );
2503 
2504   // Operator to invoke equivalent draw API call
2505   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2506 
2507   // Return polymorphic copy of object
2508   /*virtual*/ VPathBase* copy() const;
2509 
2510 private:
2511   PathArcArgsList _coordinates;
2512 };
2513 
2514 // Path Closepath
2515 class MagickPPExport PathClosePath : public VPathBase
2516 {
2517 public:
PathClosePath(void)2518   PathClosePath ( void )
2519     : _dummy(0)
2520     {
2521     }
2522 
2523   /*virtual*/ ~PathClosePath ( void );
2524 
2525   // Operator to invoke equivalent draw API call
2526   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2527 
2528   // Return polymorphic copy of object
2529   /*virtual*/ VPathBase* copy() const;
2530 
2531 private:
2532   ::ssize_t   _dummy;
2533 };
2534 
2535 //
2536 // Curveto (Cubic Bezier)
2537 //
2538 class MagickPPExport PathCurvetoArgs
2539 {
2540 public:
2541   PathCurvetoArgs( void );
2542 
2543   PathCurvetoArgs( double x1_, double y1_,
2544                    double x2_, double y2_,
2545                    double x_, double y_ );
2546 
2547   PathCurvetoArgs( const PathCurvetoArgs &original_ );
2548 
2549   ~PathCurvetoArgs ( void );
2550 
x1(double x1_)2551   void x1( double x1_ )
2552     {
2553       _x1 = x1_;
2554     }
x1(void)2555 double x1( void ) const
2556 {
2557   return _x1;
2558 }
2559 
y1(double y1_)2560 void y1( double y1_ )
2561 {
2562   _y1 = y1_;
2563 }
y1(void)2564 double y1( void ) const
2565 {
2566   return _y1;
2567 }
2568 
x2(double x2_)2569 void x2( double x2_ )
2570 {
2571   _x2 = x2_;
2572 }
x2(void)2573 double x2( void ) const
2574 {
2575   return _x2;
2576 }
2577 
y2(double y2_)2578 void y2( double y2_ )
2579 {
2580   _y2 = y2_;
2581 }
y2(void)2582 double y2( void ) const
2583 {
2584   return _y2;
2585 }
2586 
x(double x_)2587 void x( double x_ )
2588 {
2589   _x = x_;
2590 }
x(void)2591 double x( void ) const
2592 {
2593   return _x;
2594 }
2595 
y(double y_)2596 void y( double y_ )
2597 {
2598   _y = y_;
2599 }
y(void)2600 double y( void ) const
2601 {
2602   return _y;
2603 }
2604 
2605 private:
2606 double _x1;
2607 double _y1;
2608 double _x2;
2609 double _y2;
2610 double _x;
2611 double _y;
2612 };
2613 
2614 // Compare two PathCurvetoArgs objects regardless of LHS/RHS
2615 extern MagickPPExport int operator == ( const PathCurvetoArgs& left_,
2616                                       const PathCurvetoArgs& right_ );
2617 extern MagickPPExport int operator != ( const PathCurvetoArgs& left_,
2618                                       const PathCurvetoArgs& right_ );
2619 extern MagickPPExport int operator >  ( const PathCurvetoArgs& left_,
2620                                       const PathCurvetoArgs& right_ );
2621 extern MagickPPExport int operator <  ( const PathCurvetoArgs& left_,
2622                                       const PathCurvetoArgs& right_ );
2623 extern MagickPPExport int operator >= ( const PathCurvetoArgs& left_,
2624                                       const PathCurvetoArgs& right_ );
2625 extern MagickPPExport int operator <= ( const PathCurvetoArgs& left_,
2626                                       const PathCurvetoArgs& right_ );
2627 
2628 typedef std::vector<Magick::PathCurvetoArgs> PathCurveToArgsList;
2629 
2630 #if defined(MagickDLLExplicitTemplate)
2631 
2632 MagickDrawableExtern template class MagickPPExport
2633 std::allocator<Magick::PathCurvetoArgs>;
2634 
2635 // MagickDrawableExtern template class MagickPPExport
2636 // std::vector<Magick::PathCurvetoArgs, std::allocator<Magick::PathCurvetoArgs> >;
2637 
2638 #endif // MagickDLLExplicitTemplate
2639 
2640 class MagickPPExport PathCurvetoAbs : public VPathBase
2641 {
2642 public:
2643   // Draw a single curve
2644   PathCurvetoAbs ( const PathCurvetoArgs &args_ );
2645 
2646   // Draw multiple curves
2647   PathCurvetoAbs ( const PathCurveToArgsList &args_ );
2648 
2649   // Copy constructor
2650   PathCurvetoAbs ( const PathCurvetoAbs& original_ );
2651 
2652   // Destructor
2653   /*virtual*/ ~PathCurvetoAbs ( void );
2654 
2655   // Operator to invoke equivalent draw API call
2656   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2657 
2658   // Return polymorphic copy of object
2659   /*virtual*/ VPathBase* copy() const;
2660 
2661 private:
2662   PathCurveToArgsList _args;
2663 };
2664 class MagickPPExport PathCurvetoRel : public VPathBase
2665 {
2666 public:
2667   // Draw a single curve
2668   PathCurvetoRel ( const PathCurvetoArgs &args_ );
2669 
2670   // Draw multiple curves
2671   PathCurvetoRel ( const PathCurveToArgsList &args_ );
2672 
2673   // Copy constructor
2674   PathCurvetoRel ( const PathCurvetoRel& original_ );
2675 
2676   /*virtual*/ ~PathCurvetoRel ( void );
2677 
2678   // Operator to invoke equivalent draw API call
2679   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2680 
2681   // Return polymorphic copy of object
2682   /*virtual*/ VPathBase* copy() const;
2683 
2684 private:
2685   PathCurveToArgsList _args;
2686 };
2687 class MagickPPExport PathSmoothCurvetoAbs : public VPathBase
2688 {
2689 public:
2690   // Draw a single curve
2691   PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ );
2692 
2693   // Draw multiple curves
2694   PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ );
2695 
2696   // Copy constructor
2697   PathSmoothCurvetoAbs ( const PathSmoothCurvetoAbs& original_ );
2698 
2699   /*virtual*/ ~PathSmoothCurvetoAbs ( void );
2700 
2701   // Operator to invoke equivalent draw API call
2702   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2703 
2704   // Return polymorphic copy of object
2705   /*virtual*/
2706   VPathBase* copy() const;
2707 
2708 private:
2709   CoordinateList _coordinates;
2710 };
2711 class MagickPPExport PathSmoothCurvetoRel : public VPathBase
2712 {
2713 public:
2714   // Draw a single curve
2715   PathSmoothCurvetoRel ( const Coordinate &coordinates_ );
2716 
2717   // Draw multiple curves
2718   PathSmoothCurvetoRel ( const CoordinateList &coordinates_ );
2719 
2720   // Copy constructor
2721   PathSmoothCurvetoRel ( const PathSmoothCurvetoRel& original_ );
2722 
2723   // Destructor
2724   /*virtual*/ ~PathSmoothCurvetoRel ( void );
2725 
2726   // Operator to invoke equivalent draw API call
2727   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2728 
2729   // Return polymorphic copy of object
2730   /*virtual*/
2731   VPathBase* copy() const;
2732 
2733 private:
2734   CoordinateList _coordinates;
2735 };
2736 
2737 //
2738 // Quadratic Curveto (Quadratic Bezier)
2739 //
2740 class MagickPPExport PathQuadraticCurvetoArgs
2741 {
2742 public:
2743   PathQuadraticCurvetoArgs( void );
2744 
2745   PathQuadraticCurvetoArgs( double x1_, double y1_,
2746                             double x_, double y_ );
2747 
2748   PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ );
2749 
2750   ~PathQuadraticCurvetoArgs ( void );
2751 
x1(double x1_)2752   void x1( double x1_ )
2753     {
2754       _x1 = x1_;
2755     }
x1(void)2756   double x1( void ) const
2757     {
2758       return _x1;
2759     }
2760 
y1(double y1_)2761   void y1( double y1_ )
2762     {
2763       _y1 = y1_;
2764     }
y1(void)2765   double y1( void ) const
2766     {
2767       return _y1;
2768     }
2769 
x(double x_)2770   void x( double x_ )
2771     {
2772       _x = x_;
2773     }
x(void)2774   double x( void ) const
2775     {
2776       return _x;
2777     }
2778 
y(double y_)2779   void y( double y_ )
2780     {
2781       _y = y_;
2782     }
y(void)2783   double y( void ) const
2784     {
2785       return _y;
2786     }
2787 
2788 private:
2789   double _x1;
2790   double _y1;
2791   double _x;
2792   double _y;
2793 };
2794 
2795 // Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS
2796 extern MagickPPExport int operator == ( const PathQuadraticCurvetoArgs& left_,
2797                                       const PathQuadraticCurvetoArgs& right_ );
2798 extern MagickPPExport int operator != ( const PathQuadraticCurvetoArgs& left_,
2799                                       const PathQuadraticCurvetoArgs& right_);
2800 extern MagickPPExport int operator >  ( const PathQuadraticCurvetoArgs& left_,
2801                                       const PathQuadraticCurvetoArgs& right_);
2802 extern MagickPPExport int operator <  ( const PathQuadraticCurvetoArgs& left_,
2803                                       const PathQuadraticCurvetoArgs& right_);
2804 extern MagickPPExport int operator >= ( const PathQuadraticCurvetoArgs& left_,
2805                                       const PathQuadraticCurvetoArgs& right_ );
2806 extern MagickPPExport int operator <= ( const PathQuadraticCurvetoArgs& left_,
2807                                       const PathQuadraticCurvetoArgs& right_ );
2808 
2809 typedef std::vector<Magick::PathQuadraticCurvetoArgs> PathQuadraticCurvetoArgsList;
2810 
2811 #if defined(MagickDLLExplicitTemplate)
2812 
2813 MagickDrawableExtern template class MagickPPExport
2814 std::allocator<Magick::PathQuadraticCurvetoArgs>;
2815 
2816 // MagickDrawableExtern template class MagickPPExport
2817 // std::vector<Magick::PathQuadraticCurvetoArgs, std::allocator<Magick::PathQuadraticCurvetoArgs> >;
2818 
2819 #endif // MagickDLLExplicitTemplate
2820 
2821 class MagickPPExport PathQuadraticCurvetoAbs : public VPathBase
2822 {
2823 public:
2824   // Draw a single curve
2825   PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ );
2826 
2827   // Draw multiple curves
2828   PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ );
2829 
2830   // Copy constructor
2831   PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoAbs& original_ );
2832 
2833   // Destructor
2834   /*virtual*/ ~PathQuadraticCurvetoAbs ( void );
2835 
2836   // Operator to invoke equivalent draw API call
2837   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2838 
2839   // Return polymorphic copy of object
2840   /*virtual*/ VPathBase* copy() const;
2841 
2842 private:
2843   PathQuadraticCurvetoArgsList _args;
2844 };
2845 class MagickPPExport PathQuadraticCurvetoRel : public VPathBase
2846 {
2847 public:
2848   // Draw a single curve
2849   PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ );
2850 
2851   // Draw multiple curves
2852   PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ );
2853 
2854   // Copy constructor
2855   PathQuadraticCurvetoRel ( const PathQuadraticCurvetoRel& original_ );
2856 
2857   // Destructor
2858   /*virtual*/ ~PathQuadraticCurvetoRel ( void );
2859 
2860   // Operator to invoke equivalent draw API call
2861   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2862 
2863   // Return polymorphic copy of object
2864   /*virtual*/ VPathBase* copy() const;
2865 
2866 private:
2867   PathQuadraticCurvetoArgsList _args;
2868 };
2869 class MagickPPExport PathSmoothQuadraticCurvetoAbs : public VPathBase
2870 {
2871 public:
2872   // Draw a single curve
2873   PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ );
2874 
2875   // Draw multiple curves
2876   PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ );
2877 
2878   // Copy constructor
2879   PathSmoothQuadraticCurvetoAbs ( const PathSmoothQuadraticCurvetoAbs& original_ );
2880 
2881   // Destructor
2882   /*virtual*/ ~PathSmoothQuadraticCurvetoAbs ( void );
2883 
2884   // Operator to invoke equivalent draw API call
2885   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2886 
2887   // Return polymorphic copy of object
2888   /*virtual*/ VPathBase* copy() const;
2889 
2890 private:
2891   CoordinateList _coordinates;
2892 };
2893 class MagickPPExport PathSmoothQuadraticCurvetoRel : public VPathBase
2894 {
2895 public:
2896   // Draw a single curve
2897   PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ );
2898 
2899   // Draw multiple curves
2900   PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ );
2901 
2902   // Copy constructor
2903   PathSmoothQuadraticCurvetoRel ( const PathSmoothQuadraticCurvetoRel& original_ );
2904 
2905   // Destructor
2906   /*virtual*/ ~PathSmoothQuadraticCurvetoRel ( void );
2907 
2908   // Operator to invoke equivalent draw API call
2909   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2910 
2911   // Return polymorphic copy of object
2912   /*virtual*/ VPathBase* copy() const;
2913 
2914 private:
2915   CoordinateList _coordinates;
2916 };
2917 
2918 //
2919 // Path Lineto
2920 //
2921 class MagickPPExport PathLinetoAbs : public VPathBase
2922 {
2923 public:
2924   // Draw to a single point
2925   PathLinetoAbs ( const Magick::Coordinate& coordinate_  );
2926 
2927   // Draw to multiple points
2928   PathLinetoAbs ( const CoordinateList &coordinates_ );
2929 
2930   // Copy constructor
2931   PathLinetoAbs ( const PathLinetoAbs& original_ );
2932 
2933   // Destructor
2934   /*virtual*/ ~PathLinetoAbs ( void );
2935 
2936   // Operator to invoke equivalent draw API call
2937   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2938 
2939   // Return polymorphic copy of object
2940   /*virtual*/ VPathBase* copy() const;
2941 
2942 private:
2943   CoordinateList _coordinates;
2944 };
2945 class MagickPPExport PathLinetoRel : public VPathBase
2946 {
2947 public:
2948   // Draw to a single point
2949   PathLinetoRel ( const Magick::Coordinate& coordinate_ );
2950 
2951   // Draw to multiple points
2952   PathLinetoRel ( const CoordinateList &coordinates_ );
2953 
2954   // Copy constructor
2955   PathLinetoRel ( const PathLinetoRel& original_ );
2956 
2957   // Destructor
2958   /*virtual*/ ~PathLinetoRel ( void );
2959 
2960   // Operator to invoke equivalent draw API call
2961   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2962 
2963   // Return polymorphic copy of object
2964   /*virtual*/ VPathBase* copy() const;
2965 
2966 private:
2967   CoordinateList _coordinates;
2968 };
2969 
2970 // Path Horizontal Lineto
2971 class MagickPPExport PathLinetoHorizontalAbs : public VPathBase
2972 {
2973 public:
PathLinetoHorizontalAbs(double x_)2974   PathLinetoHorizontalAbs ( double x_ )
2975     : _x(x_)
2976     {
2977     }
2978 
2979   /*virtual*/ ~PathLinetoHorizontalAbs ( void );
2980 
2981   // Operator to invoke equivalent draw API call
2982   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
2983 
2984   // Return polymorphic copy of object
2985   /*virtual*/ VPathBase* copy() const;
2986 
x(double x_)2987   void x( double x_ )
2988     {
2989       _x = x_;
2990     }
x(void)2991   double x( void ) const
2992     {
2993       return _x;
2994     }
2995 
2996 private:
2997   double _x;
2998 };
2999 class MagickPPExport PathLinetoHorizontalRel : public VPathBase
3000 {
3001 public:
PathLinetoHorizontalRel(double x_)3002   PathLinetoHorizontalRel ( double x_ )
3003     : _x(x_)
3004     {
3005     }
3006 
3007   /*virtual*/ ~PathLinetoHorizontalRel ( void );
3008 
3009   // Operator to invoke equivalent draw API call
3010   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
3011 
3012   // Return polymorphic copy of object
3013   /*virtual*/ VPathBase* copy() const;
3014 
x(double x_)3015   void x( double x_ )
3016     {
3017       _x = x_;
3018     }
x(void)3019   double x( void ) const
3020     {
3021       return _x;
3022     }
3023 
3024 private:
3025   double _x;
3026 };
3027 
3028 // Path Vertical Lineto
3029 class MagickPPExport PathLinetoVerticalAbs : public VPathBase
3030 {
3031 public:
PathLinetoVerticalAbs(double y_)3032   PathLinetoVerticalAbs ( double y_ )
3033     : _y(y_)
3034     {
3035     }
3036 
3037   /*virtual*/ ~PathLinetoVerticalAbs ( void );
3038 
3039   // Operator to invoke equivalent draw API call
3040   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
3041 
3042   // Return polymorphic copy of object
3043   /*virtual*/ VPathBase* copy() const;
3044 
y(double y_)3045   void y( double y_ )
3046     {
3047       _y = y_;
3048     }
y(void)3049   double y( void ) const
3050     {
3051       return _y;
3052     }
3053 
3054 private:
3055   double _y;
3056 };
3057 class MagickPPExport PathLinetoVerticalRel : public VPathBase
3058 {
3059 public:
PathLinetoVerticalRel(double y_)3060   PathLinetoVerticalRel ( double y_ )
3061     : _y(y_)
3062     {
3063     }
3064 
3065   /*virtual*/ ~PathLinetoVerticalRel ( void );
3066 
3067   // Operator to invoke equivalent draw API call
3068   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
3069 
3070   // Return polymorphic copy of object
3071   /*virtual*/ VPathBase* copy() const;
3072 
y(double y_)3073   void y( double y_ )
3074     {
3075       _y = y_;
3076     }
y(void)3077   double y( void ) const
3078     {
3079       return _y;
3080     }
3081 
3082 private:
3083   double _y;
3084 };
3085 
3086 // Path Moveto
3087 class MagickPPExport PathMovetoAbs : public VPathBase
3088 {
3089 public:
3090   // Simple moveto
3091   PathMovetoAbs ( const Magick::Coordinate &coordinate_ );
3092 
3093   // Moveto followed by implicit linetos
3094   PathMovetoAbs ( const CoordinateList &coordinates_ );
3095 
3096   // Copy constructor
3097   PathMovetoAbs ( const PathMovetoAbs& original_ );
3098 
3099   // Destructor
3100   /*virtual*/ ~PathMovetoAbs ( void );
3101 
3102   // Operator to invoke equivalent draw API call
3103   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
3104 
3105   // Return polymorphic copy of object
3106   /*virtual*/ VPathBase* copy() const;
3107 
3108 private:
3109   CoordinateList _coordinates;
3110 };
3111 class MagickPPExport PathMovetoRel : public VPathBase
3112 {
3113 public:
3114   // Simple moveto
3115   PathMovetoRel ( const Magick::Coordinate &coordinate_ );
3116 
3117   // Moveto followed by implicit linetos
3118   PathMovetoRel ( const CoordinateList &coordinates_ );
3119 
3120   // Copy constructor
3121   PathMovetoRel ( const PathMovetoRel& original_ );
3122 
3123   // Destructor
3124   /*virtual*/ ~PathMovetoRel ( void );
3125 
3126   // Operator to invoke equivalent draw API call
3127   /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const;
3128 
3129   // Return polymorphic copy of object
3130   /*virtual*/ VPathBase* copy() const;
3131 
3132 private:
3133   CoordinateList _coordinates;
3134 };
3135 
3136 } // namespace Magick
3137 
3138 #endif // Magick_Drawable_header
3139