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