Coverage Report

Created: 2026-07-25 07:06

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/graphicsmagick/Magick++/lib/Drawable.cpp
Line
Count
Source
1
// This may look like C code, but it is really -*- C++ -*-
2
//
3
// Copyright Bob Friesenhahn, 1999 - 2018
4
//
5
// Implementation of Drawable (Graphic objects)
6
//
7
8
#define MAGICK_IMPLEMENTATION
9
#define MAGICK_PLUSPLUS_IMPLEMENTATION
10
#define MAGICK_DRAWABLE_IMPLEMENTATION
11
12
#include "Magick++/Include.h"
13
#include <math.h>
14
#include <string>
15
16
#include "Magick++/Drawable.h"
17
#include "Magick++/Image.h"
18
19
using namespace std;
20
21
MagickDLLDecl int Magick::operator == ( const Magick::Coordinate& left_,
22
                                        const Magick::Coordinate& right_ )
23
0
{
24
0
  return ( ( left_.x() == right_.x() ) && ( left_.y() == right_.y() ) );
25
0
}
26
MagickDLLDecl int Magick::operator != ( const Magick::Coordinate& left_,
27
                                        const Magick::Coordinate& right_ )
28
0
{
29
0
  return ( ! (left_ == right_) );
30
0
}
31
MagickDLLDecl int Magick::operator >  ( const Magick::Coordinate& left_,
32
                                        const Magick::Coordinate& right_ )
33
0
{
34
0
  return ( !( left_ < right_ ) && ( left_ != right_ ) );
35
0
}
36
MagickDLLDecl int Magick::operator <  ( const Magick::Coordinate& left_,
37
                                        const Magick::Coordinate& right_ )
38
0
{
39
  // Based on distance from origin
40
0
  return  ( (sqrt(left_.x()*left_.x() + left_.y()*left_.y())) <
41
0
            (sqrt(right_.x()*right_.x() + right_.y()*right_.y())) );
42
0
}
43
MagickDLLDecl int Magick::operator >= ( const Magick::Coordinate& left_,
44
                                        const Magick::Coordinate& right_ )
45
0
{
46
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
47
0
}
48
MagickDLLDecl int Magick::operator <= ( const Magick::Coordinate& left_,
49
                                        const Magick::Coordinate& right_ )
50
0
{
51
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
52
0
}
53
54
/*virtual*/
55
Magick::DrawableBase::~DrawableBase ( void )
56
0
{
57
0
}
58
59
// Constructor
60
Magick::Drawable::Drawable ( void )
61
0
  : dp(0)
62
0
{
63
0
}
64
65
// Construct from DrawableBase
66
Magick::Drawable::Drawable ( const Magick::DrawableBase& original_ )
67
0
  : dp(original_.copy())
68
0
{
69
0
}
70
71
// Destructor
72
Magick::Drawable::~Drawable ( void )
73
0
{
74
0
  delete dp;
75
0
  dp = 0;
76
0
}
77
78
// Copy constructor
79
Magick::Drawable::Drawable ( const Magick::Drawable& original_ )
80
0
  : dp(original_.dp? original_.dp->copy(): 0)
81
0
{
82
0
}
83
84
// Assignment operator
85
Magick::Drawable& Magick::Drawable::operator= (const Magick::Drawable& original_ )
86
0
{
87
0
  if (this != &original_)
88
0
    {
89
0
      DrawableBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
90
0
      delete dp;
91
0
      dp = temp_dp;
92
0
    }
93
0
  return *this;
94
0
}
95
96
// Operator to invoke contained object
97
void Magick::Drawable::operator()( MagickLib::DrawContext context_ ) const
98
0
{
99
0
  if(dp)
100
0
    dp->operator()( context_ );
101
0
}
102
103
MagickDLLDecl int Magick::operator == ( const Magick::Drawable& /*left_*/,
104
                                        const Magick::Drawable& /*right_*/ )
105
0
{
106
0
  return ( 1 );
107
0
}
108
MagickDLLDecl int Magick::operator != ( const Magick::Drawable& /*left_*/,
109
                                        const Magick::Drawable& /*right_*/ )
110
0
{
111
0
  return ( 0 );
112
0
}
113
MagickDLLDecl int Magick::operator > ( const Magick::Drawable& /*left_*/,
114
                                       const Magick::Drawable& /*right_*/ )
115
0
{
116
0
  return ( 0 );
117
0
}
118
MagickDLLDecl int Magick::operator <  ( const Magick::Drawable& /*left_*/,
119
                                        const Magick::Drawable& /*right_*/ )
120
0
{
121
0
  return  ( 0 );
122
0
}
123
MagickDLLDecl int Magick::operator >= ( const Magick::Drawable& left_,
124
                                        const Magick::Drawable& right_ )
125
0
{
126
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
127
0
}
128
MagickDLLDecl int Magick::operator <= ( const Magick::Drawable& left_,
129
                                        const Magick::Drawable& right_ )
130
0
{
131
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
132
0
}
133
134
/*virtual*/
135
Magick::VPathBase::~VPathBase ( void )
136
0
{
137
0
}
138
139
// Constructor
140
Magick::VPath::VPath ( void )
141
0
  : dp(0)
142
0
{
143
0
}
144
145
// Construct from VPathBase
146
Magick::VPath::VPath ( const Magick::VPathBase& original_ )
147
0
  : dp(original_.copy())
148
0
{
149
0
}
150
151
// Destructor
152
/* virtual */ Magick::VPath::~VPath ( void )
153
0
{
154
0
  delete dp;
155
0
  dp = 0;
156
0
}
157
158
// Copy constructor
159
Magick::VPath::VPath ( const Magick::VPath& original_ )
160
0
  : dp(original_.dp? original_.dp->copy(): 0)
161
0
{
162
0
}
163
164
// Assignment operator
165
Magick::VPath& Magick::VPath::operator= (const Magick::VPath& original_ )
166
0
{
167
0
  if (this != &original_)
168
0
    {
169
0
      VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
170
0
      delete dp;
171
0
      dp = temp_dp;
172
0
    }
173
0
  return *this;
174
0
}
175
176
// Operator to invoke contained object
177
void Magick::VPath::operator()( MagickLib::DrawContext context_ ) const
178
0
{
179
0
  if(dp)
180
0
    dp->operator()( context_ );
181
0
}
182
183
MagickDLLDecl int Magick::operator == ( const Magick::VPath& /*left_*/,
184
                                        const Magick::VPath& /*right_*/ )
185
0
{
186
0
  return ( 1 );
187
0
}
188
MagickDLLDecl int Magick::operator != ( const Magick::VPath& /*left_*/,
189
                                        const Magick::VPath& /*right_*/ )
190
0
{
191
0
  return ( 0 );
192
0
}
193
MagickDLLDecl int Magick::operator > ( const Magick::VPath& /*left_*/,
194
                                       const Magick::VPath& /*right_*/ )
195
0
{
196
0
  return ( 0 );
197
0
}
198
MagickDLLDecl int Magick::operator <  ( const Magick::VPath& /*left_*/,
199
                                        const Magick::VPath& /*right_*/ )
200
0
{
201
0
  return  ( 0 );
202
0
}
203
MagickDLLDecl int Magick::operator >= ( const Magick::VPath& left_,
204
                                        const Magick::VPath& right_ )
205
0
{
206
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
207
0
}
208
MagickDLLDecl int Magick::operator <= ( const Magick::VPath& left_,
209
                                        const Magick::VPath& right_ )
210
0
{
211
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
212
0
}
213
214
//
215
// Drawable Objects
216
//
217
218
// Affine (scaling, rotation, and translation)
219
Magick::DrawableAffine::DrawableAffine( double sx_, double sy_,
220
                                        double rx_, double ry_,
221
                                        double tx_, double ty_ )
222
0
{
223
0
  _affine.sx = sx_;
224
0
  _affine.rx = rx_;
225
0
  _affine.ry = ry_;
226
0
  _affine.sy = sy_;
227
0
  _affine.tx = tx_;
228
0
  _affine.ty = ty_;
229
0
}
230
Magick::DrawableAffine::DrawableAffine( void )
231
0
{
232
0
  IdentityAffine(&_affine);
233
0
}
234
Magick::DrawableAffine::~DrawableAffine( void )
235
{
236
}
237
void Magick::DrawableAffine::operator()( MagickLib::DrawContext context_ ) const
238
0
{
239
0
  DrawAffine( context_, &_affine );
240
0
}
241
Magick::DrawableBase* Magick::DrawableAffine::copy() const
242
0
{
243
0
  return new DrawableAffine(*this);
244
0
}
245
246
// Arc
247
Magick::DrawableArc::~DrawableArc( void )
248
{
249
}
250
void Magick::DrawableArc::operator()( MagickLib::DrawContext context_ ) const
251
0
{
252
0
  DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
253
0
}
254
Magick::DrawableBase* Magick::DrawableArc::copy() const
255
0
{
256
0
  return new DrawableArc(*this);
257
0
}
258
259
//
260
// Bezier curve
261
//
262
// Construct from coordinates (Coordinate list must contain at least three members)
263
Magick::DrawableBezier::DrawableBezier ( const CoordinateList &coordinates_ )
264
0
  : _coordinates(coordinates_)
