Coverage Report

Created: 2025-07-23 08:18

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