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