265
0
{
266
0
}
267
// Copy constructor
268
Magick::DrawableBezier::DrawableBezier( const Magick::DrawableBezier& original_ )
269
0
  : DrawableBase (original_),
270
0
    _coordinates(original_._coordinates)
271
0
{
272
0
}
273
// Destructor
274
Magick::DrawableBezier::~DrawableBezier( void )
275
0
{
276
0
}
277
void Magick::DrawableBezier::operator()( MagickLib::DrawContext context_ ) const
278
0
{
279
0
  size_t num_coords = _coordinates.size();
280
0
  PointInfo *coordinates = new PointInfo[num_coords];
281
282
0
  PointInfo *q = coordinates;
283
0
  CoordinateList::const_iterator p = _coordinates.begin();
284
285
0
  while( p != _coordinates.end() )
286
0
    {
287
0
      q->x = p->x();
288
0
      q->y = p->y();
289
0
      q++;
290
0
      p++;
291
0
    }
292
293
0
  DrawBezier( context_, (unsigned long) num_coords, coordinates );
294
0
  delete [] coordinates;
295
0
}
296
Magick::DrawableBase* Magick::DrawableBezier::copy() const
297
0
{
298
0
  return new DrawableBezier(*this);
299
0
}
300
301
//
302
//Clip Path
303
//
304
305
// Pop (terminate) Clip path definition
306
Magick::DrawablePopClipPath::~DrawablePopClipPath ( void )
307
{
308
}
309
void Magick::DrawablePopClipPath::operator() ( MagickLib::DrawContext context_ ) const
310
0
{
311
0
  DrawPopClipPath( context_ );
312
0
  DrawPopDefs(context_);
313
0
}
314
Magick::DrawableBase* Magick::DrawablePopClipPath::copy() const
315
0
{
316
0
  return new DrawablePopClipPath(*this);
317
0
}
318
319
// Push clip path definition
320
Magick::DrawablePushClipPath::DrawablePushClipPath( const std::string &id_)
321
0
  : _id(id_.c_str())    //multithread safe const char*
322
0
{
323
0
}
324
Magick::DrawablePushClipPath::DrawablePushClipPath
325
( const Magick::DrawablePushClipPath& original_ ) //multithread safe const char*
326
0
  : DrawableBase (original_),
327
0
    _id(original_._id.c_str())
328
0
{
329
0
}
330
Magick::DrawablePushClipPath::~DrawablePushClipPath( void )
331
0
{
332
0
}
333
void Magick::DrawablePushClipPath::operator()
334
  ( MagickLib::DrawContext context_ ) const
335
0
{
336
0
  DrawPushDefs(context_);
337
0
  DrawPushClipPath( context_, _id.c_str());
338
0
}
339
Magick::DrawableBase* Magick::DrawablePushClipPath::copy() const
340
0
{
341
0
  return new DrawablePushClipPath(*this);
342
0
}
343
//
344
// ClipPath
345
//
346
Magick::DrawableClipPath::DrawableClipPath( const std::string &id_ )
347
0
:_id(id_.c_str())
348
0
{
349
0
}
350
351
Magick::DrawableClipPath::DrawableClipPath ( const Magick::DrawableClipPath& original_ )
352
0
  : DrawableBase (original_),
353
0
    _id(original_._id.c_str())
354
0
{
355
0
}
356
Magick::DrawableClipPath::~DrawableClipPath( void )
357
0
{
358
0
}
359
void Magick::DrawableClipPath::operator()( MagickLib::DrawContext context_ ) const
360
0
{
361
0
        DrawSetClipPath( context_, _id.c_str());
362
0
}
363
Magick::DrawableBase* Magick::DrawableClipPath::copy() const
364
0
{
365
0
  return new DrawableClipPath(*this);
366
0
}
367
368
// Circle
369
Magick::DrawableCircle::~DrawableCircle ( void )
370
{
371
}
372
void Magick::DrawableCircle::operator()( MagickLib::DrawContext context_ ) const
373
0
{
374
0
  DrawCircle( context_, _originX, _originY, _perimX, _perimY );
375
0
}
376
Magick::DrawableBase* Magick::DrawableCircle::copy() const
377
0
{
378
0
  return new DrawableCircle(*this);
379
0
}
380
381
// Colorize at point using PaintMethod
382
Magick::DrawableColor::~DrawableColor( void )
383
{
384
}
385
void Magick::DrawableColor::operator()( MagickLib::DrawContext context_ ) const
386
0
{
387
0
  DrawColor( context_, _x, _y, _paintMethod );
388
0
}
389
Magick::DrawableBase* Magick::DrawableColor::copy() const
390
0
{
391
0
  return new DrawableColor(*this);
392
0
}
393
394
// Draw image at point
395
Magick::DrawableCompositeImage::DrawableCompositeImage
396
( double x_, double y_,
397
  double width_, double height_,
398
  const std::string &filename_,
399
  Magick::CompositeOperator composition_ )
400
0
  : _composition(composition_),
401
0
    _x(x_),
402
0
    _y(y_),
403
0
    _width(width_),
404
0
    _height(height_),
405
0
    _image(new Image(filename_))
406
0
{
407
0
}
408
Magick::DrawableCompositeImage::DrawableCompositeImage
409
( double x_, double y_,
410
  double width_, double height_,
411
  const Magick::Image &image_,
412
  Magick::CompositeOperator composition_ )
413
0
  : _composition(composition_),
414
0
    _x(x_),
415
0
    _y(y_),
416
0
    _width(width_),
417
0
    _height(height_),
418
0
    _image(new Image(image_))
419
0
{
420
0
}
421
Magick::DrawableCompositeImage::DrawableCompositeImage
422
( double x_, double y_,
423
  double width_, double height_,
424
  const std::string &filename_ )
425
0
  :_composition(CopyCompositeOp),
426
0
   _x(x_),
427
0
   _y(y_),
428
0
   _width(width_),
429
0
   _height(height_),
430
0
   _image(new Image(filename_))
431
0
{
432
0
}
433
Magick::DrawableCompositeImage::DrawableCompositeImage
434
( double x_, double y_,
435
  double width_, double height_,
436
  const Magick::Image &image_ )
437
0
  :_composition(CopyCompositeOp),
438
0
   _x(x_),
439
0
   _y(y_),
440
0
   _width(width_),
441
0
   _height(height_),
442
0
   _image(new Image(image_))
443
0
{
444
0
}
445
Magick::DrawableCompositeImage::DrawableCompositeImage
446
( double x_, double y_,
447
  const std::string &filename_ )
448
0
  : _composition(CopyCompositeOp),
449
0
    _x(x_),
450
0
    _y(y_),
451
0
    _width(0),
452
0
    _height(0),
453
0
    _image(new Image(filename_))
454
0
{
455
0
  _width=_image->columns();
456
0
  _height=_image->rows();
457
0
}
458
Magick::DrawableCompositeImage::DrawableCompositeImage
459
( double x_, double y_,
460
  const Magick::Image &image_ )
461
0
  : _composition(CopyCompositeOp),
462
0
    _x(x_),
463
0
    _y(y_),
464
0
    _width(0),
465
0
    _height(0),
466
0
    _image(new Image(image_))
467
0
{
468
0
  _width=_image->columns();
469
0
  _height=_image->rows();
470
0
}
471
// Copy constructor
472
Magick::DrawableCompositeImage::DrawableCompositeImage
473
( const Magick::DrawableCompositeImage& original_ )
474
0
  :  Magick::DrawableBase(original_),
475
0
     _composition(original_._composition),
476
0
     _x(original_._x),
477
0
     _y(original_._y),
478
0
     _width(original_._width),
479
0
     _height(original_._height),
480
0
     _image(new Image(*original_._image))
481
0
{
482
0
}
483
Magick::DrawableCompositeImage::~DrawableCompositeImage( void )
484
0
{
485
0
  delete _image;
486
0
}
487
// Assignment operator
488
Magick::DrawableCompositeImage& Magick::DrawableCompositeImage::operator=
489
(const Magick::DrawableCompositeImage& original_ )
490
0
{
491
  // If not being set to ourself
492
0
  if ( this != &original_ )
493
0
    {
494
0
      _composition = original_._composition;
495
0
      _x = original_._x;
496
0
      _y = original_._y;
497
0
      _width = original_._width;
498
0
      _height = original_._height;
499
0
      Image* temp_image = new Image(*original_._image);
500
0
      delete _image;
501
0
      _image = temp_image;
502
0
    }
503
0
  return *this;
504
0
}
505
void Magick::DrawableCompositeImage::filename( const std::string &filename_ )
506
0
{
507
0
  Image* temp_image = new Image(filename_);
508
0
  delete _image;
509
0
  _image = temp_image;
510
0
}
511
std::string Magick::DrawableCompositeImage::filename( void ) const
512
0
{
513
0
  return _image->fileName();
514
0
}
515
516
void Magick::DrawableCompositeImage::image( const Magick::Image &image_ )
517
0
{
518
0
  Image* temp_image = new Image(image_);
519
0
  delete _image;
520
0
  _image = temp_image;
521
0
}
522
Magick::Image Magick::DrawableCompositeImage::image( void ) const
523
0
{
524
0
  return *_image;
525
0
}
526
527
// Specify image format used to output Base64 inlined image data.
528
void Magick::DrawableCompositeImage::magick( std::string magick_ )
529
0
{
530
0
  _image->magick( magick_ );
531
0
}
532
std::string Magick::DrawableCompositeImage::magick( void )
533
0
{
534
0
  return _image->magick();
535
0
}
536
537
void Magick::DrawableCompositeImage::operator()
538
  ( MagickLib::DrawContext context_ ) const
