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);
1022 Magick::DrawableDashArray::DrawableDashArray( const double* dasharray_ )
1026 dasharray( dasharray_ );
1028 // Deprecated, do not use for new code, and migrate existing code to
1030 Magick::DrawableDashArray::DrawableDashArray( const size_t* dasharray_ )
1034 dasharray( dasharray_ );
1036 Magick::DrawableDashArray::DrawableDashArray
1037 (const Magick::DrawableDashArray& original_)
1038 : DrawableBase (original_),
1039 _size(original_._size),
1040 _dasharray(new double[_size+1])
1044 for (size_t i=0; i < _size; i++)
1045 _dasharray[i]=original_._dasharray[i];
1046 _dasharray[_size]=0.0;
1049 Magick::DrawableDashArray::~DrawableDashArray( void )
1051 delete [] _dasharray;
1055 Magick::DrawableDashArray& Magick::DrawableDashArray::operator=
1056 (const Magick::DrawableDashArray &original_)
1058 if( this != &original_ )
1060 delete [] _dasharray;
1061 _size=original_._size;
1062 _dasharray = new double[_size+1];
1065 for (size_t i=0; i < _size; i++)
1066 _dasharray[i]=original_._dasharray[i];
1067 _dasharray[_size]=0.0;
1073 void Magick::DrawableDashArray::operator()
1074 ( MagickCore::DrawingWand *context_ ) const
1076 (void) DrawSetStrokeDashArray( context_, (const unsigned long) _size, _dasharray );
1078 Magick::DrawableBase* Magick::DrawableDashArray::copy() const
1080 return new DrawableDashArray(*this);
1082 void Magick::DrawableDashArray::dasharray ( const double* dasharray_ )
1084 delete [] _dasharray;
1090 // Count elements in dash array
1093 const double *p = dasharray_;
1099 // Allocate elements
1100 _dasharray=new double[_size+1];
1103 for (size_t i=0; i < _size; i++)
1104 _dasharray[i]=dasharray_[i];
1105 _dasharray[_size]=0.0;
1109 // This method is deprecated. Don't use for new code, and migrate existing
1110 // code to the const double* version.
1111 void Magick::DrawableDashArray::dasharray( const size_t* dasharray_ )
1114 delete [] _dasharray;
1120 // Count elements in dash array
1123 const size_t *p = dasharray_;
1129 // Allocate elements
1130 _dasharray=new double[_size+1];
1133 for (size_t i=0; i < _size; i++)
1134 _dasharray[i]=dasharray_[i];
1135 _dasharray[_size]=0;
1140 // Stroke dashoffset
1141 Magick::DrawableDashOffset::~DrawableDashOffset ( void )
1144 void Magick::DrawableDashOffset::operator()
1145 ( MagickCore::DrawingWand * context_ ) const
1147 DrawSetStrokeDashOffset( context_, _offset );
1149 Magick::DrawableBase* Magick::DrawableDashOffset::copy() const
1151 return new DrawableDashOffset(*this);
1155 Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void )
1158 void Magick::DrawableStrokeLineCap::operator()
1159 ( MagickCore::DrawingWand * context_ ) const
1161 DrawSetStrokeLineCap( context_, _linecap );
1163 Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const
1165 return new DrawableStrokeLineCap(*this);
1169 Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void )
1172 void Magick::DrawableStrokeLineJoin::operator()
1173 ( MagickCore::DrawingWand * context_ ) const
1175 DrawSetStrokeLineJoin( context_, _linejoin );
1177 Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const
1179 return new DrawableStrokeLineJoin(*this);
1182 // Stroke miterlimit
1183 Magick::DrawableMiterLimit::~DrawableMiterLimit ( void )
1186 void Magick::DrawableMiterLimit::operator()
1187 ( MagickCore::DrawingWand * context_ ) const
1189 DrawSetStrokeMiterLimit( context_, _miterlimit );
1191 Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const
1193 return new DrawableMiterLimit(*this);
1197 Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void )
1200 void Magick::DrawableStrokeAntialias::operator()
1201 ( MagickCore::DrawingWand * context_ ) const
1203 DrawSetStrokeAntialias( context_, static_cast<MagickBooleanType>
1204 (_flag ? MagickTrue : MagickFalse) );
1206 Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const
1208 return new DrawableStrokeAntialias(*this);
1212 Magick::DrawableStrokeColor::DrawableStrokeColor
1213 ( const Magick::Color &color_ )
1217 Magick::DrawableStrokeColor::DrawableStrokeColor
1218 ( const Magick::DrawableStrokeColor& original_ )
1219 : DrawableBase (original_),
1220 _color(original_._color)
1223 Magick::DrawableStrokeColor::~DrawableStrokeColor ( void )
1226 void Magick::DrawableStrokeColor::operator()
1227 ( MagickCore::DrawingWand * context_ ) const
1229 PixelInfo color = static_cast<PixelInfo>(_color);
1230 PixelWand *pixel_wand=NewPixelWand();
1231 PixelSetPixelColor(pixel_wand,&color);
1232 DrawSetStrokeColor(context_,pixel_wand);
1233 pixel_wand=DestroyPixelWand(pixel_wand);
1235 Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const
1237 return new DrawableStrokeColor(*this);
1241 Magick::DrawableStrokeAlpha::~DrawableStrokeAlpha ( void )
1244 void Magick::DrawableStrokeAlpha::operator()
1245 ( MagickCore::DrawingWand * context_ ) const
1247 DrawSetStrokeAlpha( context_, _alpha );
1249 Magick::DrawableBase* Magick::DrawableStrokeAlpha::copy() const
1251 return new DrawableStrokeAlpha(*this);
1255 Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void )
1258 void Magick::DrawableStrokeWidth::operator()
1259 ( MagickCore::DrawingWand * context_ ) const
1261 DrawSetStrokeWidth( context_, _width );
1263 Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const
1265 return new DrawableStrokeWidth(*this);
1268 // Draw text at point
1269 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1270 const std::string &text_ )
1277 Magick::DrawableText::DrawableText ( const double x_, const double y_,
1278 const std::string &text_, const std::string &encoding_)
1282 _encoding(encoding_)
1285 Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ )
1286 : DrawableBase (original_),
1289 _text(original_._text),
1290 _encoding(original_._encoding)
1293 Magick::DrawableText::~DrawableText ( void )
1296 void Magick::DrawableText::operator()
1297 ( MagickCore::DrawingWand * context_ ) const
1299 DrawSetTextEncoding( context_, _encoding.c_str() );
1300 DrawAnnotation( context_, _x, _y,
1301 reinterpret_cast<const unsigned char*>(_text.c_str()) );
1303 Magick::DrawableBase* Magick::DrawableText::copy() const
1305 return new DrawableText(*this);
1309 Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ )
1313 Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ )
1314 : DrawableBase (original_),
1315 _flag(original_._flag)
1318 Magick::DrawableTextAntialias::~DrawableTextAntialias ( void )
1321 void Magick::DrawableTextAntialias::operator()
1322 ( MagickCore::DrawingWand * context_ ) const
1324 DrawSetTextAntialias( context_, static_cast<MagickBooleanType>
1325 (_flag ? MagickTrue : MagickFalse) );
1327 Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const
1329 return new DrawableTextAntialias(*this);
1332 // Decoration (text decoration)
1333 Magick::DrawableTextDecoration::DrawableTextDecoration
1334 ( Magick::DecorationType decoration_ )
1335 : _decoration(decoration_)
1338 Magick::DrawableTextDecoration::DrawableTextDecoration
1339 ( const Magick::DrawableTextDecoration &original_ )
1340 : DrawableBase (original_),
1341 _decoration(original_._decoration)
1344 Magick::DrawableTextDecoration::~DrawableTextDecoration( void )
1347 void Magick::DrawableTextDecoration::operator()
1348 ( MagickCore::DrawingWand * context_ ) const
1350 DrawSetTextDecoration( context_, _decoration );
1352 Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const
1354 return new DrawableTextDecoration(*this);
1357 // DrawableTextInterlineSpacing
1358 Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1360 : _spacing(spacing_)
1364 Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(void)
1368 void Magick::DrawableTextInterlineSpacing::operator()(
1369 MagickCore::DrawingWand *context_) const
1371 DrawSetTextInterlineSpacing(context_,_spacing);
1374 void Magick::DrawableTextInterlineSpacing::spacing(double spacing_)
1379 double Magick::DrawableTextInterlineSpacing::spacing(void) const
1384 Magick::DrawableBase *Magick::DrawableTextInterlineSpacing::copy() const
1386 return new DrawableTextInterlineSpacing(*this);
1389 // DrawableTextInterwordSpacing
1390 Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1392 : _spacing(spacing_)
1396 Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(void)
1400 void Magick::DrawableTextInterwordSpacing::operator()(
1401 MagickCore::DrawingWand *context_) const
1403 DrawSetTextInterwordSpacing(context_,_spacing);
1406 void Magick::DrawableTextInterwordSpacing::spacing(double spacing_)
1411 double Magick::DrawableTextInterwordSpacing::spacing(void) const
1416 Magick::DrawableBase *Magick::DrawableTextInterwordSpacing::copy() const
1418 return new DrawableTextInterwordSpacing(*this);
1421 // DrawableTextKerning
1422 Magick::DrawableTextKerning::DrawableTextKerning(
1424 : _kerning(kerning_)
1428 Magick::DrawableTextKerning::~DrawableTextKerning(void)
1432 void Magick::DrawableTextKerning::operator()(
1433 MagickCore::DrawingWand *context_) const
1435 DrawSetTextKerning(context_,_kerning);
1438 void Magick::DrawableTextKerning::kerning(double kerning_)
1443 double Magick::DrawableTextKerning::kerning(void) const
1448 Magick::DrawableBase *Magick::DrawableTextKerning::copy() const
1450 return new DrawableTextKerning(*this);
1453 // Set text undercolor
1454 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1455 ( const Magick::Color &color_ )
1459 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1460 ( const Magick::DrawableTextUnderColor& original_ )
1461 : DrawableBase (original_),
1462 _color(original_._color)
1465 Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void )
1468 void Magick::DrawableTextUnderColor::operator()
1469 ( MagickCore::DrawingWand * context_ ) const
1471 PixelInfo color = static_cast<PixelInfo>(_color);
1472 PixelWand *pixel_wand=NewPixelWand();
1473 PixelSetPixelColor(pixel_wand,&color);
1474 DrawSetTextUnderColor(context_,pixel_wand);
1475 pixel_wand=DestroyPixelWand(pixel_wand);
1477 Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const
1479 return new DrawableTextUnderColor(*this);
1482 // Apply Translation
1483 Magick::DrawableTranslation::~DrawableTranslation ( void )
1486 void Magick::DrawableTranslation::operator()
1487 ( MagickCore::DrawingWand * context_ ) const
1489 DrawTranslate( context_, _x, _y );
1491 Magick::DrawableBase* Magick::DrawableTranslation::copy() const
1493 return new DrawableTranslation(*this);
1496 // Set the size of the viewbox
1497 Magick::DrawableViewbox::~DrawableViewbox ( void )
1500 void Magick::DrawableViewbox::operator()
1501 ( MagickCore::DrawingWand * context_ ) const
1503 DrawSetViewbox( context_, _x1, _y1, _x2, _y2 );
1505 Magick::DrawableBase* Magick::DrawableViewbox::copy() const
1507 return new DrawableViewbox(*this);
1517 MagickPPExport int Magick::operator == ( const Magick::PathArcArgs& /*left_*/,
1518 const Magick::PathArcArgs& /*right_*/ )
1522 MagickPPExport int Magick::operator != ( const Magick::PathArcArgs& /*left_*/,
1523 const Magick::PathArcArgs& /*right_*/ )
1527 MagickPPExport int Magick::operator > ( const Magick::PathArcArgs& /*left_*/,
1528 const Magick::PathArcArgs& /*right_*/ )
1532 MagickPPExport int Magick::operator < ( const Magick::PathArcArgs& /*left_*/,
1533 const Magick::PathArcArgs& /*right_*/ )
1537 MagickPPExport int Magick::operator >= ( const Magick::PathArcArgs& left_,
1538 const Magick::PathArcArgs& right_ )
1540 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1542 MagickPPExport int Magick::operator <= ( const Magick::PathArcArgs& left_,
1543 const Magick::PathArcArgs& right_ )
1545 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1547 // Default constructor
1548 Magick::PathArcArgs::PathArcArgs( void )
1552 _largeArcFlag(false),
1558 // Normal constructor
1559 Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_,
1560 double xAxisRotation_, bool largeArcFlag_,
1561 bool sweepFlag_, double x_, double y_ )
1562 : _radiusX(radiusX_),
1564 _xAxisRotation(xAxisRotation_),
1565 _largeArcFlag(largeArcFlag_),
1566 _sweepFlag(sweepFlag_),
1572 Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ )
1573 : _radiusX(original_._radiusX),
1574 _radiusY(original_._radiusY),
1575 _xAxisRotation(original_._xAxisRotation),
1576 _largeArcFlag(original_._largeArcFlag),
1577 _sweepFlag(original_._sweepFlag),
1583 Magick::PathArcArgs::~PathArcArgs ( void )
1588 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ )
1589 : _coordinates(1,coordinates_)
1592 Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ )
1593 : _coordinates(coordinates_)
1596 Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ )
1597 : VPathBase (original_),
1598 _coordinates(original_._coordinates)
1601 Magick::PathArcAbs::~PathArcAbs ( void )
1604 void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ ) const
1606 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1607 p != _coordinates.end(); p++ )
1609 DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1610 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1611 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1614 Magick::VPathBase* Magick::PathArcAbs::copy() const
1616 return new PathArcAbs(*this);
1619 Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ )
1620 : _coordinates(1,coordinates_)
1623 Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ )
1624 : _coordinates(coordinates_)
1627 Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ )
1628 : VPathBase (original_),
1629 _coordinates(original_._coordinates)
1632 Magick::PathArcRel::~PathArcRel ( void )
1635 void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ ) const
1637 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1638 p != _coordinates.end(); p++ )
1640 DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1641 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1642 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1645 Magick::VPathBase* Magick::PathArcRel::copy() const
1647 return new PathArcRel(*this);
1653 Magick::PathClosePath::~PathClosePath ( void )
1656 void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ ) const
1658 DrawPathClose( context_ );
1660 Magick::VPathBase* Magick::PathClosePath::copy() const
1662 return new PathClosePath(*this);
1666 // Path Curveto (Cubic Bezier)
1668 MagickPPExport int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/,
1669 const Magick::PathCurvetoArgs& /*right_*/ )
1673 MagickPPExport int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/,
1674 const Magick::PathCurvetoArgs& /*right_*/ )
1678 MagickPPExport int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/,
1679 const Magick::PathCurvetoArgs& /*right_*/ )
1683 MagickPPExport int Magick::operator < ( const Magick::PathCurvetoArgs& /*left_*/,
1684 const Magick::PathCurvetoArgs& /*right_*/ )
1688 MagickPPExport int Magick::operator >= ( const Magick::PathCurvetoArgs& left_,
1689 const Magick::PathCurvetoArgs& right_ )
1691 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1693 MagickPPExport int Magick::operator <= ( const Magick::PathCurvetoArgs& left_,
1694 const Magick::PathCurvetoArgs& right_ )
1696 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1698 // Default constructor
1699 Magick::PathCurvetoArgs::PathCurvetoArgs( void )
1708 // Normal constructor
1709 Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_,
1710 double x2_, double y2_,
1711 double x_, double y_ )
1721 Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ )
1722 : _x1(original_._x1),
1731 Magick::PathCurvetoArgs::~PathCurvetoArgs ( void )
1735 Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ )
1739 Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ )
1743 Magick::PathCurvetoAbs::PathCurvetoAbs
1744 ( const Magick::PathCurvetoAbs& original_ )
1745 : VPathBase (original_),
1746 _args(original_._args)
1749 Magick::PathCurvetoAbs::~PathCurvetoAbs ( void )
1752 void Magick::PathCurvetoAbs::operator()
1753 ( MagickCore::DrawingWand * context_ ) const
1755 for( PathCurveToArgsList::const_iterator p = _args.begin();
1756 p != _args.end(); p++ )
1758 DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1762 Magick::VPathBase* Magick::PathCurvetoAbs::copy() const
1764 return new PathCurvetoAbs(*this);
1766 Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ )
1770 Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ )
1774 Magick::PathCurvetoRel::PathCurvetoRel
1775 ( const Magick::PathCurvetoRel& original_ )
1776 : VPathBase (original_),
1777 _args(original_._args)
1780 Magick::PathCurvetoRel::~PathCurvetoRel ( void )
1783 void Magick::PathCurvetoRel::operator()
1784 ( MagickCore::DrawingWand * context_ ) const
1786 for( PathCurveToArgsList::const_iterator p = _args.begin();
1787 p != _args.end(); p++ )
1789 DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
1793 Magick::VPathBase* Magick::PathCurvetoRel::copy() const
1795 return new PathCurvetoRel(*this);
1797 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1798 ( const Magick::Coordinate &coordinates_ )
1799 : _coordinates(1,coordinates_)
1802 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1803 ( const CoordinateList &coordinates_ )
1804 : _coordinates(coordinates_)
1807 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
1808 ( const Magick::PathSmoothCurvetoAbs& original_ )
1809 : VPathBase (original_),
1810 _coordinates(original_._coordinates)
1813 Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void )
1816 void Magick::PathSmoothCurvetoAbs::operator()
1817 ( MagickCore::DrawingWand * context_ ) const
1819 for( CoordinateList::const_iterator p = _coordinates.begin();
1820 p != _coordinates.end(); p++ )
1825 if(p != _coordinates.end() )
1826 DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
1829 Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const
1831 return new PathSmoothCurvetoAbs(*this);
1833 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1834 ( const Magick::Coordinate &coordinates_ )
1835 : _coordinates(1,coordinates_)
1838 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1839 ( const CoordinateList &coordinates_ )
1840 : _coordinates(coordinates_)
1843 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
1844 ( const Magick::PathSmoothCurvetoRel& original_ )
1845 : VPathBase (original_),
1846 _coordinates(original_._coordinates)
1849 Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void )
1852 void Magick::PathSmoothCurvetoRel::operator()
1853 ( MagickCore::DrawingWand * context_ ) const
1855 for( CoordinateList::const_iterator p = _coordinates.begin();
1856 p != _coordinates.end(); p++ )
1861 if(p != _coordinates.end() )
1862 DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
1865 Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const
1867 return new PathSmoothCurvetoRel(*this);
1871 // Quadratic Curveto (Quadratic Bezier)
1873 MagickPPExport int Magick::operator ==
1874 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1875 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1879 MagickPPExport int Magick::operator !=
1880 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1881 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1885 MagickPPExport int Magick::operator >
1886 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1887 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1891 MagickPPExport int Magick::operator <
1892 ( const Magick::PathQuadraticCurvetoArgs& /*left_*/,
1893 const Magick::PathQuadraticCurvetoArgs& /*right_*/ )
1897 MagickPPExport int Magick::operator >=
1898 ( const Magick::PathQuadraticCurvetoArgs& left_,
1899 const Magick::PathQuadraticCurvetoArgs& right_ )
1901 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1903 MagickPPExport int Magick::operator <=
1904 ( const Magick::PathQuadraticCurvetoArgs& left_,
1905 const Magick::PathQuadraticCurvetoArgs& right_ )
1907 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1909 // Default Constructor
1910 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void )
1917 // Normal Constructor
1918 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_,
1929 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ )
1930 : _x1(original_._x1),
1937 Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void )
1941 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1942 ( const Magick::PathQuadraticCurvetoArgs &args_ )
1946 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1947 ( const PathQuadraticCurvetoArgsList &args_ )
1951 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
1952 ( const Magick::PathQuadraticCurvetoAbs& original_ )
1953 : VPathBase (original_),
1954 _args(original_._args)
1957 Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void )
1960 void Magick::PathQuadraticCurvetoAbs::operator()
1961 ( MagickCore::DrawingWand * context_ ) const
1963 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1964 p != _args.end(); p++ )
1966 DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
1970 Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const
1972 return new PathQuadraticCurvetoAbs(*this);
1974 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1975 ( const Magick::PathQuadraticCurvetoArgs &args_ )
1979 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1980 ( const PathQuadraticCurvetoArgsList &args_ )
1984 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
1985 ( const Magick::PathQuadraticCurvetoRel& original_ )
1986 : VPathBase (original_),
1987 _args(original_._args)
1990 Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void )
1993 void Magick::PathQuadraticCurvetoRel::operator()
1994 ( MagickCore::DrawingWand * context_ ) const
1996 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
1997 p != _args.end(); p++ )
1999 DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
2003 Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const
2005 return new PathQuadraticCurvetoRel(*this);
2007 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2008 ( const Magick::Coordinate &coordinate_ )
2009 : _coordinates(1,coordinate_)
2012 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2013 ( const CoordinateList &coordinates_ )
2014 : _coordinates(coordinates_)
2017 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2018 ( const Magick::PathSmoothQuadraticCurvetoAbs& original_ )
2019 : VPathBase (original_),
2020 _coordinates(original_._coordinates)
2023 Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void )
2026 void Magick::PathSmoothQuadraticCurvetoAbs::operator()
2027 ( MagickCore::DrawingWand * context_ ) const
2029 for( CoordinateList::const_iterator p = _coordinates.begin();
2030 p != _coordinates.end(); p++ )
2032 DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
2035 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const
2037 return new PathSmoothQuadraticCurvetoAbs(*this);
2039 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2040 ( const Magick::Coordinate &coordinate_ )
2041 : _coordinates(1,coordinate_)
2044 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2045 ( const CoordinateList &coordinates_ )
2046 : _coordinates(coordinates_)
2049 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2050 ( const PathSmoothQuadraticCurvetoRel& original_ )
2051 : VPathBase (original_),
2052 _coordinates(original_._coordinates)
2055 Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void )
2058 void Magick::PathSmoothQuadraticCurvetoRel::operator()
2059 ( MagickCore::DrawingWand * context_ ) const
2061 for( CoordinateList::const_iterator p = _coordinates.begin();
2062 p != _coordinates.end(); p++ )
2064 DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
2067 Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const
2069 return new PathSmoothQuadraticCurvetoRel(*this);
2075 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_ )
2076 : _coordinates(1,coordinate_)
2079 Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ )
2080 : _coordinates(coordinates_)
2083 Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ )
2084 : VPathBase (original_),
2085 _coordinates(original_._coordinates)
2088 Magick::PathLinetoAbs::~PathLinetoAbs ( void )
2091 void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
2093 for( CoordinateList::const_iterator p = _coordinates.begin();
2094 p != _coordinates.end(); p++ )
2096 DrawPathLineToAbsolute( context_, p->x(), p->y() );
2099 Magick::VPathBase* Magick::PathLinetoAbs::copy() const
2101 return new PathLinetoAbs(*this);
2103 Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_ )
2104 : _coordinates(1,coordinate_)
2107 Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ )
2108 : _coordinates(coordinates_)
2111 Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ )
2112 : VPathBase (original_),
2113 _coordinates(original_._coordinates)
2116 Magick::PathLinetoRel::~PathLinetoRel ( void )
2119 void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2121 for( CoordinateList::const_iterator p = _coordinates.begin();
2122 p != _coordinates.end(); p++ )
2124 DrawPathLineToRelative( context_, p->x(), p->y() );
2127 Magick::VPathBase* Magick::PathLinetoRel::copy() const
2129 return new PathLinetoRel(*this);
2133 // Path Horizontal Lineto
2136 Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void )
2139 void Magick::PathLinetoHorizontalAbs::operator()
2140 ( MagickCore::DrawingWand * context_ ) const
2142 DrawPathLineToHorizontalAbsolute( context_, _x );
2144 Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const
2146 return new PathLinetoHorizontalAbs(*this);
2148 Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void )
2151 void Magick::PathLinetoHorizontalRel::operator()
2152 ( MagickCore::DrawingWand * context_ ) const
2154 DrawPathLineToHorizontalRelative( context_, _x );
2156 Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const
2158 return new PathLinetoHorizontalRel(*this);
2162 // Path Vertical Lineto
2164 Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void )
2167 void Magick::PathLinetoVerticalAbs::operator()
2168 ( MagickCore::DrawingWand * context_ ) const
2170 DrawPathLineToVerticalAbsolute( context_, _y );
2172 Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const
2174 return new PathLinetoVerticalAbs(*this);
2176 Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void )
2179 void Magick::PathLinetoVerticalRel::operator()
2180 ( MagickCore::DrawingWand * context_ ) const
2182 DrawPathLineToVerticalRelative( context_, _y );
2184 Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const
2186 return new PathLinetoVerticalRel(*this);
2193 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ )
2194 : _coordinates(1,coordinate_)
2197 Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ )
2198 : _coordinates(coordinates_)
2201 Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ )
2202 : VPathBase (original_),
2203 _coordinates(original_._coordinates)
2206 Magick::PathMovetoAbs::~PathMovetoAbs ( void )
2209 void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ ) const
2211 for( CoordinateList::const_iterator p = _coordinates.begin();
2212 p != _coordinates.end(); p++ )
2214 DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2217 Magick::VPathBase* Magick::PathMovetoAbs::copy() const
2219 return new PathMovetoAbs(*this);
2221 Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ )
2222 : _coordinates(1,coordinate_)
2225 Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ )
2226 : _coordinates(coordinates_)
2229 Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ )
2230 : VPathBase (original_),
2231 _coordinates(original_._coordinates)
2234 Magick::PathMovetoRel::~PathMovetoRel ( void )
2237 void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ ) const
2239 for( CoordinateList::const_iterator p = _coordinates.begin();
2240 p != _coordinates.end(); p++ )
2242 DrawPathMoveToRelative( context_, p->x(), p->y() );
2245 Magick::VPathBase* Magick::PathMovetoRel::copy() const
2247 return new PathMovetoRel(*this);
2250 #if defined(EXPLICIT_TEMPLATE_INSTANTIATION)
2251 // template class std::list<Magick::Coordinate>;
2252 // template class std::list<const Magick::Drawable>;
2253 // template class std::list<const Magick::PathArcArgs>;
2254 // template class std::list<const Magick::PathCurvetoArgs>;
2255 // template class std::list<const Magick::PathQuadraticCurvetoArgs>;
2256 // template class std::list<const Magick::VPath>;