Coverage Report

Created: 2026-10-28 07:26

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