539
0
{
540
0
  DrawComposite( context_, _composition, _x, _y, _width, _height,
541
0
                 _image->constImage() );
542
0
}
543
544
Magick::DrawableBase* Magick::DrawableCompositeImage::copy() const
545
0
{
546
0
  return new DrawableCompositeImage(*this);
547
0
}
548
549
// Ellipse
550
Magick::DrawableEllipse::~DrawableEllipse( void )
551
{
552
}
553
void Magick::DrawableEllipse::operator()
554
  ( MagickLib::DrawContext context_ ) const
555
0
{
556
0
  DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
557
0
               _arcStart, _arcEnd );
558
0
}
559
Magick::DrawableBase* Magick::DrawableEllipse::copy() const
560
0
{
561
0
  return new DrawableEllipse(*this);
562
0
}
563
564
// Specify drawing fill color
565
Magick::DrawableFillColor::DrawableFillColor( const Magick::Color &color_ )
566
0
  : _color(color_)
567
0
{
568
0
}
569
Magick::DrawableFillColor::DrawableFillColor
570
( const Magick::DrawableFillColor& original_ )
571
0
  : DrawableBase (original_),
572
0
    _color(original_._color)
573
0
{
574
0
}
575
Magick::DrawableFillColor::~DrawableFillColor( void )
576
0
{
577
0
}
578
void Magick::DrawableFillColor::operator()
579
  ( MagickLib::DrawContext context_ ) const
580
0
{
581
0
  PixelPacket color = static_cast<PixelPacket>(_color);
582
0
  DrawSetFillColor( context_, &color );
583
0
}
584
Magick::DrawableBase* Magick::DrawableFillColor::copy() const
585
0
{
586
0
  return new DrawableFillColor(*this);
587
0
}
588
589
// Specify drawing fill rule
590
Magick::DrawableFillRule::~DrawableFillRule ( void )
591
{
592
}
593
void Magick::DrawableFillRule::operator()
594
  ( MagickLib::DrawContext context_ ) const
595
0
{
596
0
  DrawSetFillRule( context_, _fillRule );
597
0
}
598
Magick::DrawableBase* Magick::DrawableFillRule::copy() const
599
0
{
600
0
  return new DrawableFillRule(*this);
601
0
}
602
603
// Specify drawing fill opacity
604
Magick::DrawableFillOpacity::~DrawableFillOpacity ( void )
605
{
606
}
607
void Magick::DrawableFillOpacity::operator()
608
  ( MagickLib::DrawContext context_ ) const
609
0
{
610
0
  DrawSetFillOpacity( context_, _opacity );
611
0
}
612
Magick::DrawableBase* Magick::DrawableFillOpacity::copy() const
613
0
{
614
0
  return new DrawableFillOpacity(*this);
615
0
}
616
617
// Specify text font
618
Magick::DrawableFont::DrawableFont ( const std::string &font_ )
619
0
  : _font(font_),
620
0
    _family(),
621
0
    _style(Magick::AnyStyle),
622
0
    _weight(400),
623
0
    _stretch(Magick::NormalStretch)
624
0
{
625
0
}
626
Magick::DrawableFont::DrawableFont ( const std::string &family_,
627
                                     Magick::StyleType style_,
628
                                     const unsigned long weight_,
629
                                     Magick::StretchType stretch_ )
630
0
  : _font(),
631
0
    _family(family_),
632
0
    _style(style_),
633
0
    _weight(weight_),
634
0
    _stretch(stretch_)
635
0
{
636
0
}
637
Magick::DrawableFont::DrawableFont ( const Magick::DrawableFont& original_ )
638
0
  : DrawableBase (original_),
639
0
    _font(original_._font),
640
0
    _family(original_._family),
641
0
    _style(original_._style),
642
0
    _weight(original_._weight),
643
0
    _stretch(original_._stretch)
644
0
{
645
0
}
646
Magick::DrawableFont::~DrawableFont ( void )
647
0
{
648
0
}
649
void Magick::DrawableFont::operator()( MagickLib::DrawContext context_ ) const
650
0
{
651
  // font
652
0
  if(_font.length())
653
0
    {
654
0
      DrawSetFont( context_, _font.c_str() );
655
0
    }
656
657
0
  if(_family.length())
658
0
    {
659
      // font-family
660
0
      DrawSetFontFamily( context_, _family.c_str() );
661
662
      // font-style
663
0
      DrawSetFontStyle( context_, _style );
664
665
      // font-weight
666
0
      DrawSetFontWeight( context_, _weight );
667
668
      // font-stretch
669
0
      DrawSetFontStretch( context_, _stretch );
670
0
    }
671
0
}
672
Magick::DrawableBase* Magick::DrawableFont::copy() const
673
0
{
674
0
  return new DrawableFont(*this);
675
0
}
676
677
// Specify text positioning gravity
678
Magick::DrawableGravity::~DrawableGravity ( void )
679
{
680
}
681
void Magick::DrawableGravity::operator()
682
  ( MagickLib::DrawContext context_ ) const
683
0
{
684
0
  DrawSetGravity( context_, _gravity );
685
0
}
686
Magick::DrawableBase* Magick::DrawableGravity::copy() const
687
0
{
688
0
  return new DrawableGravity(*this);
689
0
}
690
691
// Line
692
Magick::DrawableLine::~DrawableLine ( void )
693
{
694
}
695
void Magick::DrawableLine::operator()( MagickLib::DrawContext context_ ) const
696
0
{
697
0
  DrawLine( context_, _startX, _startY, _endX, _endY );
698
0
}
699
Magick::DrawableBase* Magick::DrawableLine::copy() const
700
0
{
701
0
  return new DrawableLine(*this);
702
0
}
703
704
// Change pixel matte value to transparent using PaintMethod
705
Magick::DrawableMatte::~DrawableMatte ( void )
706
{
707
}
708
void Magick::DrawableMatte::operator()( MagickLib::DrawContext context_ ) const
709
0
{
710
0
  DrawMatte( context_, _x, _y, _paintMethod );
711
0
}
712
Magick::DrawableBase* Magick::DrawableMatte::copy() const
713
0
{
714
0
  return new DrawableMatte(*this);
715
0
}
716
717
// Drawable Path
718
Magick::DrawablePath::DrawablePath ( const VPathList &path_ )
719
0
  : _path(path_)
720
0
{
721
0
}
722
Magick::DrawablePath::DrawablePath ( const Magick::DrawablePath& original_ )
723
0
  : DrawableBase (original_),
724
0
    _path(original_._path)
725
0
{
726
0
}
727
Magick::DrawablePath::~DrawablePath ( void )
728
0
{
729
0
}
730
void Magick::DrawablePath::operator()( MagickLib::DrawContext context_ ) const
731
0
{
732
0
  DrawPathStart( context_ );
733
734
0
  for( VPathList::const_iterator p = _path.begin();
735
0
       p != _path.end(); p++ )
736
0
    p->operator()( context_ ); // FIXME, how to quit loop on error?
737
738
0
  DrawPathFinish( context_ );
739
0
}
740
Magick::DrawableBase* Magick::DrawablePath::copy() const
741
0
{
742
0
  return new DrawablePath(*this);
743
0
}
744
745
// Point
746
Magick::DrawablePoint::~DrawablePoint ( void )
747
{
748
}
749
void Magick::DrawablePoint::operator()( MagickLib::DrawContext context_ ) const
750
0
{
751
0
  DrawPoint( context_, _x, _y );
752
0
}
753
Magick::DrawableBase* Magick::DrawablePoint::copy() const
754
0
{
755
0
  return new DrawablePoint(*this);
756
0
}
757
758
// Text pointsize
759
Magick::DrawablePointSize::~DrawablePointSize ( void )
760
{
761
}
762
void Magick::DrawablePointSize::operator()
763
  ( MagickLib::DrawContext context_ ) const
764
0
{
765
0
  DrawSetFontSize( context_, _pointSize );
766
0
}
767
Magick::DrawableBase* Magick::DrawablePointSize::copy() const
768
0
{
769
0
  return new DrawablePointSize(*this);
770
0
}
771
772
// Polygon (Coordinate list must contain at least three members)
773
Magick::DrawablePolygon::DrawablePolygon ( const CoordinateList &coordinates_ )
774
0
  : _coordinates(coordinates_)
775
0
{
776
0
}
777
Magick::DrawablePolygon::DrawablePolygon
778
( const Magick::DrawablePolygon& original_ )
779
0
  : DrawableBase (original_),
780
0
    _coordinates(original_._coordinates)
781
0
{
782
0
}
783
Magick::DrawablePolygon::~DrawablePolygon ( void )
784
0
{
785
0
}
786
void Magick::DrawablePolygon::operator()
787
  ( MagickLib::DrawContext context_ ) const
