Coverage Report

Created: 2025-06-16 07:00

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