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