788
0
{
789
0
  size_t num_coords = _coordinates.size();
790
0
  PointInfo *coordinates = new PointInfo[num_coords];
791
792
0
  PointInfo *q = coordinates;
793
0
  CoordinateList::const_iterator p = _coordinates.begin();
794
795
0
  while( p != _coordinates.end() )
796
0
    {
797
0
      q->x = p->x();
798
0
      q->y = p->y();
799
0
      q++;
800
0
      p++;
801
0
    }
802
803
0
  DrawPolygon( context_, (unsigned long) num_coords, coordinates );
804
0
  delete [] coordinates;
805
0
}
806
Magick::DrawableBase* Magick::DrawablePolygon::copy() const
807
0
{
808
0
  return new DrawablePolygon(*this);
809
0
}
810
811
// Polyline (Coordinate list must contain at least three members)
812
Magick::DrawablePolyline::DrawablePolyline
813
( const CoordinateList &coordinates_ )
814
0
  : _coordinates(coordinates_)
815
0
{
816
0
}
817
Magick::DrawablePolyline::DrawablePolyline
818
( const Magick::DrawablePolyline& original_ )
819
0
  : DrawableBase (original_),
820
0
    _coordinates(original_._coordinates)
821
0
{
822
0
}
823
Magick::DrawablePolyline::~DrawablePolyline ( void )
824
0
{
825
0
}
826
void Magick::DrawablePolyline::operator()
827
  ( MagickLib::DrawContext context_ ) const
828
0
{
829
0
  size_t num_coords = _coordinates.size();
830
0
  PointInfo *coordinates = new PointInfo[num_coords];
831
832
0
  PointInfo *q = coordinates;
833
0
  CoordinateList::const_iterator p = _coordinates.begin();
834
835
0
  while( p != _coordinates.end() )
836
0
    {
837
0
      q->x = p->x();
838
0
      q->y = p->y();
839
0
      q++;
840
0
      p++;
841
0
    }
842
843
0
  DrawPolyline( context_, (unsigned long) num_coords, coordinates );
844
0
  delete [] coordinates;
845
0
}
846
Magick::DrawableBase* Magick::DrawablePolyline::copy() const
847
0
{
848
0
  return new DrawablePolyline(*this);
849
0
}
850
851
// Pop Graphic Context
852
Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext ( void )
853
{
854
}
855
void Magick::DrawablePopGraphicContext::operator()
856
  ( MagickLib::DrawContext context_ ) const
857
0
{
858
0
  DrawPopGraphicContext( context_ );
859
0
}
860
Magick::DrawableBase* Magick::DrawablePopGraphicContext::copy() const
861
0
{
862
0
  return new DrawablePopGraphicContext(*this);
863
0
}
864
865
// Push Graphic Context
866
Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext ( void )
867
{
868
}
869
void Magick::DrawablePushGraphicContext::operator()
870
  ( MagickLib::DrawContext context_ ) const
871
0
{
872
0
  DrawPushGraphicContext( context_ );
873
0
}
874
Magick::DrawableBase* Magick::DrawablePushGraphicContext::copy() const
875
0
{
876
0
  return new DrawablePushGraphicContext(*this);
877
0
}
878
879
// Pop (terminate) Pattern definition
880
Magick::DrawablePopPattern::~DrawablePopPattern ( void )
881
{
882
}
883
void Magick::DrawablePopPattern::operator()
884
  ( MagickLib::DrawContext context_ ) const
885
0
{
886
0
  DrawPopPattern( context_ );
887
0
}
888
Magick::DrawableBase* Magick::DrawablePopPattern::copy() const
889
0
{
890
0
  return new DrawablePopPattern(*this);
891
0
}
892
893
// Push Pattern definition
894
Magick::DrawablePushPattern::DrawablePushPattern
895
( const std::string &id_, long x_, long y_,
896
  long width_, long height_ )
897
0
  : _id(id_),
898
0
    _x(x_),
899
0
    _y(y_),
900
0
    _width(width_),
901
0
    _height(height_)
902
0
{
903
0
}
904
Magick::DrawablePushPattern::DrawablePushPattern
905
( const Magick::DrawablePushPattern& original_ )
906
0
  : DrawableBase (original_),
907
0
    _id(original_._id),
908
0
    _x(original_._x),
909
0
    _y(original_._y),
910
0
    _width(original_._width),
911
0
    _height(original_._height)
912
0
{
913
0
}
914
Magick::DrawablePushPattern::~DrawablePushPattern ( void )
915
0
{
916
0
}
917
void Magick::DrawablePushPattern::operator()
918
  ( MagickLib::DrawContext context_ ) const
919
0
{
920
0
  DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height );
921
0
}
922
Magick::DrawableBase* Magick::DrawablePushPattern::copy() const
923
0
{
924
0
  return new DrawablePushPattern(*this);
925
0
}
926
927
// Rectangle
928
Magick::DrawableRectangle::~DrawableRectangle ( void )
929
{
930
}
931
void Magick::DrawableRectangle::operator()
932
  ( MagickLib::DrawContext context_ ) const
933
0
{
934
0
  DrawRectangle( context_, _upperLeftX, _upperLeftY,
935
0
                 _lowerRightX, _lowerRightY );
936
0
}
937
Magick::DrawableBase* Magick::DrawableRectangle::copy() const
938
0
{
939
0
  return new DrawableRectangle(*this);
940
0
}
941
942
// Apply Rotation
943
Magick::DrawableRotation::~DrawableRotation ( void )
944
{
945
}
946
void Magick::DrawableRotation::operator()
947
  ( MagickLib::DrawContext context_ ) const
948
0
{
949
0
  DrawRotate( context_, _angle );
950
0
}
951
Magick::DrawableBase* Magick::DrawableRotation::copy() const
952
0
{
953
0
  return new DrawableRotation(*this);
954
0
}
955
956
// Round Rectangle
957
Magick::DrawableRoundRectangle::~DrawableRoundRectangle ( void )
958
{
959
}
960
void Magick::DrawableRoundRectangle::operator()
961
  ( MagickLib::DrawContext context_ ) const
962
0
{
963
0
  DrawRoundRectangle( context_, _centerX,_centerY, _width,_hight,
964
0
                      _cornerWidth, _cornerHeight);
965
0
}
966
Magick::DrawableBase* Magick::DrawableRoundRectangle::copy() const
967
0
{
968
0
  return new DrawableRoundRectangle(*this);
969
0
}
970
971
// Apply Scaling
972
Magick::DrawableScaling::~DrawableScaling ( void )
973
{
974
}
975
void Magick::DrawableScaling::operator()
976
  ( MagickLib::DrawContext context_ ) const
977
0
{
978
0
  DrawScale( context_, _x, _y );
979
0
}
980
Magick::DrawableBase* Magick::DrawableScaling::copy() const
981
0
{
982
0
  return new DrawableScaling(*this);
983
0
}
984
985
// Apply Skew in the X direction
986
Magick::DrawableSkewX::~DrawableSkewX ( void )
987
{
988
}
989
void Magick::DrawableSkewX::operator()
990
  ( MagickLib::DrawContext context_ ) const
991
0
{
992
0
  DrawSkewX( context_, _angle );
993
0
}
994
Magick::DrawableBase* Magick::DrawableSkewX::copy() const
995
0
{
996
0
  return new DrawableSkewX(*this);
997
0
}
998
999
// Apply Skew in the Y direction
1000
Magick::DrawableSkewY::~DrawableSkewY ( void )
1001
{
1002
}
1003
void Magick::DrawableSkewY::operator()( MagickLib::DrawContext context_ ) const
1004
0
{
1005
0
  DrawSkewY( context_, _angle );
1006
0
}
1007
Magick::DrawableBase* Magick::DrawableSkewY::copy() const
1008
0
{
1009
0
  return new DrawableSkewY(*this);
1010
0
}
1011
1012
// Stroke dasharray
1013
Magick::DrawableDashArray::DrawableDashArray( const double* dasharray_ )
1014
0
  : _size(0),
1015
0
    _dasharray(0)
1016
0
{
1017
0
  dasharray( dasharray_ );
1018
0
}
1019
// Deprecated, do not use for new code, and migrate existing code to
1020
// using double*
1021
Magick::DrawableDashArray::DrawableDashArray( const unsigned int* dasharray_ )
1022
0
  : _size(0),
1023
0
    _dasharray(0)
1024
0
{
1025
0
  dasharray( dasharray_ );
1026
0
}
1027
Magick::DrawableDashArray::DrawableDashArray
1028
(const Magick::DrawableDashArray& original_)
1029
0
  : DrawableBase (original_),
1030
0
    _size(original_._size),
1031
0
    _dasharray(new double[_size+1])
1032
0
{
1033
  // Copy elements
1034
0
  {
1035
0
    for (size_t i=0; i < _size; i++)
1036
0
      _dasharray[i]=original_._dasharray[i];
1037
0
    _dasharray[_size]=0.0;
1038
0
  }
1039
0
}
1040
Magick::DrawableDashArray::~DrawableDashArray( void )
1041
0
{
1042
0
  delete [] _dasharray;
1043
0
  _size = 0;
1044
0
  _dasharray = 0;
1045
0
}
1046
Magick::DrawableDashArray& Magick::DrawableDashArray::operator=
1047
(const Magick::DrawableDashArray &original_)
1048
0
{
1049
0
  if( this != &original_ )
1050
0
    {
1051
0
      delete [] _dasharray;
1052
0
      _size=original_._size;
1053
0
      _dasharray = new double[_size+1];
1054
      // Copy elements
1055
0
      {
1056
0
        for (size_t i=0; i < _size; i++)
1057
0
          _dasharray[i]=original_._dasharray[i];
1058
0
        _dasharray[_size]=0.0;
1059
0
      }
1060
0
    }
1061
0
  return *this;
1062
0
}
1063
// Invoke object
1064
void Magick::DrawableDashArray::operator()
1065
  ( MagickLib::DrawContext context_ ) const
