Coverage Report

Created: 2026-11-12 07:35

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/include/ImageMagick-7/Magick++/Drawable.h
Line
Count
Source
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
43
namespace 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
0
        _y(0) {}
55
56
    Coordinate(double x_,double y_)
57
      : _x(x_),
58
0
        _y(y_) {}
59
60
    virtual ~Coordinate() {}
61
62
0
    void x(double x_) { _x=x_; }
63
    double x(void) const { return _x; }
64
65
0
    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
//
159
class MagickPPExport VPathBase
160
{
161
public:
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
//
184
class MagickPPExport VPath
185
{
186
public:
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
205
private:
206
  VPathBase* dp;
207
};
208
209
typedef std::vector<Magick::VPath> VPathList;
210
211
#if defined(MagickDLLExplicitTemplate)
212
213
MagickDrawableExtern template class MagickPPExport
214
std::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)
226
class MagickPPExport DrawableAffine  : public DrawableBase
227
{
228
public:
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
0
    {
246
0
      _affine.sx = sx_;
247
0
    }
248
  double sx( void ) const
249
    {
250
      return _affine.sx;
251
    }
252
253
  void sy( const double sy_ )
254
0
    {
255
0
      _affine.sy = sy_;
256
0
    }
257
  double sy( void ) const
258
    {
259
      return _affine.sy;
260
    }
261
262
  void rx( const double rx_ )
263
0
    {
264
0
      _affine.rx = rx_;
265
0
    }
266
  double rx( void ) const
267
    {
268
      return _affine.rx;
269
    }
270
271
  void ry( const double ry_ )
272
0
    {
273
0
      _affine.ry = ry_;
274
0
    }
275
  double ry( void ) const
276
    {
277
      return _affine.ry;
278
    }
279
280
  void tx( const double tx_ )
281
0
    {
282
0
      _affine.tx = tx_;
283
0
    }
284
  double tx( void ) const
285
    {
286
      return _affine.tx;
287
    }
288
289
  void ty( const double ty_ )
290
0
    {
291
0
      _affine.ty = ty_;
292
0
    }
293
  double ty( void ) const
294
    {
295
      return _affine.ty;
296
    }
297
298
private:
299
  MagickCore::AffineMatrix  _affine;
300
};
301
302
// Change pixel alpha value to transparent using PaintMethod
303
class MagickPPExport DrawableAlpha : public DrawableBase
304
{
305
public:
306
307
    DrawableAlpha(double x_, double y_,PaintMethod paintMethod_)
308
      : _x(x_),
309
        _y(y_),
310
        _paintMethod(paintMethod_)
311
0
    {
312
0
    }
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
0
    {
324
0
      _x=x_;
325
0
    }
326
327
    double x(void) const
328
0
    {
329
0
      return(_x);
330
0
    }
331
332
    void y(double y_)
333
0
    {
334
0
      _y=y_;
335
0
    }
336
337
    double y(void) const
338
0
    {
339
0
      return(_y);
340
0
    }
341
342
    void paintMethod(PaintMethod paintMethod_)
343
0
    {
344
0
      _paintMethod=paintMethod_;
345
0
    }
346
347
    PaintMethod paintMethod(void) const
348
0
    {
349
0
      return(_paintMethod);
350
0
    }
351
352
  private:
353
354
    double _x;
355
    double _y;
356
    PaintMethod _paintMethod;
357
};
358
359
// Arc
360
class MagickPPExport DrawableArc : public DrawableBase
361
{
362
public:
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
0
    { }
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
0
    {
384
0
      _startX = startX_;
385
0
    }
386
  double startX( void ) const
387
0
    {
388
0
      return _startX;
389
0
    }
390
391
  void startY( double startY_ )
392
0
    {
393
0
      _startY = startY_;
394
0
    }
395
  double startY( void ) const
396
0
    {
397
0
      return _startY;
398
0
    }
399
400
  void endX( double endX_ )
401
0
    {
402
0
      _endX = endX_;
403
0
    }
404
  double endX( void ) const
405
0
    {
406
0
      return _endX;
407
0
    }
408
409
  void endY( double endY_ )
410
0
    {
411
0
      _endY = endY_;
412
0
    }
413
  double endY( void ) const
414
0
    {
415
0
      return _endY;
416
0
    }
417
418
  void startDegrees( double startDegrees_ )
419
0
    {
420
0
      _startDegrees = startDegrees_;
421
0
    }
422
  double startDegrees( void ) const
423
0
    {
424
0
      return _startDegrees;
425
0
    }
426
427
  void endDegrees( double endDegrees_ )
428
0
    {
429
0
      _endDegrees = endDegrees_;
430
0
    }
431
  double endDegrees( void ) const
432
0
    {
433
0
      return _endDegrees;
434
0
    }
435
436
private:
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)
446
class MagickPPExport DrawableBezier : public DrawableBase
447
{
448
public:
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
464
private:
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
537
class MagickPPExport DrawablePopClipPath : public DrawableBase
538
{
539
public:
540
  DrawablePopClipPath ( void )
541
    : _dummy(0)
542
0
    {
543
0
      (void) _dummy;
544
0
    }
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
554
private:
555
  ::ssize_t   _dummy;
556
};
557
558
// Push (create) Clip path definition
559
class MagickPPExport DrawablePushClipPath : public DrawableBase
560
{
561
public:
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
574
private:
575
  std::string _id;
576
};
577
578
// Named Clip Path
579
class MagickPPExport DrawableClipPath : public DrawableBase
580
{
581
public:
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
0
    {
595
0
      _id = id_.c_str(); //multithread safe
596
0
    }
597
  std::string clip_path( void ) const
598
0
    {
599
0
      return _id;
600
0
    }
601
602
private:
603
  std::string   _id;
604
};
605
606
// Circle
607
class MagickPPExport DrawableCircle : public DrawableBase
608
{
609
public:
610
  DrawableCircle ( double originX_, double originY_,
611
                   double perimX_, double perimY_ )
612
    : _originX(originX_),
613
      _originY(originY_),
614
      _perimX(perimX_),
615
      _perimY(perimY_)
616
0
    {
617
0
    }
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
0
    {
629
0
      _originX = originX_;
630
0
    }
631
  double originX( void ) const
632
0
    {
633
0
      return _originX;
634
0
    }
635
636
  void originY( double originY_ )
637
0
    {
638
0
      _originY = originY_;
639
0
    }
640
  double originY( void ) const
641
0
    {
642
0
      return _originY;
643
0
    }
644
645
  void perimX( double perimX_ )
646
0
    {
647
0
      _perimX = perimX_;
648
0
    }
649
  double perimX( void ) const
650
0
    {
651
0
      return _perimX;
652
0
    }
653
654
  void perimY( double perimY_ )
655
0
    {
656
0
      _perimY = perimY_;
657
0
    }
658
  double perimY( void ) const
659
0
    {
660
0
      return _perimY;
661
0
    }
662
663
private:
664
  double _originX;
665
  double _originY;
666
  double _perimX;
667
  double _perimY;
668
};
669
670
// Colorize at point using PaintMethod
671
class MagickPPExport DrawableColor : public DrawableBase
672
{
673
public:
674
  DrawableColor ( double x_, double y_,
675
                  PaintMethod paintMethod_ )
676
    : _x(x_),
677
      _y(y_),
678
      _paintMethod(paintMethod_)
679
0
    { }
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
0
    {
691
0
      _x = x_;
692
0
    }
693
  double x( void ) const
694
0
    {
695
0
      return _x;
696
0
    }
697
698
  void y( double y_ )
699
0
    {
700
0
      _y = y_;
701
0
    }
702
  double y( void ) const
703
0
    {
704
0
      return _y;
705
0
    }
706
707
  void paintMethod( PaintMethod paintMethod_ )
708
0
    {
709
0
      _paintMethod = paintMethod_;
710
0
    }
711
  PaintMethod paintMethod( void ) const
712
0
    {
713
0
      return _paintMethod;
714
0
    }
715
716
private:
717
  double _x;
718
  double _y;
719
  PaintMethod _paintMethod;
720
};
721
722
// Draw image at point, scaled to size specified by width and height
723
class MagickPPExport Image;
724
class MagickPPExport DrawableCompositeImage : public DrawableBase
725
{
726
public:
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
0
    {
769
0
      _composition = composition_;
770
0
    }
771
  CompositeOperator composition( void ) const
772
0
    {
773
0
      return _composition;
774
0
    }
775
776
  void filename( const std::string &image_ );
777
  std::string filename( void ) const;
778
779
  void x( double x_ )
780
0
    {
781
0
      _x = x_;
782
0
    }
783
  double x( void ) const
784
0
    {
785
0
      return _x;
786
0
    }
787
788
  void y( double y_ )
789
0
    {
790
0
      _y = y_;
791
0
    }
792
  double y( void ) const
793
0
    {
794
0
      return _y;
795
0
    }
796
797
  void width( double width_ )
798
0
    {
799
0
      _width = width_;
800
0
    }
801
  double width( void ) const
802
0
    {
803
0
      return _width;
804
0
    }
805
806
  void height( double height_ )
807
0
    {
808
0
      _height = height_;
809
0
    }
810
  double height( void ) const
811
0
    {
812
0
      return _height;
813
0
    }
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
822
private:
823
  CompositeOperator  _composition;
824
  double             _x;
825
  double             _y;
826
  double             _width;
827
  double             _height;
828
  Image*             _image;
829
};
830
831
// Density
832
class MagickPPExport DrawableDensity : public DrawableBase
833
{
834
public:
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
846
private:
847
  std::string _density;
848
};
849
850
// Ellipse
851
class MagickPPExport DrawableEllipse : public DrawableBase
852
{
853
public:
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
0
    { }
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
0
    {
875
0
      _originX = originX_;
876
0
    }
877
  double originX( void ) const
878
0
    {
879
0
      return _originX;
880
0
    }
881
882
  void originY( double originY_ )
883
0
    {
884
0
      _originY = originY_;
885
0
    }
886
  double originY( void ) const
887
0
    {
888
0
      return _originY;
889
0
    }
890
891
  void radiusX( double radiusX_ )
892
0
    {
893
0
      _radiusX = radiusX_;
894
0
    }
895
  double radiusX( void ) const
896
0
    {
897
0
      return _radiusX;
898
0
    }
899
900
  void radiusY( double radiusY_ )
901
0
    {
902
0
      _radiusY = radiusY_;
903
0
    }
904
  double radiusY( void ) const
905
0
    {
906
0
      return _radiusY;
907
0
    }
908
909
  void arcStart( double arcStart_ )
910
0
    {
911
0
      _arcStart = arcStart_;
912
0
    }
913
  double arcStart( void ) const
914
0
    {
915
0
      return _arcStart;
916
0
    }
917
918
  void arcEnd( double arcEnd_ )
919
0
    {
920
0
      _arcEnd = arcEnd_;
921
0
    }
922
  double arcEnd( void ) const
923
0
    {
924
0
      return _arcEnd;
925
0
    }
926
927
private:
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
937
class MagickPPExport DrawableFillColor : public DrawableBase
938
{
939
public:
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
0
    {
954
0
      _color = color_;
955
0
    }
956
  Color color( void ) const
957
0
    {
958
0
      return _color;
959
0
    }
960
961
private:
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)
993
class MagickPPExport DrawableFillRule : public DrawableBase
994
{
995
public:
996
  DrawableFillRule ( const FillRule fillRule_ )
997
    : _fillRule(fillRule_)
998
0
    {
999
0
    }
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
0
    {
1011
0
      _fillRule = fillRule_;
1012
0
    }
1013
  FillRule fillRule( void ) const
1014
0
    {
1015
0
      return _fillRule;
1016
0
    }
1017
1018
private:
1019
  FillRule _fillRule;
1020
};
1021
1022
// Specify drawing fill alpha
1023
class MagickPPExport DrawableFillOpacity : public DrawableBase
1024
{
1025
public:
1026
1027
  DrawableFillOpacity(double opacity_)
1028
    : _opacity(opacity_)
1029
0
  {
1030
0
  }
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
0
  {
1042
0
    _opacity=opacity_;
1043
0
  }
1044
1045
  double opacity(void) const
1046
0
  {
1047
0
    return(_opacity);
1048
0
  }
1049
1050
private:
1051
  double _opacity;
1052
};
1053
1054
// Specify text font
1055
class MagickPPExport DrawableFont : public DrawableBase
1056
{
1057
public:
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
0
    {
1076
0
      _font = font_;
1077
0
    }
1078
  std::string font( void ) const
1079
0
    {
1080
0
      return _font;
1081
0
    }
1082
1083
private:
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
1092
class MagickPPExport DrawableGravity : public DrawableBase
1093
{
1094
public:
1095
  DrawableGravity ( GravityType gravity_ )
1096
    : _gravity(gravity_)
1097
0
    {
1098
0
    }
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
0
    {
1110
0
      _gravity = gravity_;
1111
0
    }
1112
  GravityType gravity( void ) const
1113
0
    {
1114
0
      return _gravity;
1115
0
    }
1116
1117
private:
1118
  GravityType _gravity;
1119
};
1120
1121
// Line
1122
class MagickPPExport DrawableLine : public DrawableBase
1123
{
1124
public:
1125
  DrawableLine ( double startX_, double startY_,
1126
                 double endX_, double endY_ )
1127
    : _startX(startX_),
1128
      _startY(startY_),
1129
      _endX(endX_),
1130
      _endY(endY_)
1131
0
    { }
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
0
    {
1143
0
      _startX = startX_;
1144
0
    }
1145
  double startX( void ) const
1146
0
    {
1147
0
      return _startX;
1148
0
    }
1149
1150
  void startY( double startY_ )
1151
0
    {
1152
0
      _startY = startY_;
1153
0
    }
1154
  double startY( void ) const
1155
0
    {
1156
0
      return _startY;
1157
0
    }
1158
1159
  void endX( double endX_ )
1160
0
    {
1161
0
      _endX = endX_;
1162
0
    }
1163
  double endX( void ) const
1164
0
    {
1165
0
      return _endX;
1166
0
    }
1167
1168
  void endY( double endY_ )
1169
0
    {
1170
0
      _endY = endY_;
1171
0
    }
1172
  double endY( void ) const
1173
0
    {
1174
0
      return _endY;
1175
0
    }
1176
1177
private:
1178
  double _startX;
1179
  double _startY;
1180
  double _endX;
1181
  double _endY;
1182
};
1183
1184
// Drawable Path
1185
class MagickPPExport DrawablePath : public DrawableBase
1186
{
1187
public:
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
1200
private:
1201
  VPathList _path;
1202
};
1203
1204
// Point
1205
class MagickPPExport DrawablePoint : public DrawableBase
1206
{
1207
public:
1208
  DrawablePoint ( double x_, double y_ )
1209
    : _x(x_),
1210
      _y(y_)
1211
0
    { }
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
0
    {
1223
0
      _x = x_;
1224
0
    }
1225
  double x( void ) const
1226
0
    {
1227
0
      return _x;
1228
0
    }
1229
1230
  void y( double y_ )
1231
0
    {
1232
0
      _y = y_;
1233
0
    }
1234
  double y( void ) const
1235
0
    {
1236
0
      return _y;
1237
0
    }
1238
1239
private:
1240
  double _x;
1241
  double _y;
1242
};
1243
1244
// Text pointsize
1245
class MagickPPExport DrawablePointSize : public DrawableBase
1246
{
1247
public:
1248
  DrawablePointSize ( double pointSize_ )
1249
    : _pointSize(pointSize_)
1250
0
    { }
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
0
    {
1262
0
      _pointSize = pointSize_;
1263
0
    }
1264
  double pointSize( void ) const
1265
0
    {
1266
0
      return _pointSize;
1267
0
    }
1268
1269
private:
1270
  double _pointSize;
1271
};
1272
1273
// Polygon (Coordinate list must contain at least three members)
1274
class MagickPPExport DrawablePolygon : public DrawableBase
1275
{
1276
public:
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
1289
private:
1290
  CoordinateList _coordinates;
1291
};
1292
1293
// Polyline (Coordinate list must contain at least three members)
1294
class MagickPPExport DrawablePolyline : public DrawableBase
1295
{
1296
public:
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
1309
private:
1310
  CoordinateList _coordinates;
1311
};
1312
1313
// Pop Graphic Context
1314
class MagickPPExport DrawablePopGraphicContext : public DrawableBase
1315
{
1316
public:
1317
  DrawablePopGraphicContext ( void )
1318
    : _dummy(0)
1319
0
    {
1320
0
      (void) _dummy;
1321
0
    }
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
1331
private:
1332
  ::ssize_t   _dummy;
1333
};
1334
1335
// Push Graphic Context
1336
class MagickPPExport DrawablePushGraphicContext : public DrawableBase
1337
{
1338
public:
1339
  DrawablePushGraphicContext ( void )
1340
    : _dummy(0)
1341
0
    {
1342
0
      (void) _dummy;
1343
0
    }
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
1353
private:
1354
  ::ssize_t   _dummy;
1355
};
1356
1357
// Pop (terminate) Pattern definition
1358
class MagickPPExport DrawablePopPattern : public DrawableBase
1359
{
1360
public:
1361
  DrawablePopPattern ( void )
1362
    : _dummy(0)
1363
0
    {
1364
0
      (void) _dummy;
1365
0
    }
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
1375
private:
1376
  ::ssize_t   _dummy;
1377
};
1378
1379
// Push (create) Pattern definition
1380
class MagickPPExport DrawablePushPattern : public DrawableBase
1381
{
1382
public:
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
1396
private:
1397
  std::string         _id;
1398
  ::ssize_t   _x;
1399
  ::ssize_t   _y;
1400
  size_t    _width;
1401
  size_t    _height;
1402
};
1403
1404
// Rectangle
1405
class MagickPPExport DrawableRectangle : public DrawableBase
1406
{
1407
public:
1408
  DrawableRectangle ( double upperLeftX_, double upperLeftY_,
1409
                      double lowerRightX_, double lowerRightY_ )
1410
    : _upperLeftX(upperLeftX_),
1411
      _upperLeftY(upperLeftY_),
1412
      _lowerRightX(lowerRightX_),
1413
      _lowerRightY(lowerRightY_)
1414
0
    { }
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
0
    {
1426
0
      _upperLeftX = upperLeftX_;
1427
0
    }
1428
  double upperLeftX( void ) const
1429
0
    {
1430
0
      return _upperLeftX;
1431
0
    }
1432
1433
  void upperLeftY( double upperLeftY_ )
1434
0
    {
1435
0
      _upperLeftY = upperLeftY_;
1436
0
    }
1437
  double upperLeftY( void ) const
1438
0
    {
1439
0
      return _upperLeftY;
1440
0
    }
1441
1442
  void lowerRightX( double lowerRightX_ )
1443
0
    {
1444
0
      _lowerRightX = lowerRightX_;
1445
0
    }
1446
  double lowerRightX( void ) const
1447
0
    {
1448
0
      return _lowerRightX;
1449
0
    }
1450
1451
  void lowerRightY( double lowerRightY_ )
1452
0
    {
1453
0
      _lowerRightY = lowerRightY_;
1454
0
    }
1455
  double lowerRightY( void ) const
1456
0
    {
1457
0
      return _lowerRightY;
1458
0
    }
1459
1460
private:
1461
  double _upperLeftX;
1462
  double _upperLeftY;
1463
  double _lowerRightX;
1464
  double _lowerRightY;
1465
};
1466
1467
// Apply Rotation
1468
class MagickPPExport DrawableRotation : public DrawableBase
1469
{
1470
public:
1471
  DrawableRotation ( double angle_ )
1472
    : _angle( angle_ )
1473
0
    { }
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
0
    {
1485
0
      _angle = angle_;
1486
0
    }
1487
  double angle( void ) const
1488
0
    {
1489
0
      return _angle;
1490
0
    }
1491
1492
private:
1493
  double _angle;
1494
};
1495
1496
// Round Rectangle
1497
class MagickPPExport DrawableRoundRectangle : public DrawableBase
1498
{
1499
public:
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
0
    { }
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
0
    {
1523
0
      _upperLeftX = centerX_;
1524
0
    }
1525
  double centerX( void ) const
1526
0
    {
1527
0
      return _upperLeftX;
1528
0
    }
1529
1530
  void centerY( double centerY_ )
1531
0
    {
1532
0
      _upperLeftY = centerY_;
1533
0
    }
1534
  double centerY( void ) const
1535
0
    {
1536
0
      return _upperLeftY;
1537
0
    }
1538
1539
  void width( double width_ )
1540
0
    {
1541
0
      _lowerRightX = width_;
1542
0
    }
1543
  double width( void ) const
1544
0
    {
1545
0
      return _lowerRightX;
1546
0
    }
1547
1548
  void hight( double hight_ )
1549
0
    {
1550
0
      _lowerRightY = hight_;
1551
0
    }
1552
  double hight( void ) const
1553
0
    {
1554
0
      return _lowerRightY;
1555
0
    }
1556
1557
#endif
1558
1559
  void upperLeftX( double upperLeftX_ )
1560
0
    {
1561
0
      _upperLeftX = upperLeftX_;
1562
0
    }
1563
  double upperLeftX( void ) const
1564
0
    {
1565
0
      return _upperLeftX;
1566
0
    }
1567
1568
  void upperLeftY( double upperLeftY_ )
1569
0
    {
1570
0
      _upperLeftY = upperLeftY_;
1571
0
    }
1572
  double upperLeftY( void ) const
1573
0
    {
1574
0
      return _upperLeftY;
1575
0
    }
1576
1577
  void lowerRightX( double lowerRightX_ )
1578
0
    {
1579
0
      _lowerRightX = lowerRightX_;
1580
0
    }
1581
  double lowerRightX( void ) const
1582
0
    {
1583
0
      return _lowerRightX;
1584
0
    }
1585
1586
  void lowerRightY( double lowerRightY_ )
1587
0
    {
1588
0
      _lowerRightY = lowerRightY_;
1589
0
    }
1590
  double lowerRightY( void ) const
1591
0
    {
1592
0
      return _lowerRightY;
1593
0
    }
1594
1595
  void cornerWidth( double cornerWidth_ )
1596
0
    {
1597
0
      _cornerWidth = cornerWidth_;
1598
0
    }
1599
  double cornerWidth( void ) const
1600
0
    {
1601
0
      return _cornerWidth;
1602
0
    }
1603
1604
  void cornerHeight( double cornerHeight_ )
1605
0
    {
1606
0
      _cornerHeight = cornerHeight_;
1607
0
    }
1608
  double cornerHeight( void ) const
1609
0
    {
1610
0
      return _cornerHeight;
1611
0
    }
1612
1613
private:
1614
  double _upperLeftX;
1615
  double _upperLeftY;
1616
  double _lowerRightX;
1617
  double _lowerRightY;
1618
  double _cornerWidth;
1619
  double _cornerHeight;
1620
};
1621
1622
// Apply Scaling
1623
class MagickPPExport DrawableScaling : public DrawableBase
1624
{
1625
public:
1626
  DrawableScaling ( double x_, double y_ )
1627
    : _x(x_),
1628
      _y(y_)
1629
0
    { }
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
0
    {
1641
0
      _x = x_;
1642
0
    }
1643
  double x( void ) const
1644
0
    {
1645
0
      return _x;
1646
0
    }
1647
1648
  void y( double y_ )
1649
0
    {
1650
0
      _y = y_;
1651
0
    }
1652
  double y( void ) const
1653
0
    {
1654
0
      return _y;
1655
0
    }
1656
1657
private:
1658
  double _x;
1659
  double _y;
1660
};
1661
1662
// Apply Skew in X direction
1663
class MagickPPExport DrawableSkewX : public DrawableBase
1664
{
1665
public:
1666
  DrawableSkewX ( double angle_ )
1667
    : _angle(angle_)
1668
0
    { }
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
0
    {
1680
0
      _angle = angle_;
1681
0
    }
1682
  double angle( void ) const
1683
0
    {
1684
0
      return _angle;
1685
0
    }
1686
1687
private:
1688
  double _angle;
1689
};
1690
1691
// Apply Skew in Y direction
1692
class MagickPPExport DrawableSkewY : public DrawableBase
1693
{
1694
public:
1695
  DrawableSkewY ( double angle_ )
1696
    : _angle(angle_)
1697
0
    { }
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
0
    {
1709
0
      _angle = angle_;
1710
0
    }
1711
  double angle( void ) const
1712
0
    {
1713
0
      return _angle;
1714
0
    }
1715
1716
private:
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
0
      { }
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
1776
class MagickPPExport DrawableStrokeLineCap : public DrawableBase
1777
{
1778
public:
1779
  DrawableStrokeLineCap ( LineCap linecap_ )
1780
    : _linecap(linecap_)
1781
0
    { }
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
0
    {
1793
0
      _linecap = linecap_;
1794
0
    }
1795
  LineCap linecap( void ) const
1796
0
    {
1797
0
      return _linecap;
1798
0
    }
1799
1800
private:
1801
  LineCap _linecap;
1802
};
1803
1804
// Stroke linejoin
1805
class MagickPPExport DrawableStrokeLineJoin : public DrawableBase
1806
{
1807
public:
1808
  DrawableStrokeLineJoin ( LineJoin linejoin_ )
1809
    : _linejoin(linejoin_)
1810
0
    { }
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
0
    {
1822
0
      _linejoin = linejoin_;
1823
0
    }
1824
  LineJoin linejoin( void ) const
1825
0
    {
1826
0
      return _linejoin;
1827
0
    }
1828
1829
private:
1830
  LineJoin _linejoin;
1831
};
1832
1833
// Stroke miterlimit
1834
class MagickPPExport DrawableMiterLimit : public DrawableBase
1835
{
1836
public:
1837
  DrawableMiterLimit ( size_t miterlimit_ )
1838
    : _miterlimit(miterlimit_)
1839
0
    { }
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
0
    {
1851
0
      _miterlimit = miterlimit_;
1852
0
    }
1853
  size_t miterlimit( void ) const
1854
0
    {
1855
0
      return _miterlimit;
1856
0
    }
1857
1858
private:
1859
  size_t _miterlimit;
1860
};
1861
1862
// Sets the pattern used for stroking object outlines.
1863
class MagickPPExport DrawableStrokePatternUrl : public DrawableBase
1864
{
1865
public:
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
1882
private:
1883
  std::string _url;
1884
};
1885
1886
// Stroke antialias
1887
class MagickPPExport DrawableStrokeAntialias : public DrawableBase
1888
{
1889
public:
1890
  DrawableStrokeAntialias ( bool flag_ )
1891
    : _flag(flag_)
1892
0
    { }
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
0
    {
1904
0
      _flag = flag_;
1905
0
    }
1906
  bool flag( void ) const
1907
0
    {
1908
0
      return _flag;
1909
0
    }
1910
1911
private:
1912
  bool _flag;
1913
};
1914
1915
// Stroke color
1916
class MagickPPExport DrawableStrokeColor : public DrawableBase
1917
{
1918
public:
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
0
    {
1933
0
      _color = color_;
1934
0
    }
1935
  Color color( void ) const
1936
0
    {
1937
0
      return _color;
1938
0
    }
1939
1940
private:
1941
  Color _color;
1942
};
1943
1944
// Stroke opacity
1945
class MagickPPExport DrawableStrokeOpacity : public DrawableBase
1946
{
1947
public:
1948
1949
  DrawableStrokeOpacity(double opacity_)
1950
    : _opacity(opacity_)
1951
0
  {
1952
0
  }
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
0
  {
1964
0
    _opacity=opacity_;
1965
0
  }
1966
1967
  double opacity(void) const
1968
0
  {
1969
0
    return(_opacity);
1970
0
  }
1971
1972
private:
1973
  double _opacity;
1974
};
1975
1976
// Stroke width
1977
class MagickPPExport DrawableStrokeWidth : public DrawableBase
1978
{
1979
public:
1980
  DrawableStrokeWidth ( double width_ )
1981
    : _width(width_)
1982
0
    { }
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
0
    {
1994
0
      _width = width_;
1995
0
    }
1996
  double width( void ) const
1997
0
    {
1998
0
      return _width;
1999
0
    }
2000
2001
private:
2002
  double _width;
2003
};
2004
2005
// Draw text at point
2006
class MagickPPExport DrawableText : public DrawableBase
2007
{
2008
public:
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
0
    {
2026
0
      _encoding = encoding_;
2027
0
    }
2028
2029
  void x( double x_ )
2030
0
    {
2031
0
      _x = x_;
2032
0
    }
2033
  double x( void ) const
2034
0
    {
2035
0
      return _x;
2036
0
    }
2037
2038
  void y( double y_ )
2039
0
    {
2040
0
      _y = y_;
2041
0
    }
2042
  double y( void ) const
2043
0
    {
2044
0
      return _y;
2045
0
    }
2046
2047
  void text( const std::string &text_ )
2048
0
    {
2049
0
      _text = text_;
2050
0
    }
2051
  std::string text( void ) const
2052
0
    {
2053
0
      return _text;
2054
0
    }
2055
2056
private:
2057
  double      _x;
2058
  double      _y;
2059
  std::string _text;
2060
  std::string _encoding;
2061
};
2062
2063
// Text alignment
2064
class MagickPPExport DrawableTextAlignment : public DrawableBase
2065
{
2066
public:
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
2083
private:
2084
  AlignType _alignment;
2085
};
2086
2087
// Text antialias
2088
class MagickPPExport DrawableTextAntialias : public DrawableBase
2089
{
2090
public:
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
0
    {
2105
0
      _flag = flag_;
2106
0
    }
2107
  bool flag( void ) const
2108
0
    {
2109
0
      return _flag;
2110
0
    }
2111
2112
private:
2113
  bool _flag;
2114
};
2115
2116
// Decoration (text decoration)
2117
class MagickPPExport DrawableTextDecoration : public DrawableBase
2118
{
2119
public:
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
0
    {
2134
0
      _decoration = decoration_;
2135
0
    }
2136
  DecorationType decoration( void ) const
2137
0
    {
2138
0
      return _decoration;
2139
0
    }
2140
2141
private:
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
2226
class MagickPPExport DrawableTextUnderColor : public DrawableBase
2227
{
2228
public:
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
0
    {
2243
0
      _color = color_;
2244
0
    }
2245
  Color color( void ) const
2246
0
    {
2247
0
      return _color;
2248
0
    }
2249
2250
private:
2251
  Color _color;
2252
};
2253
2254
// Apply Translation
2255
class MagickPPExport DrawableTranslation : public DrawableBase
2256
{
2257
public:
2258
  DrawableTranslation ( double x_, double y_ )
2259
    : _x(x_),
2260
      _y(y_)
2261
0
    { }
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
0
    {
2273
0
      _x = x_;
2274
0
    }
2275
  double x( void ) const
2276
0
    {
2277
0
      return _x;
2278
0
    }
2279
2280
  void y( double y_ )
2281
0
    {
2282
0
      _y = y_;
2283
0
    }
2284
  double y( void ) const
2285
0
    {
2286
0
      return _y;
2287
0
    }
2288
2289
private:
2290
  double _x;
2291
  double _y;
2292
};
2293
2294
// Set the size of the viewbox
2295
class MagickPPExport DrawableViewbox : public DrawableBase
2296
{
2297
public:
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
0
      _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
0
    {
2316
0
      _x1 = x1_;
2317
0
    }
2318
  ::ssize_t x1( void ) const
2319
0
    {
2320
0
      return _x1;
2321
0
    }
2322
2323
  void y1( ::ssize_t y1_ )
2324
0
    {
2325
0
      _y1 = y1_;
2326
0
    }
2327
  ::ssize_t y1( void ) const
2328
0
    {
2329
0
      return _y1;
2330
0
    }
2331
2332
  void x2( ::ssize_t x2_ )
2333
0
    {
2334
0
      _x2 = x2_;
2335
0
    }
2336
  ::ssize_t x2( void ) const
2337
0
    {
2338
0
      return _x2;
2339
0
    }
2340
2341
  void y2( ::ssize_t y2_ )
2342
0
    {
2343
0
      _y2 = y2_;
2344
0
    }
2345
  ::ssize_t y2( void ) const
2346
0
    {
2347
0
      return _y2;
2348
0
    }
2349
2350
private:
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
//
2360
class MagickPPExport PathArcArgs
2361
{
2362
public:
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
0
    {
2375
0
      _radiusX = radiusX_;
2376
0
    }
2377
  double radiusX( void ) const
2378
    {
2379
      return _radiusX;
2380
    }
2381
2382
  void radiusY( double radiusY_ )
2383
0
    {
2384
0
      _radiusY = radiusY_;
2385
0
    }
2386
  double radiusY( void ) const
2387
    {
2388
      return _radiusY;
2389
    }
2390
2391
  void xAxisRotation( double xAxisRotation_ )
2392
0
    {
2393
0
      _xAxisRotation = xAxisRotation_;
2394
0
    }
2395
  double xAxisRotation( void ) const
2396
    {
2397
      return _xAxisRotation;
2398
    }
2399
2400
  void largeArcFlag( bool largeArcFlag_ )
2401
0
    {
2402
0
      _largeArcFlag = largeArcFlag_;
2403
0
    }
2404
  bool largeArcFlag( void ) const
2405
    {
2406
      return _largeArcFlag;
2407
    }
2408
2409
  void sweepFlag( bool sweepFlag_ )
2410
0
    {
2411
0
      _sweepFlag = sweepFlag_;
2412
0
    }
2413
  bool sweepFlag( void ) const
2414
    {
2415
      return _sweepFlag;
2416
    }
2417
2418
  void x( double x_ )
2419
0
    {
2420
0
      _x = x_;
2421
0
    }
2422
  double x( void ) const
2423
    {
2424
      return _x;
2425
    }
2426
2427
  void y( double y_ )
2428
0
    {
2429
0
      _y = y_;
2430
0
    }
2431
  double y( void ) const
2432
    {
2433
      return _y;
2434
    }
2435
2436
private:
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
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
extern MagickPPExport int operator <  ( const PathArcArgs& left_,
2454
                                      const PathArcArgs& right_ );
2455
extern MagickPPExport int operator >= ( const PathArcArgs& left_,
2456
                                      const PathArcArgs& right_ );
2457
extern MagickPPExport int operator <= ( const PathArcArgs& left_,
2458
                                      const PathArcArgs& right_ );
2459
2460
typedef std::vector<Magick::PathArcArgs> PathArcArgsList;
2461
2462
#if defined(MagickDLLExplicitTemplate)
2463
2464
MagickDrawableExtern template class MagickPPExport
2465
std::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)
2473
class MagickPPExport PathArcAbs : public VPathBase
2474
{
2475
public:
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
2494
private:
2495
  PathArcArgsList _coordinates;
2496
};
2497
class MagickPPExport PathArcRel : public VPathBase
2498
{
2499
public:
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
2516
private:
2517
  PathArcArgsList _coordinates;
2518
};
2519
2520
// Path Closepath
2521
class MagickPPExport PathClosePath : public VPathBase
2522
{
2523
public:
2524
  PathClosePath ( void )
2525
    : _dummy(0)
2526
0
    {
2527
0
      (void) _dummy;
2528
0
    }
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
2538
private:
2539
  ::ssize_t   _dummy;
2540
};
2541
2542
//
2543
// Curveto (Cubic Bezier)
2544
//
2545
class MagickPPExport PathCurvetoArgs
2546
{
2547
public:
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
0
    {
2560
0
      _x1 = x1_;
2561
0
    }
2562
double x1( void ) const
2563
{
2564
  return _x1;
2565
}
2566
2567
void y1( double y1_ )
2568
0
{
2569
0
  _y1 = y1_;
2570
0
}
2571
double y1( void ) const
2572
{
2573
  return _y1;
2574
}
2575
2576
void x2( double x2_ )
2577
0
{
2578
0
  _x2 = x2_;
2579
0
}
2580
double x2( void ) const
2581
{
2582
  return _x2;
2583
}
2584
2585
void y2( double y2_ )
2586
0
{
2587
0
  _y2 = y2_;
2588
0
}
2589
double y2( void ) const
2590
{
2591
  return _y2;
2592
}
2593
2594
void x( double x_ )
2595
0
{
2596
0
  _x = x_;
2597
0
}
2598
double x( void ) const
2599
{
2600
  return _x;
2601
}
2602
2603
void y( double y_ )
2604
0
{
2605
0
  _y = y_;
2606
0
}
2607
double y( void ) const
2608
{
2609
  return _y;
2610
}
2611
2612
private:
2613
double _x1;
2614
double _y1;
2615
double _x2;
2616
double _y2;
2617
double _x;
2618
double _y;
2619
};
2620
2621
// Compare two PathCurvetoArgs objects regardless of LHS/RHS
2622
extern MagickPPExport int operator == ( const PathCurvetoArgs& left_,
2623
                                      const PathCurvetoArgs& right_ );
2624
extern MagickPPExport int operator != ( const PathCurvetoArgs& left_,
2625
                                      const PathCurvetoArgs& right_ );
2626
extern MagickPPExport int operator >  ( const PathCurvetoArgs& left_,
2627
                                      const PathCurvetoArgs& right_ );
2628
extern MagickPPExport int operator <  ( const PathCurvetoArgs& left_,
2629
                                      const PathCurvetoArgs& right_ );
2630
extern MagickPPExport int operator >= ( const PathCurvetoArgs& left_,
2631
                                      const PathCurvetoArgs& right_ );
2632
extern MagickPPExport int operator <= ( const PathCurvetoArgs& left_,
2633
                                      const PathCurvetoArgs& right_ );
2634
2635
typedef std::vector<Magick::PathCurvetoArgs> PathCurveToArgsList;
2636
2637
#if defined(MagickDLLExplicitTemplate)
2638
2639
MagickDrawableExtern template class MagickPPExport
2640
std::allocator<Magick::PathCurvetoArgs>;
2641
2642
// MagickDrawableExtern template class MagickPPExport
2643
// std::vector<Magick::PathCurvetoArgs, std::allocator<Magick::PathCurvetoArgs> >;
2644
2645
#endif // MagickDLLExplicitTemplate
2646
2647
class MagickPPExport PathCurvetoAbs : public VPathBase
2648
{
2649
public:
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
2668
private:
2669
  PathCurveToArgsList _args;
2670
};
2671
class MagickPPExport PathCurvetoRel : public VPathBase
2672
{
2673
public:
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
2691
private:
2692
  PathCurveToArgsList _args;
2693
};
2694
class MagickPPExport PathSmoothCurvetoAbs : public VPathBase
2695
{
2696
public:
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
2715
private:
2716
  CoordinateList _coordinates;
2717
};
2718
class MagickPPExport PathSmoothCurvetoRel : public VPathBase
2719
{
2720
public:
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
2740
private:
2741
  CoordinateList _coordinates;
2742
};
2743
2744
//
2745
// Quadratic Curveto (Quadratic Bezier)
2746
//
2747
class MagickPPExport PathQuadraticCurvetoArgs
2748
{
2749
public:
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
0
    {
2761
0
      _x1 = x1_;
2762
0
    }
2763
  double x1( void ) const
2764
    {
2765
      return _x1;
2766
    }
2767
2768
  void y1( double y1_ )
2769
0
    {
2770
0
      _y1 = y1_;
2771
0
    }
2772
  double y1( void ) const
2773
    {
2774
      return _y1;
2775
    }
2776
2777
  void x( double x_ )
2778
0
    {
2779
0
      _x = x_;
2780
0
    }
2781
  double x( void ) const
2782
    {
2783
      return _x;
2784
    }
2785
2786
  void y( double y_ )
2787
0
    {
2788
0
      _y = y_;
2789
0
    }
2790
  double y( void ) const
2791
    {
2792
      return _y;
2793
    }
2794
2795
private:
2796
  double _x1;
2797
  double _y1;
2798
  double _x;
2799
  double _y;
2800
};
2801
2802
// Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS
2803
extern MagickPPExport int operator == ( const PathQuadraticCurvetoArgs& left_,
2804
                                      const PathQuadraticCurvetoArgs& right_ );
2805
extern MagickPPExport int operator != ( const PathQuadraticCurvetoArgs& left_,
2806
                                      const PathQuadraticCurvetoArgs& right_);
2807
extern MagickPPExport int operator >  ( const PathQuadraticCurvetoArgs& left_,
2808
                                      const PathQuadraticCurvetoArgs& right_);
2809
extern MagickPPExport int operator <  ( const PathQuadraticCurvetoArgs& left_,
2810
                                      const PathQuadraticCurvetoArgs& right_);
2811
extern MagickPPExport int operator >= ( const PathQuadraticCurvetoArgs& left_,
2812
                                      const PathQuadraticCurvetoArgs& right_ );
2813
extern MagickPPExport int operator <= ( const PathQuadraticCurvetoArgs& left_,
2814
                                      const PathQuadraticCurvetoArgs& right_ );
2815
2816
typedef std::vector<Magick::PathQuadraticCurvetoArgs> PathQuadraticCurvetoArgsList;
2817
2818
#if defined(MagickDLLExplicitTemplate)
2819
2820
MagickDrawableExtern template class MagickPPExport
2821
std::allocator<Magick::PathQuadraticCurvetoArgs>;
2822
2823
// MagickDrawableExtern template class MagickPPExport
2824
// std::vector<Magick::PathQuadraticCurvetoArgs, std::allocator<Magick::PathQuadraticCurvetoArgs> >;
2825
2826
#endif // MagickDLLExplicitTemplate
2827
2828
class MagickPPExport PathQuadraticCurvetoAbs : public VPathBase
2829
{
2830
public:
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
2849
private:
2850
  PathQuadraticCurvetoArgsList _args;
2851
};
2852
class MagickPPExport PathQuadraticCurvetoRel : public VPathBase
2853
{
2854
public:
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
2873
private:
2874
  PathQuadraticCurvetoArgsList _args;
2875
};
2876
class MagickPPExport PathSmoothQuadraticCurvetoAbs : public VPathBase
2877
{
2878
public:
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
2897
private:
2898
  CoordinateList _coordinates;
2899
};
2900
class MagickPPExport PathSmoothQuadraticCurvetoRel : public VPathBase
2901
{
2902
public:
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
2921
private:
2922
  CoordinateList _coordinates;
2923
};
2924
2925
//
2926
// Path Lineto
2927
//
2928
class MagickPPExport PathLinetoAbs : public VPathBase
2929
{
2930
public:
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
2949
private:
2950
  CoordinateList _coordinates;
2951
};
2952
class MagickPPExport PathLinetoRel : public VPathBase
2953
{
2954
public:
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
2973
private:
2974
  CoordinateList _coordinates;
2975
};
2976
2977
// Path Horizontal Lineto
2978
class MagickPPExport PathLinetoHorizontalAbs : public VPathBase
2979
{
2980
public:
2981
  PathLinetoHorizontalAbs ( double x_ )
2982
    : _x(x_)
2983
0
    {
2984
0
    }
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
0
    {
2996
0
      _x = x_;
2997
0
    }
2998
  double x( void ) const
2999
0
    {
3000
0
      return _x;
3001
0
    }
3002
3003
private:
3004
  double _x;
3005
};
3006
class MagickPPExport PathLinetoHorizontalRel : public VPathBase
3007
{
3008
public:
3009
  PathLinetoHorizontalRel ( double x_ )
3010
    : _x(x_)
3011
0
    {
3012
0
    }
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
0
    {
3024
0
      _x = x_;
3025
0
    }
3026
  double x( void ) const
3027
0
    {
3028
0
      return _x;
3029
0
    }
3030
3031
private:
3032
  double _x;
3033
};
3034
3035
// Path Vertical Lineto
3036
class MagickPPExport PathLinetoVerticalAbs : public VPathBase
3037
{
3038
public:
3039
  PathLinetoVerticalAbs ( double y_ )
3040
    : _y(y_)
3041
0
    {
3042
0
    }
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
0
    {
3054
0
      _y = y_;
3055
0
    }
3056
  double y( void ) const
3057
0
    {
3058
0
      return _y;
3059
0
    }
3060
3061
private:
3062
  double _y;
3063
};
3064
class MagickPPExport PathLinetoVerticalRel : public VPathBase
3065
{
3066
public:
3067
  PathLinetoVerticalRel ( double y_ )
3068
    : _y(y_)
3069
0
    {
3070
0
    }
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
0
    {
3082
0
      _y = y_;
3083
0
    }
3084
  double y( void ) const
3085
0
    {
3086
0
      return _y;
3087
0
    }
3088
3089
private:
3090
  double _y;
3091
};
3092
3093
// Path Moveto
3094
class MagickPPExport PathMovetoAbs : public VPathBase
3095
{
3096
public:
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
3115
private:
3116
  CoordinateList _coordinates;
3117
};
3118
class MagickPPExport PathMovetoRel : public VPathBase
3119
{
3120
public:
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
3139
private:
3140
  CoordinateList _coordinates;
3141
};
3142
3143
} // namespace Magick
3144
3145
#endif // Magick_Drawable_header