1 // This may look like C code, but it is really -*- C++ -*-
3 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
5 // Implementation of Drawable (Graphic objects)
8 #define MAGICKCORE_IMPLEMENTATION 1
9 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
10 #define MAGICK_DRAWABLE_IMPLEMENTATION
12 #include "Magick++/Include.h"
16 #include "Magick++/Drawable.h"
17 #include "Magick++/Image.h"
21 MagickPPExport int Magick::operator == ( const Magick::Coordinate& left_,
22 const Magick::Coordinate& right_ )
24 return ( ( left_.x() == right_.x() ) && ( left_.y() == right_.y() ) );
26 MagickPPExport int Magick::operator != ( const Magick::Coordinate& left_,
27 const Magick::Coordinate& right_ )
29 return ( ! (left_ == right_) );
31 MagickPPExport int Magick::operator > ( const Magick::Coordinate& left_,
32 const Magick::Coordinate& right_ )
34 return ( !( left_ < right_ ) && ( left_ != right_ ) );
36 MagickPPExport int Magick::operator < ( const Magick::Coordinate& left_,
37 const Magick::Coordinate& right_ )
39 // Based on distance from origin
40 return ( (sqrt(left_.x()*left_.x() + left_.y()*left_.y())) <
41 (sqrt(right_.x()*right_.x() + right_.y()*right_.y())) );
43 MagickPPExport int Magick::operator >= ( const Magick::Coordinate& left_,
44 const Magick::Coordinate& right_ )
46 return ( ( left_ > right_ ) || ( left_ == right_ ) );
48 MagickPPExport int Magick::operator <= ( const Magick::Coordinate& left_,
49 const Magick::Coordinate& right_ )
51 return ( ( left_ < right_ ) || ( left_ == right_ ) );
55 Magick::DrawableBase::~DrawableBase ( void )
60 Magick::Drawable::Drawable ( void )
65 // Construct from DrawableBase
66 Magick::Drawable::Drawable ( const Magick::DrawableBase& original_ )
67 : dp(original_.copy())
72 Magick::Drawable::~Drawable ( void )
79 Magick::Drawable::Drawable ( const Magick::Drawable& original_ )
80 : dp(original_.dp? original_.dp->copy(): 0)
84 // Assignment operator
85 Magick::Drawable& Magick::Drawable::operator= (const Magick::Drawable& original_ )
87 if (this != &original_)
89 DrawableBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
96 // Operator to invoke contained object
97 void Magick::Drawable::operator()( MagickCore::DrawingWand * context_ ) const
100 dp->operator()( context_ );
103 MagickPPExport int Magick::operator == ( const Magick::Drawable& /*left_*/,
104 const Magick::Drawable& /*right_*/ )
108 MagickPPExport int Magick::operator != ( const Magick::Drawable& /*left_*/,
109 const Magick::Drawable& /*right_*/ )
113 MagickPPExport int Magick::operator > ( const Magick::Drawable& /*left_*/,
114 const Magick::Drawable& /*right_*/ )
118 MagickPPExport int Magick::operator < ( const Magick::Drawable& /*left_*/,
119 const Magick::Drawable& /*right_*/ )
123 MagickPPExport int Magick::operator >= ( const Magick::Drawable& left_,
124 const Magick::Drawable& right_ )
126 return ( ( left_ > right_ ) || ( left_ == right_ ) );
128 MagickPPExport int Magick::operator <= ( const Magick::Drawable& left_,
129 const Magick::Drawable& right_ )
131 return ( ( left_ < right_ ) || ( left_ == right_ ) );
135 Magick::VPathBase::~VPathBase ( void )
140 Magick::VPath::VPath ( void )
145 // Construct from VPathBase
146 Magick::VPath::VPath ( const Magick::VPathBase& original_ )
147 : dp(original_.copy())
152 /* virtual */ Magick::VPath::~VPath ( void )
159 Magick::VPath::VPath ( const Magick::VPath& original_ )
160 : dp(original_.dp? original_.dp->copy(): 0)
164 // Assignment operator
165 Magick::VPath& Magick::VPath::operator= (const Magick::VPath& original_ )
167 if (this != &original_)
169 VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
176 // Operator to invoke contained object
177 void Magick::VPath::operator()( MagickCore::DrawingWand * context_ ) const
180 dp->operator()( context_ );
183 MagickPPExport int Magick::operator == ( const Magick::VPath& /*left_*/,
184 const Magick::VPath& /*right_*/ )
188 MagickPPExport int Magick::operator != ( const Magick::VPath& /*left_*/,
189 const Magick::VPath& /*right_*/ )
193 MagickPPExport int Magick::operator > ( const Magick::VPath& /*left_*/,
194 const Magick::VPath& /*right_*/ )
198 MagickPPExport int Magick::operator < ( const Magick::VPath& /*left_*/,
199 const Magick::VPath& /*right_*/ )
203 MagickPPExport int Magick::operator >= ( const Magick::VPath& left_,
204 const Magick::VPath& right_ )
206 return ( ( left_ > right_ ) || ( left_ == right_ ) );
208 MagickPPExport int Magick::operator <= ( const Magick::VPath& left_,
209 const Magick::VPath& right_ )
211 return ( ( left_ < right_ ) || ( left_ == right_ ) );
218 // Affine (scaling, rotation, and translation)
219 Magick::DrawableAffine::DrawableAffine( double sx_, double sy_,
220 double rx_, double ry_,
221 double tx_, double ty_ )
230 Magick::DrawableAffine::DrawableAffine( void )
232 GetAffineMatrix(&_affine);
234 Magick::DrawableAffine::~DrawableAffine( void )
237 void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ ) const
239 DrawAffine( context_, &_affine );
241 Magick::DrawableBase* Magick::DrawableAffine::copy() const
243 return new DrawableAffine(*this);
247 Magick::DrawableArc::~DrawableArc( void )
250 void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ ) const
252 DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
254 Magick::DrawableBase* Magick::DrawableArc::copy() const
256 return new DrawableArc(*this);
262 // Construct from coordinates (Coordinate list must contain at least three members)
263 Magick::DrawableBezier::DrawableBezier ( const CoordinateList &coordinates_ )
264 : _coordinates(coordinates_)
268 Magick::DrawableBezier::DrawableBezier( const Magick::DrawableBezier& original_ )
269 : DrawableBase (original_),
270 _coordinates(original_._coordinates)
274 Magick::DrawableBezier::~DrawableBezier( void )
277 void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ ) const
279 size_t num_coords = (size_t) _coordinates.size();
280 PointInfo *coordinates = new PointInfo[num_coords];
282 PointInfo *q = coordinates;
283 CoordinateList::const_iterator p = _coordinates.begin();
285 while( p != _coordinates.end() )
293 DrawBezier( context_, num_coords, coordinates );
294 delete [] coordinates;
296 Magick::DrawableBase* Magick::DrawableBezier::copy() const
298 return new DrawableBezier(*this);
305 // Pop (terminate) Clip path definition
306 Magick::DrawablePopClipPath::~DrawablePopClipPath ( void )
309 void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ ) const
311 DrawPopClipPath( context_ );
312 DrawPopDefs(context_);
314 Magick::DrawableBase* Magick::DrawablePopClipPath::copy() const
316 return new DrawablePopClipPath(*this);
319 // Push clip path definition
320 Magick::DrawablePushClipPath::DrawablePushClipPath( const std::string &id_)
321 : _id(id_.c_str()) //multithread safe const char*
324 Magick::DrawablePushClipPath::DrawablePushClipPath
325 ( const Magick::DrawablePushClipPath& original_ ) //multithread safe const char*
326 : DrawableBase (original_),
327 _id(original_._id.c_str())
330 Magick::DrawablePushClipPath::~DrawablePushClipPath( void )
333 void Magick::DrawablePushClipPath::operator()
334 ( MagickCore::DrawingWand * context_ ) const
336 DrawPushDefs(context_);
337 DrawPushClipPath( context_, _id.c_str());
339 Magick::DrawableBase* Magick::DrawablePushClipPath::copy() const
341 return new DrawablePushClipPath(*this);
346 Magick::DrawableClipPath::DrawableClipPath( const std::string &id_ )
351 Magick::DrawableClipPath::DrawableClipPath ( const Magick::DrawableClipPath& original_ )
352 : DrawableBase (original_),
353 _id(original_._id.c_str())
356 Magick::DrawableClipPath::~DrawableClipPath( void )
359 void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ ) const
361 (void) DrawSetClipPath( context_, _id.c_str());
363 Magick::DrawableBase* Magick::DrawableClipPath::copy() const
365 return new DrawableClipPath(*this);
369 Magick::DrawableCircle::~DrawableCircle ( void )
372 void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ ) const
374 DrawCircle( context_, _originX, _originY, _perimX, _perimY );
376 Magick::DrawableBase* Magick::DrawableCircle::copy() const
378 return new DrawableCircle(*this);
381 // Colorize at point using PaintMethod
382 Magick::DrawableColor::~DrawableColor( void )
385 void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ ) const
387 DrawColor( context_, _x, _y, _paintMethod );
389 Magick::DrawableBase* Magick::DrawableColor::copy() const
391 return new DrawableColor(*this);
394 // Draw image at point
395 Magick::DrawableCompositeImage::DrawableCompositeImage
396 ( double x_, double y_,
397 double width_, double height_,
398 const std::string &filename_,
399 Magick::CompositeOperator composition_ )
400 : _composition(composition_),
405 _image(new Image(filename_))
408 Magick::DrawableCompositeImage::DrawableCompositeImage
409 ( double x_, double y_,
410 double width_, double height_,
411 const Magick::Image &image_,
412 Magick::CompositeOperator composition_ )
413 : _composition(composition_),
418 _image(new Image(image_))
421 Magick::DrawableCompositeImage::DrawableCompositeImage
422 ( double x_, double y_,
423 double width_, double height_,
424 const std::string &filename_ )
425 :_composition(CopyCompositeOp),
430 _image(new Image(filename_))
433 Magick::DrawableCompositeImage::DrawableCompositeImage
434 ( double x_, double y_,
435 double width_, double height_,
436 const Magick::Image &image_ )
437 :_composition(CopyCompositeOp),
442 _image(new Image(image_))
445 Magick::DrawableCompositeImage::DrawableCompositeImage
446 ( double x_, double y_,
447 const std::string &filename_ )
448 : _composition(CopyCompositeOp),
453 _image(new Image(filename_))
455 _width=_image->columns();
456 _height=_image->rows();
458 Magick::DrawableCompositeImage::DrawableCompositeImage
459 ( double x_, double y_,
460 const Magick::Image &image_ )
461 : _composition(CopyCompositeOp),
466 _image(new Image(image_))
468 _width=_image->columns();
469 _height=_image->rows();
472 Magick::DrawableCompositeImage::DrawableCompositeImage
473 ( const Magick::DrawableCompositeImage& original_ )
474 : Magick::DrawableBase(original_),
475 _composition(original_._composition),
478 _width(original_._width),
479 _height(original_._height),
480 _image(new Image(*original_._image))
483 Magick::DrawableCompositeImage::~DrawableCompositeImage( void )
487 // Assignment operator
488 Magick::DrawableCompositeImage& Magick::DrawableCompositeImage::operator=
489 (const Magick::DrawableCompositeImage& original_ )
491 // If not being set to ourself
492 if ( this != &original_ )
494 _composition = original_._composition;
497 _width = original_._width;
498 _height = original_._height;
499 Image* temp_image = new Image(*original_._image);
505 void Magick::DrawableCompositeImage::filename( const std::string &filename_ )
507 Image* temp_image = new Image(filename_);
511 std::string Magick::DrawableCompositeImage::filename( void ) const
513 return _image->fileName();
516 void Magick::DrawableCompositeImage::image( const Magick::Image &image_ )
518 Image* temp_image = new Image(image_);
522 Magick::Image Magick::DrawableCompositeImage::image( void ) const
527 // Specify image format used to output Base64 inlined image data.
528 void Magick::DrawableCompositeImage::magick( std::string magick_ )
530 _image->magick( magick_ );
532 std::string Magick::DrawableCompositeImage::magick( void )
534 return _image->magick();
537 void Magick::DrawableCompositeImage::operator()
538 ( MagickCore::DrawingWand * context_ ) const
543 magick_wand=NewMagickWandFromImage(_image->constImage());
544 (void) DrawComposite( context_, _composition, _x, _y, _width, _height,
546 magick_wand=DestroyMagickWand(magick_wand);
549 Magick::DrawableBase* Magick::DrawableCompositeImage::copy() const
551 return new DrawableCompositeImage(*this);
555 Magick::DrawableEllipse::~DrawableEllipse( void )
558 void Magick::DrawableEllipse::operator()
559 ( MagickCore::DrawingWand * context_ ) const
561 DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
562 _arcStart, _arcEnd );
564 Magick::DrawableBase* Magick::DrawableEllipse::copy() const
566 return new DrawableEllipse(*this);
569 // Specify drawing fill color
570 Magick::DrawableFillColor::DrawableFillColor( const Magick::Color &color_ )
574 Magick::DrawableFillColor::DrawableFillColor
575 ( const Magick::DrawableFillColor& original_ )
576 : DrawableBase (original_),
577 _color(original_._color)
580 Magick::DrawableFillColor::~DrawableFillColor( void )
583 void Magick::DrawableFillColor::operator()
584 ( MagickCore::DrawingWand * context_ ) const
586 PixelInfo color = static_cast<PixelInfo>(_color);
587 PixelWand *pixel_wand=NewPixelWand();
588 PixelSetPixelColor(pixel_wand,&color);
589 DrawSetFillColor(context_,pixel_wand);
590 pixel_wand=DestroyPixelWand(pixel_wand);
592 Magick::DrawableBase* Magick::DrawableFillColor::copy() const
594 return new DrawableFillColor(*this);
597 // Specify drawing fill fule
598 Magick::DrawableFillRule::~DrawableFillRule ( void )
601 void Magick::DrawableFillRule::operator()
602 ( MagickCore::DrawingWand * context_ ) const
604 DrawSetFillRule( context_, _fillRule );
606 Magick::DrawableBase* Magick::DrawableFillRule::copy() const
608 return new DrawableFillRule(*this);
611 // Specify drawing fill alpha
612 Magick::DrawableFillAlpha::~DrawableFillAlpha ( void )
615 void Magick::DrawableFillAlpha::operator()
616 ( MagickCore::DrawingWand * context_ ) const
618 DrawSetFillAlpha( context_, _alpha );
620 Magick::DrawableBase* Magick::DrawableFillAlpha::copy() const
622 return new DrawableFillAlpha(*this);
626 Magick::DrawableFont::DrawableFont ( const std::string &font_ )
629 _style(Magick::AnyStyle),
631 _stretch(Magick::NormalStretch)
634 Magick::DrawableFont::DrawableFont ( const std::string &family_,
635 Magick::StyleType style_,
636 const unsigned int weight_,
637 Magick::StretchType stretch_ )
645 Magick::DrawableFont::DrawableFont ( const Magick::DrawableFont& original_ )
646 : DrawableBase (original_),
647 _font(original_._font),
648 _family(original_._family),
649 _style(original_._style),
650 _weight(original_._weight),
651 _stretch(original_._stretch)
654 Magick::DrawableFont::~DrawableFont ( void )
657 void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ ) const
662 (void) DrawSetFont( context_, _font.c_str() );
668 (void) DrawSetFontFamily( context_, _family.c_str() );
671 DrawSetFontStyle( context_, _style );
674 DrawSetFontWeight( context_, _weight );
677 DrawSetFontStretch( context_, _stretch );
680 Magick::DrawableBase* Magick::DrawableFont::copy() const
682 return new DrawableFont(*this);
685 // Specify text positioning gravity
686 Magick::DrawableGravity::~DrawableGravity ( void )
689 void Magick::DrawableGravity::operator()
690 ( MagickCore::DrawingWand * context_ ) const
692 DrawSetGravity( context_, _gravity );
694 Magick::DrawableBase* Magick::DrawableGravity::copy() const
696 return new DrawableGravity(*this);
700 Magick::DrawableLine::~DrawableLine ( void )
703 void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ ) const
705 DrawLine( context_, _startX, _startY, _endX, _endY );
707 Magick::DrawableBase* Magick::DrawableLine::copy() const
709 return new DrawableLine(*this);
712 // Change pixel matte value to transparent using PaintMethod
713 Magick::DrawableMatte::~DrawableMatte ( void )
716 void Magick::DrawableMatte::operator()( MagickCore::DrawingWand * context_ ) const
718 DrawMatte( context_, _x, _y, _paintMethod );
720 Magick::DrawableBase* Magick::DrawableMatte::copy() const
722 return new DrawableMatte(*this);
726 Magick::DrawablePath::DrawablePath ( const VPathList &path_ )
730 Magick::DrawablePath::DrawablePath ( const Magick::DrawablePath& original_ )
731 : DrawableBase (original_),
732 _path(original_._path)
735 Magick::DrawablePath::~DrawablePath ( void )
738 void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ ) const
740 DrawPathStart( context_ );
742 for( VPathList::const_iterator p = _path.begin();
743 p != _path.end(); p++ )
744 p->operator()( context_ ); // FIXME, how to quit loop on error?
746 DrawPathFinish( context_ );
748 Magick::DrawableBase* Magick::DrawablePath::copy() const
750 return new DrawablePath(*this);
754 Magick::DrawablePoint::~DrawablePoint ( void )
757 void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ ) const
759 DrawPoint( context_, _x, _y );
761 Magick::DrawableBase* Magick::DrawablePoint::copy() const
763 return new DrawablePoint(*this);
767 Magick::DrawablePointSize::~DrawablePointSize ( void )
770 void Magick::DrawablePointSize::operator()
771 ( MagickCore::DrawingWand * context_ ) const
773 DrawSetFontSize( context_, _pointSize );
775 Magick::DrawableBase* Magick::DrawablePointSize::copy() const
777 return new DrawablePointSize(*this);
780 // Polygon (Coordinate list must contain at least three members)
781 Magick::DrawablePolygon::DrawablePolygon ( const CoordinateList &coordinates_ )
782 : _coordinates(coordinates_)
785 Magick::DrawablePolygon::DrawablePolygon
786 ( const Magick::DrawablePolygon& original_ )
787 : DrawableBase (original_),
788 _coordinates(original_._coordinates)
791 Magick::DrawablePolygon::~DrawablePolygon ( void )
794 void Magick::DrawablePolygon::operator()
795 ( MagickCore::DrawingWand * context_ ) const
797 size_t num_coords = (size_t) _coordinates.size();
798 PointInfo *coordinates = new PointInfo[num_coords];
800 PointInfo *q = coordinates;
801 CoordinateList::const_iterator p = _coordinates.begin();
803 while( p != _coordinates.end() )
811 DrawPolygon( context_, num_coords, coordinates );
812 delete [] coordinates;
814 Magick::DrawableBase* Magick::DrawablePolygon::copy() const
816 return new DrawablePolygon(*this);
819 // Polyline (Coordinate list must contain at least three members)
820 Magick::DrawablePolyline::DrawablePolyline
821 ( const CoordinateList &coordinates_ )
822 : _coordinates(coordinates_)
825 Magick::DrawablePolyline::DrawablePolyline
826 ( const Magick::DrawablePolyline& original_ )
827 : DrawableBase (original_),
828 _coordinates(original_._coordinates)
831 Magick::DrawablePolyline::~DrawablePolyline ( void )
834 void Magick::DrawablePolyline::operator()
835 ( MagickCore::DrawingWand * context_ ) const
837 size_t num_coords = (size_t) _coordinates.size();
838 PointInfo *coordinates = new PointInfo[num_coords];
840 PointInfo *q = coordinates;
841 CoordinateList::const_iterator p = _coordinates.begin();
843 while( p != _coordinates.end() )
851 DrawPolyline( context_, num_coords, coordinates );
852 delete [] coordinates;
854 Magick::DrawableBase* Magick::DrawablePolyline::copy() const
856 return new DrawablePolyline(*this);
859 // Pop Graphic Context
860 Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext ( void )
863 void Magick::DrawablePopGraphicContext::operator()
864 ( MagickCore::DrawingWand * context_ ) const
866 PopDrawingWand( context_ );
868 Magick::DrawableBase* Magick::DrawablePopGraphicContext::copy() const
870 return new DrawablePopGraphicContext(*this);
873 // Push Graphic Context
874 Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext ( void )
877 void Magick::DrawablePushGraphicContext::operator()
878 ( MagickCore::DrawingWand * context_ ) const
880 PushDrawingWand( context_ );
882 Magick::DrawableBase* Magick::DrawablePushGraphicContext::copy() const
884 return new DrawablePushGraphicContext(*this);
887 // Pop (terminate) Pattern definition
888 Magick::DrawablePopPattern::~DrawablePopPattern ( void )
891 void Magick::DrawablePopPattern::operator()
892 ( MagickCore::DrawingWand * context_ ) const
894 (void) DrawPopPattern( context_ );
896 Magick::DrawableBase* Magick::DrawablePopPattern::copy() const
898 return new DrawablePopPattern(*this);
901 // Push Pattern definition
902 Magick::DrawablePushPattern::DrawablePushPattern
903 ( const std::string &id_, ssize_t x_, ssize_t y_,
904 size_t width_, size_t height_ )
912 Magick::DrawablePushPattern::DrawablePushPattern
913 ( const Magick::DrawablePushPattern& original_ )
914 : DrawableBase (original_),
918 _width(original_._width),
919 _height(original_._height)
922 Magick::DrawablePushPattern::~DrawablePushPattern ( void )
925 void Magick::DrawablePushPattern::operator()
926 ( MagickCore::DrawingWand * context_ ) const
928 (void) DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height );
930 Magick::DrawableBase* Magick::DrawablePushPattern::copy() const
932 return new DrawablePushPattern(*this);
936 Magick::DrawableRectangle::~DrawableRectangle ( void )
939 void Magick::DrawableRectangle::operator()
940 ( MagickCore::DrawingWand * context_ ) const
942 DrawRectangle( context_, _upperLeftX, _upperLeftY,
943 _lowerRightX, _lowerRightY );
945 Magick::DrawableBase* Magick::DrawableRectangle::copy() const
947 return new DrawableRectangle(*this);
951 Magick::DrawableRotation::~DrawableRotation ( void )
954 void Magick::DrawableRotation::operator()
955 ( MagickCore::DrawingWand * context_ ) const
957 DrawRotate( context_, _angle );
959 Magick::DrawableBase* Magick::DrawableRotation::copy() const
961 return new DrawableRotation(*this);
965 Magick::DrawableRoundRectangle::~DrawableRoundRectangle ( void )
968 void Magick::DrawableRoundRectangle::operator()
969 ( MagickCore::DrawingWand * context_ ) const
971 DrawRoundRectangle( context_, _centerX,_centerY, _width,_hight,
972 _cornerWidth, _cornerHeight);
974 Magick::DrawableBase* Magick::DrawableRoundRectangle::copy() const
976 return new DrawableRoundRectangle(*this);
980 Magick::DrawableScaling::~DrawableScaling ( void )
983 void Magick::DrawableScaling::operator()
984 ( MagickCore::DrawingWand * context_ ) const
986 DrawScale( context_, _x, _y );
988 Magick::DrawableBase* Magick::DrawableScaling::copy() const
990 return new DrawableScaling(*this);
993 // Apply Skew in the X direction
994 Magick::DrawableSkewX::~DrawableSkewX ( void )
997 void Magick::DrawableSkewX::operator()
998 ( MagickCore::DrawingWand * context_ ) const
1000 DrawSkewX( context_, _angle );
1002 Magick::DrawableBase* Magick::DrawableSkewX::copy() const
1004 return new DrawableSkewX(*this);
1007 // Apply Skew in the Y direction
1008 Magick::DrawableSkewY::~DrawableSkewY ( void )
1011 void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ ) const
1013 DrawSkewY( context_, _angle );
1015 Magick::DrawableBase* Magick::DrawableSkewY::copy() const
1017 return new DrawableSkewY(*this);
1021 Magick::DrawableDashArray::DrawableDashArray( const double* dasharray_ )
1025 dasharray( dasharray_ );
1027 // Deprecated, do not use for new code, and migrate existing code to
1029 Magick::DrawableDashArray::DrawableDashArray( const size_t* dasharray_ )
1033 dasharray( dasharray_ );
1035 Magick::DrawableDashArray::DrawableDashArray
1036 (const Magick::DrawableDashArray& original_)
1037 : DrawableBase (original_),
1041 dasharray( original_._dasharray );
1043 Magick::DrawableDashArray::~DrawableDashArray( void )
1045 delete [] _dasharray;
1049 Magick::DrawableDashArray& Magick::DrawableDashArray::operator=
1050 (const Magick::DrawableDashArray &original_)
1052 if( this != &original_ )
1054 dasharray( original_._dasharray );
1058 void Magick::DrawableDashArray::operator()
1059 ( MagickCore::DrawingWand * context_ ) const
1061 (void) DrawSetStrokeDashArray( context_, (size_t) _size, _dasharray );
1063 Magick::DrawableBase* Magick::DrawableDashArray::copy() const
1065 return new DrawableDashArray(*this);
1067 void Magick::DrawableDashArray::dasharray ( const double* dasharray_ )
1069 _dasharray=(double *) RelinquishMagickMemory(_dasharray);
1073 // Count elements in dash array
1076 const double *p = dasharray_;
1082 // Allocate elements
1083 _dasharray=static_cast<double*>(AcquireMagickMemory((n+1)*sizeof(double)));
1086 double *q = _dasharray;
1087 const double *p = dasharray_;
1094 // This method is deprecated. Don't use for new code, and migrate existing
1095 // code to the const double* version.
1096 void Magick::DrawableDashArray::dasharray( const size_t* dasharray_ )
1098 _dasharray=(double *) RelinquishMagickMemory(_dasharray);
1102 // Count elements in dash array
1105 const size_t *p = dasharray_;
1111 // Allocate elements
1112 _dasharray=static_cast<double*>(AcquireMagickMemory((n+1)*sizeof(double)));
1115 double *q = _dasharray;
1116 const size_t *p = dasharray_;
1118 *q++=static_cast<double>(*p++);
1124 // Stroke dashoffset
1125 Magick::DrawableDashOffset::~DrawableDashOffset ( void )
1128 void Magick::DrawableDashOffset::operator()
1129 ( MagickCore::DrawingWand * context_ ) const
1131 DrawSetStrokeDashOffset( context_, _offset );
1133 Magick::DrawableBase* Magick::DrawableDashOffset::copy() const
1135 return new DrawableDashOffset(*this);
1139 Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void )
1142 void Magick::DrawableStrokeLineCap::operator()
1143 ( MagickCore::DrawingWand * context_ ) const
1145 DrawSetStrokeLineCap( context_, _linecap );
1147 Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const
1149 return new DrawableStrokeLineCap(*this);
1153 Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void )
1156 void Magick::DrawableStrokeLineJoin::operator()
1157 ( MagickCore::DrawingWand * context_ ) const
1159 DrawSetStrokeLineJoin( context_, _linejoin );
1161 Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const
1163 return new DrawableStrokeLineJoin(*this);
1166 // Stroke miterlimit
1167 Magick::DrawableMiterLimit::~DrawableMiterLimit ( void )
1170 void Magick::DrawableMiterLimit::operator()
1171 ( MagickCore::DrawingWand * context_ ) const
1173 DrawSetStrokeMiterLimit( context_, _miterlimit );
1175 Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const
1177 return new DrawableMiterLimit(*this);
1181 Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void )
1184 void Magick::DrawableStrokeAntialias::operator()
1185 ( MagickCore::DrawingWand * context_ ) const
1187 DrawSetStrokeAntialias( context_, static_cast<MagickBooleanType>
1188 (_flag ? MagickTrue : MagickFalse) );
1190 Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const
1192 return new DrawableStrokeAntialias(*this);
1196 Magick::DrawableStrokeColor::DrawableStrokeColor
1197 ( const Magick::Color &color_ )
1201 Magick::DrawableStrokeColor::DrawableStrokeColor
1202 ( const Magick::DrawableStrokeColor& original_ )
1203 : DrawableBase (original_),
1204 _color(original_._color)
1207 Magick::DrawableStrokeColor::~DrawableStrokeColor ( void )
1210 void Magick::DrawableStrokeColor::operator()
1211 ( MagickCore::DrawingWand * context_ ) const
1213 PixelInfo color = static_cast<PixelInfo>(_color);
1214 PixelWand *pixel_wand=NewPixelWand();
1215 PixelSetPixelColor(pixel_wand,&color);
1216 DrawSetStrokeColor(context_,pixel_wand);
1217 pixel_wand=DestroyPixelWand(pixel_wand);
1219 Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const
1221 return new DrawableStrokeColor(*this);
1225 Magick::DrawableStrokeAlpha::~DrawableStrokeAlpha ( void )
1228 void Magick::DrawableStrokeAlpha::operator()
1229 ( MagickCore::DrawingWand * context_ ) const
1231 DrawSetStrokeAlpha( context_, _alpha );
1233 Magick::DrawableBase* Magick::DrawableStrokeAlpha::copy() const
1235 return new DrawableStrokeAlpha(*this);
1239 Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void )
1242 void Magick::DrawableStrokeWidth::operator()
1243 ( MagickCore::DrawingWand * context_ ) const
1245 DrawSetStrokeWidth( context_, _width );
1247 Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const
1249 return new DrawableStrokeWidth(*this);
1252 // Draw text at point
1253 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1254 const std::string &text_ )
1261 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1262 const std::string &text_, const std::string &encoding_)
1266 _encoding(encoding_)
1269 Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ )
1270 : DrawableBase (original_),
1273 _text(original_._text),
1274 _encoding(original_._encoding)
1277 Magick::DrawableText::~DrawableText ( void )
1280 void Magick::DrawableText::operator()
1281 ( MagickCore::DrawingWand * context_ ) const
1283 DrawSetTextEncoding( context_, _encoding.c_str() );
1284 DrawAnnotation( context_, _x, _y,
1285 reinterpret_cast<const unsigned char*>(_text.c_str()) );
1287 Magick::DrawableBase* Magick::DrawableText::copy() const
1289 return new DrawableText(*this);
1293 Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ )
1297 Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ )
1298 : DrawableBase (original_),
1299 _flag(original_._flag)
1302 Magick::DrawableTextAntialias::~DrawableTextAntialias ( void )
1305 void Magick::DrawableTextAntialias::operator()
1306 ( MagickCore::DrawingWand * context_ ) const
1308 DrawSetTextAntialias( context_, static_cast<MagickBooleanType>
1309 (_flag ? MagickTrue : MagickFalse) );
1311 Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const
1313 return new DrawableTextAntialias(*this);
1316 // Decoration (text decoration)
1317 Magick::DrawableTextDecoration::DrawableTextDecoration
1318 ( Magick::DecorationType decoration_ )
1319 : _decoration(decoration_)
1322 Magick::DrawableTextDecoration::DrawableTextDecoration
1323 ( const Magick::DrawableTextDecoration &original_ )
1324 : DrawableBase (original_),
1325 _decoration(original_._decoration)
1328 Magick::DrawableTextDecoration::~DrawableTextDecoration( void )
1331 void Magick::DrawableTextDecoration::operator()
1332 ( MagickCore::DrawingWand * context_ ) const
1334 DrawSetTextDecoration( context_, _decoration );
1336 Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const
1338 return new DrawableTextDecoration(*this);
1341 // Set text undercolor
1342 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1343 ( const Magick::Color &color_ )
1347 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1348 ( const Magick::DrawableTextUnderColor& original_ )
1349 : DrawableBase (original_),
1350 _color(original_._color)
1353 Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void )
1356 void Magick::DrawableTextUnderColor::operator()
1357 ( MagickCore::DrawingWand * context_ ) const
1359 PixelInfo color = static_cast<PixelInfo>(_color);
1360 PixelWand *pixel_wand=NewPixelWand();
1361 PixelSetPixelColor(pixel_wand,&color);
1362 DrawSetTextUnderColor(context_,pixel_wand);
1363 pixel_wand=DestroyPixelWand(pixel_wand);
1365 Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const
1367 return new DrawableTextUnderColor(*this);
1370 // Apply Translation
1371 Magick::DrawableTranslation::~DrawableTranslation ( void )
1374 void Magick::DrawableTranslation::operator()
1375 ( MagickCore::DrawingWand * context_ ) const
1377 DrawTranslate( context_, _x, _y );
1379 Magick::DrawableBase* Magick::DrawableTranslation::copy() const
1381 return new DrawableTranslation(*this);
1384 // Set the size of the viewbox
1385 Magick::DrawableViewbox::~DrawableViewbox ( void )
1388 void Magick::DrawableViewbox::operator()
1389 ( MagickCore::DrawingWand * context_ ) const
1391 DrawSetViewbox( context_, _x1, _y1, _x2, _y2 );
1393 Magick::DrawableBase* Magick::DrawableViewbox::copy() const
1395 return new DrawableViewbox(*this);
1405 MagickPPExport int Magick::operator == ( const Magick::PathArcArgs& /*left_*/,
1406 const Magick::PathArcArgs& /*right_*/ )
1410 MagickPPExport int Magick::operator != ( const Magick::PathArcArgs& /*left_*/,
1411 const Magick::PathArcArgs& /*right_*/ )
1415 MagickPPExport int Magick::operator > ( const Magick::PathArcArgs& /*left_*/,
1416 const Magick::PathArcArgs& /*right_*/ )
1420 MagickPPExport int Magick::operator < ( const Magick::PathArcArgs& /*left_*/,
1421 const Magick::PathArcArgs& /*right_*/ )
1425 MagickPPExport int Magick::operator >= ( const Magick::PathArcArgs& left_,
1426 const Magick::PathArcArgs& right_ )
1428 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1430 MagickPPExport int Magick::operator <= ( const Magick::PathArcArgs& left_,
1431 const Magick::PathArcArgs& right_ )
1433 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1435 // Default constructor
1436 Magick::PathArcArgs::PathArcArgs( void )
1440 _largeArcFlag(false),
1446 // Normal constructor
1447 Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_,
1448 double xAxisRotation_, bool largeArcFlag_,
1449 bool sweepFlag_, double x_, double y_ )
1450 : _radiusX(radiusX_),
1452 _xAxisRotation(xAxisRotation_),
1453 _largeArcFlag(largeArcFlag_),
1454 _sweepFlag(sweepFlag_),
1460 Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ )
1461 : _radiusX(original_._radiusX),
1462 _radiusY(original_._radiusY),
1463 _xAxisRotation(original_._xAxisRotation),
1464 _largeArcFlag(original_._largeArcFlag),
1465 _sweepFlag(original_._sweepFlag),
1471 Magick::PathArcArgs::~PathArcArgs ( void )
1476 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ )
1477 : _coordinates(1,coordinates_)
1480 Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ )
1481 : _coordinates(coordinates_)
1484 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ )
1485 : VPathBase (original_),
1486 _coordinates(original_._coordinates)
1489 Magick::PathArcAbs::~PathArcAbs ( void )
1492 void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ ) const
1494 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1495 p != _coordinates.end(); p++ )
1497 DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1498 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1499 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1502 Magick::VPathBase* Magick::PathArcAbs::copy() const
1504 return new PathArcAbs(*this);
1507 Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ )
1508 : _coordinates(1,coordinates_)
1511 Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ )
1512 : _coordinates(coordinates_)
1515 Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ )
1516 : VPathBase (original_),
1517 _coordinates(original_._coordinates)
1520 Magick::PathArcRel::~PathArcRel ( void )
1523 void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ ) const
1525 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1526 p != _coordinates.end(); p++ )
1528 DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1529 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1530 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1533 Magick::VPathBase* Magick::PathArcRel::copy() const
1535 return new PathArcRel(*this);
1541 Magick::PathClosePath::~PathClosePath ( void )
1544 void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ ) const
1546 DrawPathClose( context_ );
1548 Magick::VPathBase* Magick::PathClosePath::copy() const
1550 return new PathClosePath(*this);
1554 // Path Curveto (Cubic Bezier)
1556 MagickPPExport int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/,
1557 const Magick::PathCurvetoArgs& /*right_*/ )
1561 MagickPPExport int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/,
1562 const Magick::PathCurvetoArgs& /*right_*/ )
1566 MagickPPExport int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/,
1567 const Magick::PathCurvetoArgs& /*right_*/ )
1571 MagickPPExport int Magick::operator < ( const Magick::PathCurvetoArgs& /*left_*/,
1572 const Magick::PathCurvetoArgs& /*right_*/ )
1576 MagickPPExport int Magick::operator >= ( const Magick::PathCurvetoArgs& left_,
1577 const Magick::PathCurvetoArgs& right_ )
1579 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1581 MagickPPExport int Magick::operator <= ( const Magick::PathCurvetoArgs& left_,
1582 const Magick::PathCurvetoArgs& right_ )
1584 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1586 // Default constructor
1587 Magick::PathCurvetoArgs::PathCurvetoArgs( void )
1596 // Normal constructor
1597 Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_,
1598 double x2_, double y2_,
1599 double x_, double y_ )
1609 Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ )
1610 : _x1(original_._x1),
1619 Magick::PathCurvetoArgs::~PathCurvetoArgs ( void )
1623 Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ )
1627 Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ )
1631 Magick::PathCurvetoAbs::PathCurvetoAbs
1632 ( const Magick::PathCurvetoAbs& original_ )
1633 : VPathBase (original_),
1634 _args(original_._args)
1637 Magick::PathCurvetoAbs::~PathCurvetoAbs ( void )
1640 void Magick::PathCurvetoAbs::operator()
1641 ( MagickCore::DrawingWand * context_ ) const
1643 for( PathCurveToArgsList::const_iterator p = _args.begin();
1644 p != _args.end(); p++ )
1646 DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1650 Magick::VPathBase* Magick::PathCurvetoAbs::copy() const
1652 return new PathCurvetoAbs(*this);
1654 Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ )
1658 Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ )
1662 Magick::PathCurvetoRel::PathCurvetoRel
1663 ( const Magick::PathCurvetoRel& original_ )
1664 : VPathBase (original_),
1665 _args(original_._args)
1668 Magick::PathCurvetoRel::~PathCurvetoRel ( void )
1671 void Magick::PathCurvetoRel::operator()
1672 ( MagickCore::DrawingWand * context_ ) const
1674 for( PathCurveToArgsList::const_iterator p = _args.begin();
1675 p != _args.end(); p++ )
1677 DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1681 Magick::VPathBase* Magick::PathCurvetoRel::copy() const
1683 return new PathCurvetoRel(*this);
1685 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1686 ( const Magick::Coordinate &coordinates_ )
1687 : _coordinates(1,coordinates_)
1690 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1691 ( const CoordinateList &coordinates_ )
1692 : _coordinates(coordinates_)
1695 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1696 ( const Magick::PathSmoothCurvetoAbs& original_ )
1697 : VPathBase (original_),
1698 _coordinates(original_._coordinates)
1701 Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void )
1704 void Magick::PathSmoothCurvetoAbs::operator()
1705 ( MagickCore::DrawingWand * context_ ) const
1707 for( CoordinateList::const_iterator p = _coordinates.begin();
1708 p != _coordinates.end(); p++ )
1713 if(p != _coordinates.end() )
1714 DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
1717 Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const
1719 return new PathSmoothCurvetoAbs(*this);
1721 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1722 ( const Magick::Coordinate &coordinates_ )
1723 : _coordinates(1,coordinates_)
1726 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1727 ( const CoordinateList &coordinates_ )
1728 : _coordinates(coordinates_)
1731 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1732 ( const Magick::PathSmoothCurvetoRel& original_ )
1733 : VPathBase (original_),
1734 _coordinates(original_._coordinates)
1737 Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void )
1740 void Magick::PathSmoothCurvetoRel::operator()
1741 ( MagickCore::DrawingWand * context_ ) const
1743 for( CoordinateList::const_iterator p = _coordinates.begin();
1744 p != _coordinates.end(); p++ )
1749 if(p != _coordinates.end() )
1750 DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
1753 Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const
1755 return new PathSmoothCurvetoRel(*this);
1759 // Quadratic Curveto (Quadratic Bezier)
1761 MagickPPExport int Magick::operator ==
1762 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1763 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1767 MagickPPExport int Magick::operator !=
1768 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1769 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1773 MagickPPExport int Magick::operator >
1774 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1775 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1779 MagickPPExport int Magick::operator <
1780 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1781 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1785 MagickPPExport int Magick::operator >=
1786 ( const Magick::PathQuadraticCurvetoArgs& left_,
1787 const Magick::PathQuadraticCurvetoArgs& right_ )
1789 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1791 MagickPPExport int Magick::operator <=
1792 ( const Magick::PathQuadraticCurvetoArgs& left_,
1793 const Magick::PathQuadraticCurvetoArgs& right_ )
1795 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1797 // Default Constructor
1798 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void )
1805 // Normal Constructor
1806 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_,
1817 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ )
1818 : _x1(original_._x1),
1825 Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void )
1829 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1830 ( const Magick::PathQuadraticCurvetoArgs &args_ )
1834 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1835 ( const PathQuadraticCurvetoArgsList &args_ )
1839 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1840 ( const Magick::PathQuadraticCurvetoAbs& original_ )
1841 : VPathBase (original_),
1842 _args(original_._args)
1845 Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void )
1848 void Magick::PathQuadraticCurvetoAbs::operator()
1849 ( MagickCore::DrawingWand * context_ ) const
1851 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1852 p != _args.end(); p++ )
1854 DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
1858 Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const
1860 return new PathQuadraticCurvetoAbs(*this);
1862 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1863 ( const Magick::PathQuadraticCurvetoArgs &args_ )
1867 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1868 ( const PathQuadraticCurvetoArgsList &args_ )
1872 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1873 ( const Magick::PathQuadraticCurvetoRel& original_ )
1874 : VPathBase (original_),
1875 _args(original_._args)
1878 Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void )
1881 void Magick::PathQuadraticCurvetoRel::operator()
1882 ( MagickCore::DrawingWand * context_ ) const
1884 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1885 p != _args.end(); p++ )
1887 DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
1891 Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const
1893 return new PathQuadraticCurvetoRel(*this);
1895 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1896 ( const Magick::Coordinate &coordinate_ )
1897 : _coordinates(1,coordinate_)
1900 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1901 ( const CoordinateList &coordinates_ )
1902 : _coordinates(coordinates_)
1905 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
1906 ( const Magick::PathSmoothQuadraticCurvetoAbs& original_ )
1907 : VPathBase (original_),
1908 _coordinates(original_._coordinates)
1911 Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void )
1914 void Magick::PathSmoothQuadraticCurvetoAbs::operator()
1915 ( MagickCore::DrawingWand * context_ ) const
1917 for( CoordinateList::const_iterator p = _coordinates.begin();
1918 p != _coordinates.end(); p++ )
1920 DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
1923 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const
1925 return new PathSmoothQuadraticCurvetoAbs(*this);
1927 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1928 ( const Magick::Coordinate &coordinate_ )
1929 : _coordinates(1,coordinate_)
1932 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1933 ( const CoordinateList &coordinates_ )
1934 : _coordinates(coordinates_)
1937 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
1938 ( const PathSmoothQuadraticCurvetoRel& original_ )
1939 : VPathBase (original_),
1940 _coordinates(original_._coordinates)
1943 Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void )
1946 void Magick::PathSmoothQuadraticCurvetoRel::operator()
1947 ( MagickCore::DrawingWand * context_ ) const
1949 for( CoordinateList::const_iterator p = _coordinates.begin();
1950 p != _coordinates.end(); p++ )
1952 DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
1955 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const
1957 return new PathSmoothQuadraticCurvetoRel(*this);
1963 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_ )
1964 : _coordinates(1,coordinate_)
1967 Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ )
1968 : _coordinates(coordinates_)
1971 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ )
1972 : VPathBase (original_),
1973 _coordinates(original_._coordinates)
1976 Magick::PathLinetoAbs::~PathLinetoAbs ( void )
1979 void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
1981 for( CoordinateList::const_iterator p = _coordinates.begin();
1982 p != _coordinates.end(); p++ )
1984 DrawPathLineToAbsolute( context_, p->x(), p->y() );
1987 Magick::VPathBase* Magick::PathLinetoAbs::copy() const
1989 return new PathLinetoAbs(*this);
1991 Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_ )
1992 : _coordinates(1,coordinate_)
1995 Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ )
1996 : _coordinates(coordinates_)
1999 Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ )
2000 : VPathBase (original_),
2001 _coordinates(original_._coordinates)
2004 Magick::PathLinetoRel::~PathLinetoRel ( void )
2007 void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2009 for( CoordinateList::const_iterator p = _coordinates.begin();
2010 p != _coordinates.end(); p++ )
2012 DrawPathLineToRelative( context_, p->x(), p->y() );
2015 Magick::VPathBase* Magick::PathLinetoRel::copy() const
2017 return new PathLinetoRel(*this);
2021 // Path Horizontal Lineto
2024 Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void )
2027 void Magick::PathLinetoHorizontalAbs::operator()
2028 ( MagickCore::DrawingWand * context_ ) const
2030 DrawPathLineToHorizontalAbsolute( context_, _x );
2032 Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const
2034 return new PathLinetoHorizontalAbs(*this);
2036 Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void )
2039 void Magick::PathLinetoHorizontalRel::operator()
2040 ( MagickCore::DrawingWand * context_ ) const
2042 DrawPathLineToHorizontalRelative( context_, _x );
2044 Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const
2046 return new PathLinetoHorizontalRel(*this);
2050 // Path Vertical Lineto
2052 Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void )
2055 void Magick::PathLinetoVerticalAbs::operator()
2056 ( MagickCore::DrawingWand * context_ ) const
2058 DrawPathLineToVerticalAbsolute( context_, _y );
2060 Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const
2062 return new PathLinetoVerticalAbs(*this);
2064 Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void )
2067 void Magick::PathLinetoVerticalRel::operator()
2068 ( MagickCore::DrawingWand * context_ ) const
2070 DrawPathLineToVerticalRelative( context_, _y );
2072 Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const
2074 return new PathLinetoVerticalRel(*this);
2081 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ )
2082 : _coordinates(1,coordinate_)
2085 Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ )
2086 : _coordinates(coordinates_)
2089 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ )
2090 : VPathBase (original_),
2091 _coordinates(original_._coordinates)
2094 Magick::PathMovetoAbs::~PathMovetoAbs ( void )
2097 void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
2099 for( CoordinateList::const_iterator p = _coordinates.begin();
2100 p != _coordinates.end(); p++ )
2102 DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2105 Magick::VPathBase* Magick::PathMovetoAbs::copy() const
2107 return new PathMovetoAbs(*this);
2109 Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ )
2110 : _coordinates(1,coordinate_)
2113 Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ )
2114 : _coordinates(coordinates_)
2117 Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ )
2118 : VPathBase (original_),
2119 _coordinates(original_._coordinates)
2122 Magick::PathMovetoRel::~PathMovetoRel ( void )
2125 void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2127 for( CoordinateList::const_iterator p = _coordinates.begin();
2128 p != _coordinates.end(); p++ )
2130 DrawPathMoveToRelative( context_, p->x(), p->y() );
2133 Magick::VPathBase* Magick::PathMovetoRel::copy() const
2135 return new PathMovetoRel(*this);
2138 #if defined(EXPLICIT_TEMPLATE_INSTANTIATION)
2139 // template class std::list<Magick::Coordinate>;
2140 // template class std::list<const Magick::Drawable>;
2141 // template class std::list<const Magick::PathArcArgs>;
2142 // template class std::list<const Magick::PathCurvetoArgs>;
2143 // template class std::list<const Magick::PathQuadraticCurvetoArgs>;
2144 // template class std::list<const Magick::VPath>;