1066
0
{
1067
0
  DrawSetStrokeDashArray( context_, (unsigned long) _size, _dasharray );
1068
0
}
1069
Magick::DrawableBase* Magick::DrawableDashArray::copy() const
1070
0
{
1071
0
  return new DrawableDashArray(*this);
1072
0
}
1073
void Magick::DrawableDashArray::dasharray ( const double* dasharray_ )
1074
0
{
1075
0
  delete [] _dasharray;
1076
0
  _size = 0;
1077
0
  _dasharray = 0;
1078
1079
0
  if(dasharray_)
1080
0
    {
1081
      // Count elements in dash array
1082
0
      size_t n = 0;
1083
0
      {
1084
0
        const double *p = dasharray_;
1085
0
        while(*p++ != 0.0)
1086
0
          n++;
1087
0
      }
1088
0
      _size = n;
1089
1090
      // Allocate elements
1091
0
      _dasharray=new double[_size+1];
1092
      // Copy elements
1093
0
      {
1094
0
        for (size_t i=0; i < _size; i++)
1095
0
          _dasharray[i]=dasharray_[i];
1096
0
        _dasharray[_size]=0.0;
1097
0
      }
1098
0
    }
1099
0
}
1100
// This method is deprecated.  Don't use for new code, and migrate existing
1101
// code to the const double* version.
1102
void Magick::DrawableDashArray::dasharray( const unsigned int* dasharray_ )
1103
0
{
1104
0
  if (_dasharray)
1105
0
      delete [] _dasharray;
1106
0
  _size = 0;
1107
0
  _dasharray = 0;
1108
1109
0
  if(dasharray_)
1110
0
    {
1111
      // Count elements in dash array
1112
0
      size_t n = 0;
1113
0
      {
1114
0
        const unsigned int *p = dasharray_;
1115
0
        while(*p++ != 0)
1116
0
          n++;
1117
0
      }
1118
0
      _size = n;
1119
1120
      // Allocate elements
1121
0
      _dasharray=new double[_size+1];
1122
      // Copy elements
1123
0
      {
1124
0
        for (size_t i=0; i < _size; i++)
1125
0
          _dasharray[i]=dasharray_[i];
1126
0
        _dasharray[_size]=0;
1127
0
      }
1128
0
    }
1129
0
}
1130
1131
// Stroke dashoffset
1132
Magick::DrawableDashOffset::~DrawableDashOffset ( void )
1133
{
1134
}
1135
void Magick::DrawableDashOffset::operator()
1136
  ( MagickLib::DrawContext context_ ) const
1137
0
{
1138
0
  DrawSetStrokeDashOffset( context_, _offset );
1139
0
}
1140
Magick::DrawableBase* Magick::DrawableDashOffset::copy() const
1141
0
{
1142
0
  return new DrawableDashOffset(*this);
1143
0
}
1144
1145
// Stroke linecap
1146
Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void )
1147
{
1148
}
1149
void Magick::DrawableStrokeLineCap::operator()
1150
  ( MagickLib::DrawContext context_ ) const
1151
0
{
1152
0
  DrawSetStrokeLineCap( context_, _linecap );
1153
0
}
1154
Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const
1155
0
{
1156
0
  return new DrawableStrokeLineCap(*this);
1157
0
}
1158
1159
// Stroke linejoin
1160
Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void )
1161
{
1162
}
1163
void Magick::DrawableStrokeLineJoin::operator()
1164
  ( MagickLib::DrawContext context_ ) const
1165
0
{
1166
0
  DrawSetStrokeLineJoin( context_, _linejoin );
1167
0
}
1168
Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const
1169
0
{
1170
0
  return new DrawableStrokeLineJoin(*this);
1171
0
}
1172
1173
// Stroke miterlimit
1174
Magick::DrawableMiterLimit::~DrawableMiterLimit ( void )
1175
{
1176
}
1177
void Magick::DrawableMiterLimit::operator()
1178
  ( MagickLib::DrawContext context_ ) const
1179
0
{
1180
0
  DrawSetStrokeMiterLimit( context_, _miterlimit );
1181
0
}
1182
Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const
1183
0
{
1184
0
  return new DrawableMiterLimit(*this);
1185
0
}
1186
1187
// Stroke antialias
1188
Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void )
1189
{
1190
}
1191
void Magick::DrawableStrokeAntialias::operator()
1192
( MagickLib::DrawContext context_ ) const
1193
0
{
1194
0
  DrawSetStrokeAntialias( context_, static_cast<int>(_flag) );
1195
0
}
1196
Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const
1197
0
{
1198
0
  return new DrawableStrokeAntialias(*this);
1199
0
}
1200
1201
// Stroke color
1202
Magick::DrawableStrokeColor::DrawableStrokeColor
1203
( const Magick::Color &color_ )
1204
0
  : _color(color_)
1205
0
{
1206
0
}
1207
Magick::DrawableStrokeColor::DrawableStrokeColor
1208
( const Magick::DrawableStrokeColor& original_ )
1209
0
  : DrawableBase (original_),
1210
0
    _color(original_._color)
1211
0
{
1212
0
}
1213
Magick::DrawableStrokeColor::~DrawableStrokeColor ( void )
1214
0
{
1215
0
}
1216
void Magick::DrawableStrokeColor::operator()
1217
  ( MagickLib::DrawContext context_ ) const
1218
0
{
1219
0
  PixelPacket color = static_cast<PixelPacket>(_color);
1220
0
  DrawSetStrokeColor( context_, &color );
1221
0
}
1222
Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const
1223
0
{
1224
0
  return new DrawableStrokeColor(*this);
1225
0
}
1226
1227
// Stroke opacity
1228
Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity ( void )
1229
{
1230
}
1231
void Magick::DrawableStrokeOpacity::operator()
1232
  ( MagickLib::DrawContext context_ ) const
1233
0
{
1234
0
  DrawSetStrokeOpacity( context_, _opacity );
1235
0
}
1236
Magick::DrawableBase* Magick::DrawableStrokeOpacity::copy() const
1237
0
{
1238
0
  return new DrawableStrokeOpacity(*this);
1239
0
}
1240
1241
// Stroke width
1242
Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void )
1243
{
1244
}
1245
void Magick::DrawableStrokeWidth::operator()
1246
  ( MagickLib::DrawContext context_ ) const
1247
0
{
1248
0
  DrawSetStrokeWidth( context_, _width );
1249
0
}
1250
Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const
1251
0
{
1252
0
  return new DrawableStrokeWidth(*this);
1253
0
}
1254
1255
// Draw text at point
1256
Magick::DrawableText::DrawableText ( const double x_, const double y_,
1257
                                     const std::string &text_ )
1258
0
  : _x(x_),
1259
0
    _y(y_),
1260
0
    _text(text_),
1261
0
    _encoding()
1262
0
{
1263
0
}
1264
Magick::DrawableText::DrawableText ( const double x_, const double y_,
1265
                                     const std::string &text_,  const std::string &encoding_)
1266
0
  : _x(x_),
1267
0
    _y(y_),
1268
0
    _text(text_),
1269
0
    _encoding(encoding_)
1270
0
{
1271
0
}
1272
Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ )
1273
0
  : DrawableBase (original_),
1274
0
    _x(original_._x),
1275
0
    _y(original_._y),
1276
0
    _text(original_._text),
1277
0
    _encoding(original_._encoding)
1278
0
{
1279
0
}
1280
Magick::DrawableText::~DrawableText ( void )
1281
0
{
1282
0
}
1283
void Magick::DrawableText::operator()
1284
  ( MagickLib::DrawContext context_ ) const
1285
0
{
1286
0
  DrawSetTextEncoding( context_, _encoding.c_str() );
1287
0
  DrawAnnotation( context_, _x, _y,
1288
0
                  reinterpret_cast<const unsigned char*>(_text.c_str()) );
1289
0
}
1290
Magick::DrawableBase* Magick::DrawableText::copy() const
1291
0
{
1292
0
  return new DrawableText(*this);
1293
0
}
1294
1295
// Text antialias
1296
Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ )
1297
0
  : _flag(flag_)
1298
0
{
1299
0
}
1300
Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ )
1301
0
  : DrawableBase (original_),
1302
0
    _flag(original_._flag)
1303
0
{
1304
0
}
1305
Magick::DrawableTextAntialias::~DrawableTextAntialias ( void )
1306
{
1307
}
1308
void Magick::DrawableTextAntialias::operator()
1309
  ( MagickLib::DrawContext context_ ) const
1310
0
{
1311
0
  DrawSetTextAntialias( context_, static_cast<int>(_flag) );
1312
0
}
1313
Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const
1314
0
{
1315
0
  return new DrawableTextAntialias(*this);
1316
0
}
1317
1318
// Decoration (text decoration)
1319
Magick::DrawableTextDecoration::DrawableTextDecoration
1320
  ( Magick::DecorationType decoration_ )
1321
0
    : _decoration(decoration_)
1322
0
{
1323
0
}
1324
Magick::DrawableTextDecoration::DrawableTextDecoration
1325
  ( const Magick::DrawableTextDecoration &original_ )
1326
0
    : DrawableBase (original_),
1327
0
      _decoration(original_._decoration)
1328
0
{
1329
0
}
1330
Magick::DrawableTextDecoration::~DrawableTextDecoration( void )
1331
{
1332
}
1333
void Magick::DrawableTextDecoration::operator()
1334
  ( MagickLib::DrawContext context_ ) const
1335
0
{
1336
0
  DrawSetTextDecoration( context_, _decoration );
1337
0
}
1338
Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const
1339
0
{
1340
0
  return new DrawableTextDecoration(*this);
1341
0
}
1342
1343
// Set text undercolor
1344
Magick::DrawableTextUnderColor::DrawableTextUnderColor
1345
( const Magick::Color &color_ )
1346
0
  : _color(color_)
1347
0
{
1348
0
}
1349
Magick::DrawableTextUnderColor::DrawableTextUnderColor
1350
( const Magick::DrawableTextUnderColor& original_ )
1351
0
  : DrawableBase (original_),
1352
0
    _color(original_._color)
1353
0
{
1354
0
}
1355
Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void )
1356
0
{
1357
0
}
1358
void Magick::DrawableTextUnderColor::operator()
1359
  ( MagickLib::DrawContext context_ ) const
1360
0
{
1361
0
  PixelPacket color = static_cast<PixelPacket>(_color);
1362
0
  DrawSetTextUnderColor( context_, &color );
1363
0
}
1364
Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const
1365
0
{
1366
0
  return new DrawableTextUnderColor(*this);
1367
0
}
1368
1369
// Apply Translation
1370
Magick::DrawableTranslation::~DrawableTranslation ( void )
1371
{
1372
}
1373
void Magick::DrawableTranslation::operator()
1374
  ( MagickLib::DrawContext context_ ) const
1375
0
{
1376
0
  DrawTranslate( context_, _x, _y );
1377
0
}
1378
Magick::DrawableBase* Magick::DrawableTranslation::copy() const
1379
0
{
1380
0
  return new DrawableTranslation(*this);
1381
0
}
1382
1383
// Set the size of the viewbox
1384
Magick::DrawableViewbox::~DrawableViewbox ( void )
1385
{
1386
}
1387
void Magick::DrawableViewbox::operator()
1388
  ( MagickLib::DrawContext context_ ) const
1389
0
{
1390
0
  DrawSetViewbox( context_, _x1, _y1, _x2, _y2 );
1391
0
}
1392
Magick::DrawableBase* Magick::DrawableViewbox::copy() const
1393
0
{
1394
0
  return new DrawableViewbox(*this);
1395
0
}
1396
1397
//
1398
// Path Classes
1399
//
1400
1401
//
1402
// PathArcArgs
1403
//
1404
MagickDLLDecl int Magick::operator == ( const Magick::PathArcArgs& /*left_*/,
1405
                                        const Magick::PathArcArgs& /*right_*/ )
1406
0
{
1407
0
  return ( 1 );
1408
0
}
1409
MagickDLLDecl int Magick::operator != ( const Magick::PathArcArgs& /*left_*/,
1410
                                        const Magick::PathArcArgs& /*right_*/ )
1411
0
{
1412
0
  return ( 0 );
1413
0
}
1414
MagickDLLDecl int Magick::operator > ( const Magick::PathArcArgs& /*left_*/,
1415
                                       const Magick::PathArcArgs& /*right_*/ )
1416
0
{
1417
0
  return ( 0 );
1418
0
}
1419
MagickDLLDecl int Magick::operator <  ( const Magick::PathArcArgs& /*left_*/,
1420
                                        const Magick::PathArcArgs& /*right_*/ )
1421
0
{
1422
0
  return  ( false );
1423
0
}
1424
MagickDLLDecl int Magick::operator >= ( const Magick::PathArcArgs& left_,
1425
                                        const Magick::PathArcArgs& right_ )
1426
0
{
1427
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
1428
0
}
1429
MagickDLLDecl int Magick::operator <= ( const Magick::PathArcArgs& left_,
1430
                                        const Magick::PathArcArgs& right_ )
1431
0
{
1432
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
1433
0
}
1434
// Default constructor
1435
Magick::PathArcArgs::PathArcArgs( void )
1436
0
  :  _radiusX(0),
1437
0
     _radiusY(0),
1438
0
     _xAxisRotation(0),
1439
0
     _largeArcFlag(false),
1440
0
     _sweepFlag(false),
1441
0
     _x(0),
1442
0
     _y(0)
1443
0
{
1444
0
}
1445
// Normal constructor
1446
Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_,
1447
                                  double xAxisRotation_, bool largeArcFlag_,
1448
                                  bool sweepFlag_, double x_, double y_ )
1449
0
  : _radiusX(radiusX_),
1450
0
    _radiusY(radiusY_),
1451
0
    _xAxisRotation(xAxisRotation_),
1452
0
    _largeArcFlag(largeArcFlag_),
1453
0
    _sweepFlag(sweepFlag_),
1454
0
    _x(x_),
1455
0
    _y(y_)
1456
0
{
1457
0
}
1458
// Copy constructor
1459
Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ )
1460
0
  :  _radiusX(original_._radiusX),
1461
0
     _radiusY(original_._radiusY),
1462
0
     _xAxisRotation(original_._xAxisRotation),
1463
0
     _largeArcFlag(original_._largeArcFlag),
1464
0
     _sweepFlag(original_._sweepFlag),
1465
0
     _x(original_._x),
1466
0
     _y(original_._y)
1467
0
{
1468
0
}
1469
// Destructor
1470
Magick::PathArcArgs::~PathArcArgs ( void )
1471
0
{
1472
0
}
1473
1474
// Path Arc
1475
Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ )
1476
0
  : _coordinates(1,coordinates_)
1477
0
{
1478
0
}
1479
Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ )
1480
0
  : _coordinates(coordinates_)
1481
0
{
1482
0
}
1483
Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ )
1484
0
  : VPathBase (original_),
1485
0
    _coordinates(original_._coordinates)
1486
0
{
1487
0
}
1488
Magick::PathArcAbs::~PathArcAbs ( void )
1489
0
{
1490
0
}
1491
void Magick::PathArcAbs::operator()( MagickLib::DrawContext context_ ) const
1492
0
{
1493
0
  for( PathArcArgsList::const_iterator p = _coordinates.begin();
1494
0
       p != _coordinates.end(); p++ )
1495
0
    {
1496
0
      DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1497
0
                                   p->xAxisRotation(), p->largeArcFlag(),
1498
0
                                   p->sweepFlag(), p->x(), p->y() );
1499
0
    }
1500
0
}
1501
Magick::VPathBase* Magick::PathArcAbs::copy() const
1502
0
{
1503
0
  return new PathArcAbs(*this);
1504
0
}
1505
1506
Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ )
1507
0
  : _coordinates(1,coordinates_)
1508
0
{
1509
0
}
1510
Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ )
1511
0
  : _coordinates(coordinates_)
1512
0
{
1513
0
}
1514
Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ )
1515
0
  : VPathBase (original_),
1516
0
    _coordinates(original_._coordinates)
1517
0
{
1518
0
}
1519
Magick::PathArcRel::~PathArcRel ( void )
1520
0
{
1521
0
}
1522
void Magick::PathArcRel::operator()( MagickLib::DrawContext context_ ) const
1523
0
{
1524
0
  for( PathArcArgsList::const_iterator p = _coordinates.begin();
1525
0
       p != _coordinates.end(); p++ )
1526
0
    {
1527
0
      DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1528
0
                                   p->xAxisRotation(), p->largeArcFlag(),
1529
0
                                   p->sweepFlag(), p->x(), p->y() );
1530
0
    }
1531
0
}
1532
Magick::VPathBase* Magick::PathArcRel::copy() const
1533
0
{
1534
0
  return new PathArcRel(*this);
1535
0
}
1536
1537
//
1538
// Path Closepath
1539
//
1540
Magick::PathClosePath::~PathClosePath ( void )
1541
{
1542
}
1543
void Magick::PathClosePath::operator()( MagickLib::DrawContext context_ ) const
1544
0
{
1545
0
  DrawPathClose( context_ );
1546
0
}
1547
Magick::VPathBase* Magick::PathClosePath::copy() const
1548
0
{
1549
0
  return new PathClosePath(*this);
1550
0
}
1551
1552
//
1553
// Path Curveto (Cubic Bezier)
1554
//
1555
MagickDLLDecl int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/,
1556
                                        const Magick::PathCurvetoArgs& /*right_*/ )
1557
0
{
1558
0
  return ( 1 );
1559
0
}
1560
MagickDLLDecl int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/,
1561
                                        const Magick::PathCurvetoArgs& /*right_*/ )
1562
0
{
1563
0
  return ( 0 );
1564
0
}
1565
MagickDLLDecl int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/,
1566
                                       const Magick::PathCurvetoArgs& /*right_*/ )
1567
0
{
1568
0
  return ( 0 );
1569
0
}
1570
MagickDLLDecl int Magick::operator <  ( const Magick::PathCurvetoArgs& /*left_*/,
1571
                                        const Magick::PathCurvetoArgs& /*right_*/ )
1572
0
{
1573
0
  return  ( false );
1574
0
}
1575
MagickDLLDecl int Magick::operator >= ( const Magick::PathCurvetoArgs& left_,
1576
                                        const Magick::PathCurvetoArgs& right_ )
1577
0
{
1578
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
1579
0
}
1580
MagickDLLDecl int Magick::operator <= ( const Magick::PathCurvetoArgs& left_,
1581
                                        const Magick::PathCurvetoArgs& right_ )
1582
0
{
1583
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
1584
0
}
1585
// Default constructor
1586
Magick::PathCurvetoArgs::PathCurvetoArgs( void )
1587
0
  : _x1(0),
1588
0
    _y1(0),
1589
0
    _x2(0),
1590
0
    _y2(0),
1591
0
    _x(0),
1592
0
    _y(0)
1593
0
{
1594
0
}
1595
// Normal constructor
1596
Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_,
1597
                                          double x2_, double y2_,
1598
                                          double x_, double y_ )
1599
0
  : _x1(x1_),
1600
0
    _y1(y1_),
1601
0
    _x2(x2_),
1602
0
    _y2(y2_),
1603
0
    _x(x_),
1604
0
    _y(y_)
1605
0
{
1606
0
}
1607
// Copy constructor
1608
Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ )
1609
0
  : _x1(original_._x1),
1610
0
    _y1(original_._y1),
1611
0
    _x2(original_._x2),
1612
0
    _y2(original_._y2),
1613
0
    _x(original_._x),
1614
0
    _y(original_._y)
1615
0
{
1616
0
}
1617
// Destructor
1618
Magick::PathCurvetoArgs::~PathCurvetoArgs ( void )
1619
0
{
1620
0
}
1621
1622
Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ )
1623
0
  : _args(1,args_)
1624
0
{
1625
0
}
1626
Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ )
1627
0
  : _args(args_)
1628
0
{
1629
0
}
1630
Magick::PathCurvetoAbs::PathCurvetoAbs
1631
 ( const Magick::PathCurvetoAbs& original_ )
1632
0
   : VPathBase (original_),
1633
0
     _args(original_._args)
1634
0
{
1635
0
}
1636
Magick::PathCurvetoAbs::~PathCurvetoAbs ( void )
1637
0
{
1638
0
}
1639
void Magick::PathCurvetoAbs::operator()
1640
  ( MagickLib::DrawContext context_ ) const
1641
0
{
1642
0
  for( PathCurveToArgsList::const_iterator p = _args.begin();
1643
0
       p != _args.end(); p++ )
1644
0
    {
1645
0
      DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1646
0
                               p->x(), p->y() );
1647
0
    }
1648
0
}
1649
Magick::VPathBase* Magick::PathCurvetoAbs::copy() const
1650
0
{
1651
0
  return new PathCurvetoAbs(*this);
1652
0
}
1653
Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ )
1654
0
  : _args(1,args_)
1655
0
{
1656
0
}
1657
Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ )
1658
0
  : _args(args_)
1659
0
{
1660
0
}
1661
Magick::PathCurvetoRel::PathCurvetoRel
1662
( const Magick::PathCurvetoRel& original_ )
1663
0
  : VPathBase (original_),
1664
0
    _args(original_._args)
1665
0
{
1666
0
}
1667
Magick::PathCurvetoRel::~PathCurvetoRel ( void )
1668
0
{
1669
0
}
1670
void Magick::PathCurvetoRel::operator()
1671
  ( MagickLib::DrawContext context_ ) const
1672
0
{
1673
0
  for( PathCurveToArgsList::const_iterator p = _args.begin();
1674
0
       p != _args.end(); p++ )
1675
0
    {
1676
0
      DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1677
0
                               p->x(), p->y() );
1678
0
    }
1679
0
}
1680
Magick::VPathBase* Magick::PathCurvetoRel::copy() const
1681
0
{
1682
0
  return new PathCurvetoRel(*this);
1683
0
}
1684
Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1685
( const Magick::Coordinate &coordinates_ )
1686
0
  : _coordinates(1,coordinates_)
1687
0
{
1688
0
}
1689
Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1690
( const CoordinateList &coordinates_ )
1691
0
  : _coordinates(coordinates_)
1692
0
{
1693
0
}
1694
Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1695
( const Magick::PathSmoothCurvetoAbs& original_ )
1696
0
  : VPathBase (original_),
1697
0
    _coordinates(original_._coordinates)
1698
0
{
1699
0
}
1700
Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void )
1701
0
{
1702
0
}
1703
void Magick::PathSmoothCurvetoAbs::operator()
1704
  ( MagickLib::DrawContext context_ ) const
1705
0
{
1706
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
1707
0
       p != _coordinates.end(); p++ )
1708
0
    {
1709
0
      double x2 = p->x();
1710
0
      double y2 = p->y();
1711
0
      p++;
1712
0
      if (p == _coordinates.end())
1713
0
        break;
1714
0
      DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
1715
0
    }
1716
0
}
1717
Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const
1718
0
{
1719
0
  return new PathSmoothCurvetoAbs(*this);
1720
0
}
1721
Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1722
( const Magick::Coordinate &coordinates_ )
1723
0
  : _coordinates(1,coordinates_)
1724
0
{
1725
0
}
1726
Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1727
( const CoordinateList &coordinates_ )
1728
0
  : _coordinates(coordinates_)
1729
0
{
1730
0
}
1731
Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1732
( const Magick::PathSmoothCurvetoRel& original_ )
1733
0
  : VPathBase (original_),
1734
0
    _coordinates(original_._coordinates)
1735
0
{
1736
0
}
1737
Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void )
1738
0
{
1739
0
}
1740
void Magick::PathSmoothCurvetoRel::operator()
1741
  ( MagickLib::DrawContext context_ ) const
1742
0
{
1743
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
1744
0
       p != _coordinates.end(); p++ )
1745
0
    {
1746
0
      double x2 = p->x();
1747
0
      double y2 = p->y();
1748
0
      p++;
1749
0
      if (p == _coordinates.end())
1750
0
        break;
1751
0
      DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
1752
0
    }
1753
0
}
1754
Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const
1755
0
{
1756
0
  return new PathSmoothCurvetoRel(*this);
1757
0
}
1758
1759
//
1760
// Quadratic Curveto (Quadratic Bezier)
1761
//
1762
MagickDLLDecl int Magick::operator ==
1763
( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1764
  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1765
0
{
1766
0
  return ( 1 );
1767
0
}
1768
MagickDLLDecl int Magick::operator !=
1769
( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1770
  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1771
0
{
1772
0
  return ( 0 );
1773
0
}
1774
MagickDLLDecl int Magick::operator >
1775
( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1776
  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1777
0
{
1778
0
  return ( 0 );
1779
0
}
1780
MagickDLLDecl int Magick::operator <
1781
( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1782
  const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1783
0
{
1784
0
  return  ( 0 );
1785
0
}
1786
MagickDLLDecl int Magick::operator >=
1787
( const Magick::PathQuadraticCurvetoArgs& left_,
1788
  const Magick::PathQuadraticCurvetoArgs& right_ )
1789
0
{
1790
0
  return ( ( left_ > right_ ) || ( left_ == right_ ) );
1791
0
}
1792
MagickDLLDecl int Magick::operator <=
1793
( const Magick::PathQuadraticCurvetoArgs& left_,
1794
  const Magick::PathQuadraticCurvetoArgs& right_ )
1795
0
{
1796
0
  return ( ( left_ < right_ ) || ( left_ == right_ ) );
1797
0
}
1798
// Default Constructor
1799
Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void )
1800
0
  : _x1(0),
1801
0
    _y1(0),
1802
0
    _x(0),
1803
0
    _y(0)
1804
0
{
1805
0
}
1806
// Normal Constructor
1807
Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_,
1808
                                                            double y1_,
1809
                                                            double x_,
1810
                                                            double y_ )
1811
0
  : _x1(x1_),
1812
0
    _y1(y1_),
1813
0
    _x(x_),
1814
0
    _y(y_)
1815
0
{
1816
0
}
1817
// Copy Constructor
1818
Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ )
1819
0
  : _x1(original_._x1),
1820
0
    _y1(original_._y1),
1821
0
    _x(original_._x),
1822
0
    _y(original_._y)
1823
0
{
1824
0
}
1825
// Destructor
1826
Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void )
1827
0
{
1828
0
}
1829
1830
Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1831
( const Magick::PathQuadraticCurvetoArgs &args_ )
1832
0
  : _args(1,args_)
1833
0
{
1834
0
}
1835
Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1836
( const PathQuadraticCurvetoArgsList &args_ )
1837
0
  : _args(args_)
1838
0
{
1839
0
}
1840
Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1841
( const Magick::PathQuadraticCurvetoAbs& original_ )
1842
0
  : VPathBase (original_),
1843
0
    _args(original_._args)
1844
0
{
1845
0
}
1846
Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void )
1847
0
{
1848
0
}
1849
void Magick::PathQuadraticCurvetoAbs::operator()
1850
  ( MagickLib::DrawContext context_ ) const
1851
0
{
1852
0
  for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1853
0
       p != _args.end(); p++ )
1854
0
    {
1855
0
      DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
1856
0
                                              p->x(), p->y() );
1857
0
    }
1858
0
}
1859
Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const
1860
0
{
1861
0
  return new PathQuadraticCurvetoAbs(*this);
1862
0
}
1863
Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1864
( const Magick::PathQuadraticCurvetoArgs &args_ )
1865
0
  : _args(1,args_)
1866
0
{
1867
0
}
1868
Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1869
( const PathQuadraticCurvetoArgsList &args_ )
1870
0
  : _args(args_)
1871
0
{
1872
0
}
1873
Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1874
( const Magick::PathQuadraticCurvetoRel& original_ )
1875
0
  : VPathBase (original_),
1876
0
    _args(original_._args)
1877
0
{
1878
0
}
1879
Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void )
1880
0
{
1881
0
}
1882
void Magick::PathQuadraticCurvetoRel::operator()
1883
  ( MagickLib::DrawContext context_ ) const
1884
0
{
1885
0
  for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1886
0
       p != _args.end(); p++ )
1887
0
    {
1888
0
      DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
1889
0
                                              p->x(), p->y() );
1890
0
    }
1891
0
}
1892
Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const
1893
0
{
1894
0
  return new PathQuadraticCurvetoRel(*this);
1895
0
}
1896
Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1897
( const Magick::Coordinate &coordinate_ )
1898
0
  : _coordinates(1,coordinate_)
1899
0
{
1900
0
}
1901
Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1902
( const CoordinateList &coordinates_ )
1903
0
  : _coordinates(coordinates_)
1904
0
{
1905
0
}
1906
Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1907
( const Magick::PathSmoothQuadraticCurvetoAbs& original_ )
1908
0
  : VPathBase (original_),
1909
0
    _coordinates(original_._coordinates)
1910
0
{
1911
0
}
1912
Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void )
1913
0
{
1914
0
}
1915
void Magick::PathSmoothQuadraticCurvetoAbs::operator()
1916
  ( MagickLib::DrawContext context_ ) const
1917
0
{
1918
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
1919
0
       p != _coordinates.end(); p++ )
1920
0
    {
1921
0
      DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
1922
0
    }
1923
0
}
1924
Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const
1925
0
{
1926
0
  return new PathSmoothQuadraticCurvetoAbs(*this);
1927
0
}
1928
Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1929
( const Magick::Coordinate &coordinate_ )
1930
0
  : _coordinates(1,coordinate_)
1931
0
{
1932
0
}
1933
Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1934
( const CoordinateList &coordinates_ )
1935
0
  : _coordinates(coordinates_)
1936
0
{
1937
0
}
1938
Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1939
( const PathSmoothQuadraticCurvetoRel& original_ )
1940
0
  : VPathBase (original_),
1941
0
    _coordinates(original_._coordinates)
1942
0
{
1943
0
}
1944
Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void )
1945
0
{
1946
0
}
1947
void Magick::PathSmoothQuadraticCurvetoRel::operator()
1948
  ( MagickLib::DrawContext context_ ) const
1949
0
{
1950
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
1951
0
       p != _coordinates.end(); p++ )
1952
0
    {
1953
0
      DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
1954
0
    }
1955
0
}
1956
Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const
1957
0
{
1958
0
  return new PathSmoothQuadraticCurvetoRel(*this);
1959
0
}
1960
1961
//
1962
// Path Lineto
1963
//
1964
Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_  )
1965
0
  : _coordinates(1,coordinate_)
1966
0
{
1967
0
}
1968
Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ )
1969
0
  : _coordinates(coordinates_)
1970
0
{
1971
0
}
1972
Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ )
1973
0
  : VPathBase (original_),
1974
0
    _coordinates(original_._coordinates)
1975
0
{
1976
0
}
1977
Magick::PathLinetoAbs::~PathLinetoAbs ( void )
1978
0
{
1979
0
}
1980
void Magick::PathLinetoAbs::operator()( MagickLib::DrawContext context_ ) const
1981
0
{
1982
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
1983
0
       p != _coordinates.end(); p++ )
1984
0
    {
1985
0
      DrawPathLineToAbsolute( context_, p->x(), p->y() );
1986
0
    }
1987
0
}
1988
Magick::VPathBase* Magick::PathLinetoAbs::copy() const
1989
0
{
1990
0
  return new PathLinetoAbs(*this);
1991
0
}
1992
Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_  )
1993
0
  : _coordinates(1,coordinate_)
1994
0
{
1995
0
}
1996
Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ )
1997
0
  : _coordinates(coordinates_)
1998
0
{
1999
0
}
2000
Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ )
2001
0
  : VPathBase (original_),
2002
0
    _coordinates(original_._coordinates)
2003
0
{
2004
0
}
2005
Magick::PathLinetoRel::~PathLinetoRel ( void )
2006
0
{
2007
0
}
2008
void Magick::PathLinetoRel::operator()( MagickLib::DrawContext context_ ) const
2009
0
{
2010
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
2011
0
       p != _coordinates.end(); p++ )
2012
0
    {
2013
0
      DrawPathLineToRelative( context_, p->x(), p->y() );
2014
0
    }
2015
0
}
2016
Magick::VPathBase* Magick::PathLinetoRel::copy() const
2017
0
{
2018
0
  return new PathLinetoRel(*this);
2019
0
}
2020
2021
//
2022
// Path Horizontal Lineto
2023
//
2024
2025
Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void )
2026
{
2027
}
2028
void Magick::PathLinetoHorizontalAbs::operator()
2029
  ( MagickLib::DrawContext context_ ) const
2030
0
{
2031
0
  DrawPathLineToHorizontalAbsolute( context_, _x );
2032
0
}
2033
Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const
2034
0
{
2035
0
  return new PathLinetoHorizontalAbs(*this);
2036
0
}
2037
Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void )
2038
{
2039
}
2040
void Magick::PathLinetoHorizontalRel::operator()
2041
  ( MagickLib::DrawContext context_ ) const
2042
0
{
2043
0
  DrawPathLineToHorizontalRelative( context_, _x );
2044
0
}
2045
Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const
2046
0
{
2047
0
  return new PathLinetoHorizontalRel(*this);
2048
0
}
2049
2050
//
2051
// Path Vertical Lineto
2052
//
2053
Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void )
2054
{
2055
}
2056
void Magick::PathLinetoVerticalAbs::operator()
2057
  ( MagickLib::DrawContext context_ ) const
2058
0
{
2059
0
  DrawPathLineToVerticalAbsolute( context_, _y );
2060
0
}
2061
Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const
2062
0
{
2063
0
  return new PathLinetoVerticalAbs(*this);
2064
0
}
2065
Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void )
2066
{
2067
}
2068
void Magick::PathLinetoVerticalRel::operator()
2069
  ( MagickLib::DrawContext context_ ) const
2070
0
{
2071
0
  DrawPathLineToVerticalRelative( context_, _y );
2072
0
}
2073
Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const
2074
0
{
2075
0
  return new PathLinetoVerticalRel(*this);
2076
0
}
2077
2078
//
2079
// Path Moveto
2080
//
2081
2082
Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ )
2083
0
  : _coordinates(1,coordinate_)
2084
0
{
2085
0
}
2086
Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ )
2087
0
  : _coordinates(coordinates_)
2088
0
{
2089
0
}
2090
Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ )
2091
0
  : VPathBase (original_),
2092
0
    _coordinates(original_._coordinates)
2093
0
{
2094
0
}
2095
Magick::PathMovetoAbs::~PathMovetoAbs ( void )
2096
0
{
2097
0
}
2098
void Magick::PathMovetoAbs::operator()( MagickLib::DrawContext context_ ) const
2099
0
{
2100
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
2101
0
       p != _coordinates.end(); p++ )
2102
0
    {
2103
0
      DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2104
0
    }
2105
0
}
2106
Magick::VPathBase* Magick::PathMovetoAbs::copy() const
2107
0
{
2108
0
  return new PathMovetoAbs(*this);
2109
0
}
2110
Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ )
2111
0
  : _coordinates(1,coordinate_)
2112
0
{
2113
0
}
2114
Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ )
2115
0
  : _coordinates(coordinates_)
2116
0
{
2117
0
}
2118
Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ )
2119
0
  : VPathBase (original_),
2120
0
    _coordinates(original_._coordinates)
2121
0
{
2122
0
}
2123
Magick::PathMovetoRel::~PathMovetoRel ( void )
2124
0
{
2125
0
}
2126
void Magick::PathMovetoRel::operator()( MagickLib::DrawContext context_ ) const
2127
0
{
2128
0
  for( CoordinateList::const_iterator p = _coordinates.begin();
2129
0
       p != _coordinates.end(); p++ )
2130
0
    {
2131
0
      DrawPathMoveToRelative( context_, p->x(), p->y() );
2132
0
    }
2133
0
}
2134
Magick::VPathBase* Magick::PathMovetoRel::copy() const
2135
0
{
2136
0
  return new PathMovetoRel(*this);
2137
0
}
2138
2139
#if defined(EXPLICIT_TEMPLATE_INSTANTIATION)
2140
// template class std::list<Magick::Coordinate>;
2141
// template class std::list<const Magick::Drawable>;
2142
// template class std::list<const Magick::PathArcArgs>;
2143
// template class std::list<const Magick::PathCurvetoArgs>;
2144
// template class std::list<const Magick::PathQuadraticCurvetoArgs>;
2145
// template class std::list<const Magick::VPath>;
2146
#endif