11 #define MAGICKCORE_IMPLEMENTATION 1
12 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
13 #define MAGICK_DRAWABLE_IMPLEMENTATION
15 #include "Magick++/Include.h"
19 #include "Magick++/Drawable.h"
20 #include "Magick++/Image.h"
27 return((left_.x() == right_.x()) && (left_.y() == right_.y()));
33 return(!(left_ == right_));
39 return (!(left_ < right_) && (left_ != right_));
46 return((sqrt(left_.x()*left_.x() + left_.y()*left_.y())) <
47 (sqrt(right_.x()*right_.x() + right_.y()*right_.y())));
53 return((left_ > right_) || (left_ == right_));
59 return((left_ < right_) || (left_ == right_));
63 Magick::DrawableBase::DrawableBase()
67 Magick::DrawableBase::~DrawableBase(
void)
71 void Magick::DrawableBase::operator()(MagickCore::DrawingWand * context_)
const
78 return new DrawableBase(*
this);
82 Magick::Drawable::Drawable(
void)
83 : dp((Magick::DrawableBase *) NULL)
88 : dp(original_.copy())
92 Magick::Drawable::~Drawable(
void)
99 : dp((original_.dp != (Magick::DrawableBase *) NULL ? original_.dp->copy() :
100 (Magick::DrawableBase *) NULL))
110 if (
this != &original_)
120 void Magick::Drawable::operator()(MagickCore::DrawingWand * context_)
const
123 dp->operator()(context_);
127 Magick::VPathBase::~VPathBase (
void )
132 Magick::VPath::VPath (
void )
139 : dp(original_.copy())
144 Magick::VPath::~VPath (
void )
152 : dp(original_.dp? original_.dp->copy(): 0)
159 if (
this != &original_)
161 VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
169 void Magick::VPath::operator()( MagickCore::DrawingWand * context_ )
const
172 dp->operator()( context_ );
180 Magick::DrawableAffine::DrawableAffine(
double sx_,
double sy_,
181 double rx_,
double ry_,
182 double tx_,
double ty_ )
191 Magick::DrawableAffine::DrawableAffine(
void )
193 GetAffineMatrix(&_affine);
195 Magick::DrawableAffine::~DrawableAffine(
void )
198 void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ )
const
200 DrawAffine( context_, &_affine );
204 return new DrawableAffine(*
this);
207 Magick::DrawableAlpha::~DrawableAlpha(
void)
211 void Magick::DrawableAlpha::operator()(MagickCore::DrawingWand * context_)
const
213 DrawAlpha(context_,_x,_y,_paintMethod);
218 return new DrawableAlpha(*
this);
222 Magick::DrawableArc::~DrawableArc(
void )
225 void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ )
const
227 DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
231 return new DrawableArc(*
this);
238 Magick::DrawableBezier::DrawableBezier (
const CoordinateList &coordinates_ )
239 : _coordinates(coordinates_)
244 : DrawableBase (original_),
245 _coordinates(original_._coordinates)
249 Magick::DrawableBezier::~DrawableBezier(
void )
252 void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ )
const
254 size_t num_coords = (size_t) _coordinates.size();
255 PointInfo *coordinates =
new PointInfo[num_coords];
257 PointInfo *q = coordinates;
258 CoordinateList::const_iterator p = _coordinates.begin();
260 while( p != _coordinates.end() )
268 DrawBezier( context_, num_coords, coordinates );
269 delete [] coordinates;
273 return new DrawableBezier(*
this);
278 Magick::DrawableBorderColor::DrawableBorderColor(
const Magick::Color &color_)
283 Magick::DrawableBorderColor::DrawableBorderColor
285 : DrawableBase(original_),
286 _color(original_._color)
290 Magick::DrawableBorderColor::~DrawableBorderColor(
void)
294 void Magick::DrawableBorderColor::operator()(
295 MagickCore::DrawingWand *context_)
const
303 color=
static_cast<PixelInfo
>(_color);
304 pixel_wand=NewPixelWand();
305 PixelSetPixelColor(pixel_wand,&color);
306 DrawSetBorderColor(context_,pixel_wand);
307 pixel_wand=DestroyPixelWand(pixel_wand);
310 void Magick::DrawableBorderColor::color(
const Color &color_)
322 return(
new DrawableBorderColor(*
this));
327 Magick::DrawableClipRule::DrawableClipRule(
const FillRule fillRule_)
332 Magick::DrawableClipRule::~DrawableClipRule(
void)
336 void Magick::DrawableClipRule::operator()(
337 MagickCore::DrawingWand * context_)
const
339 DrawSetClipRule(context_,_fillRule);
342 void Magick::DrawableClipRule::fillRule(
const FillRule fillRule_)
347 Magick::FillRule Magick::DrawableClipRule::fillRule(
void)
const
354 return(
new DrawableClipRule(*
this));
359 Magick::DrawableClipUnits::DrawableClipUnits(
const ClipPathUnits units_)
364 Magick::DrawableClipUnits::~DrawableClipUnits(
void)
368 void Magick::DrawableClipUnits::operator()(
369 MagickCore::DrawingWand * context_)
const
371 DrawSetClipUnits(context_, _units);
374 void Magick::DrawableClipUnits::units(
const ClipPathUnits units_)
379 Magick::ClipPathUnits Magick::DrawableClipUnits::units(
void)
const
386 return(
new DrawableClipUnits(*
this));
395 Magick::DrawablePopClipPath::~DrawablePopClipPath (
void )
398 void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ )
const
400 DrawPopClipPath( context_ );
401 DrawPopDefs(context_);
405 return new DrawablePopClipPath(*
this);
409 Magick::DrawablePushClipPath::DrawablePushClipPath(
const std::string &id_)
413 Magick::DrawablePushClipPath::DrawablePushClipPath
415 : DrawableBase (original_),
416 _id(original_._id.c_str())
419 Magick::DrawablePushClipPath::~DrawablePushClipPath(
void )
422 void Magick::DrawablePushClipPath::operator()
423 ( MagickCore::DrawingWand * context_ )
const
425 DrawPushDefs(context_);
426 DrawPushClipPath( context_, _id.c_str());
430 return new DrawablePushClipPath(*
this);
435 Magick::DrawableClipPath::DrawableClipPath(
const std::string &id_ )
441 : DrawableBase (original_),
442 _id(original_._id.c_str())
445 Magick::DrawableClipPath::~DrawableClipPath(
void )
448 void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ )
const
450 (void) DrawSetClipPath( context_, _id.c_str());
454 return new DrawableClipPath(*
this);
458 Magick::DrawableCircle::~DrawableCircle (
void )
461 void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ )
const
463 DrawCircle( context_, _originX, _originY, _perimX, _perimY );
467 return new DrawableCircle(*
this);
471 Magick::DrawableColor::~DrawableColor(
void )
474 void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ )
const
476 DrawColor( context_, _x, _y, _paintMethod );
480 return new DrawableColor(*
this);
484 Magick::DrawableCompositeImage::DrawableCompositeImage
485 (
double x_,
double y_,
486 double width_,
double height_,
487 const std::string &filename_,
488 Magick::CompositeOperator composition_ )
489 : _composition(composition_),
494 _image(new Image(filename_))
497 Magick::DrawableCompositeImage::DrawableCompositeImage
498 (
double x_,
double y_,
499 double width_,
double height_,
501 Magick::CompositeOperator composition_ )
502 : _composition(composition_),
507 _image(new Image(image_))
510 Magick::DrawableCompositeImage::DrawableCompositeImage
511 (
double x_,
double y_,
512 double width_,
double height_,
513 const std::string &filename_ )
514 :_composition(CopyCompositeOp),
519 _image(new Image(filename_))
522 Magick::DrawableCompositeImage::DrawableCompositeImage
523 (
double x_,
double y_,
524 double width_,
double height_,
526 :_composition(CopyCompositeOp),
531 _image(new Image(image_))
534 Magick::DrawableCompositeImage::DrawableCompositeImage
535 (
double x_,
double y_,
536 const std::string &filename_ )
537 : _composition(CopyCompositeOp),
542 _image(new Image(filename_))
544 _width=_image->columns();
545 _height=_image->rows();
547 Magick::DrawableCompositeImage::DrawableCompositeImage
548 (
double x_,
double y_,
550 : _composition(CopyCompositeOp),
555 _image(new Image(image_))
557 _width=_image->columns();
558 _height=_image->rows();
561 Magick::DrawableCompositeImage::DrawableCompositeImage
563 : Magick::DrawableBase(original_),
564 _composition(original_._composition),
567 _width(original_._width),
568 _height(original_._height),
569 _image(new Image(*original_._image))
572 Magick::DrawableCompositeImage::~DrawableCompositeImage(
void )
581 if (
this != &original_ )
583 _composition = original_._composition;
586 _width = original_._width;
587 _height = original_._height;
588 Image* temp_image =
new Image(*original_._image);
594 void Magick::DrawableCompositeImage::filename(
const std::string &filename_ )
596 Image* temp_image =
new Image(filename_);
600 std::string Magick::DrawableCompositeImage::filename(
void )
const
602 return _image->fileName();
605 void Magick::DrawableCompositeImage::image(
const Magick::Image &image_ )
607 Image* temp_image =
new Image(image_);
611 Magick::Image Magick::DrawableCompositeImage::image(
void )
const
617 void Magick::DrawableCompositeImage::magick( std::string magick_ )
619 _image->magick( magick_ );
621 std::string Magick::DrawableCompositeImage::magick(
void )
623 return _image->magick();
626 void Magick::DrawableCompositeImage::operator()
627 ( MagickCore::DrawingWand * context_ )
const
632 magick_wand=NewMagickWandFromImage(_image->constImage());
633 (void) DrawComposite( context_, _composition, _x, _y, _width, _height,
635 magick_wand=DestroyMagickWand(magick_wand);
640 return new DrawableCompositeImage(*
this);
643 Magick::DrawableDensity::DrawableDensity(
const Point &density_)
648 Magick::DrawableDensity::DrawableDensity(
const std::string &density_)
653 Magick::DrawableDensity::~DrawableDensity(
void)
657 void Magick::DrawableDensity::operator()(
658 MagickCore::DrawingWand *context_)
const
660 DrawSetDensity(context_,_density.c_str());
665 return(
new DrawableDensity(*
this));
669 Magick::DrawableEllipse::~DrawableEllipse(
void )
672 void Magick::DrawableEllipse::operator()
673 ( MagickCore::DrawingWand * context_ )
const
675 DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
676 _arcStart, _arcEnd );
680 return new DrawableEllipse(*
this);
684 Magick::DrawableFillColor::DrawableFillColor(
const Magick::Color &color_ )
688 Magick::DrawableFillColor::DrawableFillColor
690 : DrawableBase (original_),
691 _color(original_._color)
694 Magick::DrawableFillColor::~DrawableFillColor(
void )
697 void Magick::DrawableFillColor::operator()
698 ( MagickCore::DrawingWand * context_ )
const
700 PixelInfo color =
static_cast<PixelInfo
>(_color);
701 PixelWand *pixel_wand=NewPixelWand();
702 PixelSetPixelColor(pixel_wand,&color);
703 DrawSetFillColor(context_,pixel_wand);
704 pixel_wand=DestroyPixelWand(pixel_wand);
708 return new DrawableFillColor(*
this);
712 Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
const std::string &url_)
717 Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
719 : DrawableBase(original_),
724 Magick::DrawableFillPatternUrl::~DrawableFillPatternUrl(
void)
728 void Magick::DrawableFillPatternUrl::operator()(
729 MagickCore::DrawingWand * context_)
const
731 DrawSetFillPatternURL(context_, _url.c_str());
734 void Magick::DrawableFillPatternUrl::url(
const std::string &url_)
739 std::string Magick::DrawableFillPatternUrl::url(
void)
const
746 return(
new DrawableFillPatternUrl(*
this));
750 Magick::DrawableFillRule::~DrawableFillRule (
void )
753 void Magick::DrawableFillRule::operator()
754 ( MagickCore::DrawingWand * context_ )
const
756 DrawSetFillRule( context_, _fillRule );
760 return new DrawableFillRule(*
this);
763 Magick::DrawableFillOpacity::~DrawableFillOpacity(
void)
767 void Magick::DrawableFillOpacity::operator()
768 (MagickCore::DrawingWand *context_)
const
770 DrawSetFillOpacity(context_,_opacity);
775 return new DrawableFillOpacity(*
this);
779 Magick::DrawableFont::DrawableFont (
const std::string &font_ )
782 _style(Magick::AnyStyle),
784 _stretch(Magick::NormalStretch)
787 Magick::DrawableFont::DrawableFont (
const std::string &family_,
788 Magick::StyleType style_,
789 const unsigned int weight_,
790 Magick::StretchType stretch_ )
799 : DrawableBase (original_),
800 _font(original_._font),
801 _family(original_._family),
802 _style(original_._style),
803 _weight(original_._weight),
804 _stretch(original_._stretch)
807 Magick::DrawableFont::~DrawableFont (
void )
810 void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ )
const
815 (void) DrawSetFont( context_, _font.c_str() );
821 (void) DrawSetFontFamily( context_, _family.c_str() );
824 DrawSetFontStyle( context_, _style );
827 DrawSetFontWeight( context_, _weight );
830 DrawSetFontStretch( context_, _stretch );
835 return new DrawableFont(*
this);
839 Magick::DrawableGravity::~DrawableGravity (
void )
842 void Magick::DrawableGravity::operator()
843 ( MagickCore::DrawingWand * context_ )
const
845 DrawSetGravity( context_, _gravity );
849 return new DrawableGravity(*
this);
853 Magick::DrawableLine::~DrawableLine (
void )
856 void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ )
const
858 DrawLine( context_, _startX, _startY, _endX, _endY );
862 return new DrawableLine(*
this);
866 Magick::DrawablePath::DrawablePath (
const VPathList &path_ )
871 : DrawableBase (original_),
872 _path(original_._path)
875 Magick::DrawablePath::~DrawablePath (
void )
878 void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ )
const
880 DrawPathStart( context_ );
882 for( VPathList::const_iterator p = _path.begin();
883 p != _path.end(); p++ )
884 p->operator()( context_ );
886 DrawPathFinish( context_ );
890 return new DrawablePath(*
this);
894 Magick::DrawablePoint::~DrawablePoint (
void )
897 void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ )
const
899 DrawPoint( context_, _x, _y );
903 return new DrawablePoint(*
this);
907 Magick::DrawablePointSize::~DrawablePointSize (
void )
910 void Magick::DrawablePointSize::operator()
911 ( MagickCore::DrawingWand * context_ )
const
913 DrawSetFontSize( context_, _pointSize );
917 return new DrawablePointSize(*
this);
921 Magick::DrawablePolygon::DrawablePolygon (
const CoordinateList &coordinates_ )
922 : _coordinates(coordinates_)
925 Magick::DrawablePolygon::DrawablePolygon
927 : DrawableBase (original_),
928 _coordinates(original_._coordinates)
931 Magick::DrawablePolygon::~DrawablePolygon (
void )
934 void Magick::DrawablePolygon::operator()
935 ( MagickCore::DrawingWand * context_ )
const
937 size_t num_coords = (size_t) _coordinates.size();
938 PointInfo *coordinates =
new PointInfo[num_coords];
940 PointInfo *q = coordinates;
941 CoordinateList::const_iterator p = _coordinates.begin();
943 while( p != _coordinates.end() )
951 DrawPolygon( context_, num_coords, coordinates );
952 delete [] coordinates;
956 return new DrawablePolygon(*
this);
960 Magick::DrawablePolyline::DrawablePolyline
961 (
const CoordinateList &coordinates_ )
962 : _coordinates(coordinates_)
965 Magick::DrawablePolyline::DrawablePolyline
967 : DrawableBase (original_),
968 _coordinates(original_._coordinates)
971 Magick::DrawablePolyline::~DrawablePolyline (
void )
974 void Magick::DrawablePolyline::operator()
975 ( MagickCore::DrawingWand * context_ )
const
977 size_t num_coords = (size_t) _coordinates.size();
978 PointInfo *coordinates =
new PointInfo[num_coords];
980 PointInfo *q = coordinates;
981 CoordinateList::const_iterator p = _coordinates.begin();
983 while( p != _coordinates.end() )
991 DrawPolyline( context_, num_coords, coordinates );
992 delete [] coordinates;
996 return new DrawablePolyline(*
this);
1000 Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext (
void )
1003 void Magick::DrawablePopGraphicContext::operator()
1004 ( MagickCore::DrawingWand * context_ )
const
1006 PopDrawingWand( context_ );
1010 return new DrawablePopGraphicContext(*
this);
1014 Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext (
void )
1017 void Magick::DrawablePushGraphicContext::operator()
1018 ( MagickCore::DrawingWand * context_ )
const
1020 PushDrawingWand( context_ );
1024 return new DrawablePushGraphicContext(*
this);
1028 Magick::DrawablePopPattern::~DrawablePopPattern (
void )
1031 void Magick::DrawablePopPattern::operator()
1032 ( MagickCore::DrawingWand * context_ )
const
1034 (void) DrawPopPattern( context_ );
1038 return new DrawablePopPattern(*
this);
1042 Magick::DrawablePushPattern::DrawablePushPattern
1043 (
const std::string &id_, ssize_t x_, ssize_t y_,
1044 size_t width_,
size_t height_ )
1052 Magick::DrawablePushPattern::DrawablePushPattern
1054 : DrawableBase (original_),
1058 _width(original_._width),
1059 _height(original_._height)
1062 Magick::DrawablePushPattern::~DrawablePushPattern (
void )
1065 void Magick::DrawablePushPattern::operator()
1066 ( MagickCore::DrawingWand * context_ )
const
1068 (void) DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height );
1072 return new DrawablePushPattern(*
this);
1076 Magick::DrawableRectangle::~DrawableRectangle (
void )
1079 void Magick::DrawableRectangle::operator()
1080 ( MagickCore::DrawingWand * context_ )
const
1082 DrawRectangle( context_, _upperLeftX, _upperLeftY,
1083 _lowerRightX, _lowerRightY );
1087 return new DrawableRectangle(*
this);
1091 Magick::DrawableRotation::~DrawableRotation (
void )
1094 void Magick::DrawableRotation::operator()
1095 ( MagickCore::DrawingWand * context_ )
const
1097 DrawRotate( context_, _angle );
1101 return new DrawableRotation(*
this);
1105 Magick::DrawableRoundRectangle::~DrawableRoundRectangle (
void )
1108 void Magick::DrawableRoundRectangle::operator()
1109 ( MagickCore::DrawingWand * context_ )
const
1111 DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX,
1112 _lowerRightY,_cornerWidth, _cornerHeight);
1116 return new DrawableRoundRectangle(*
this);
1120 Magick::DrawableScaling::~DrawableScaling (
void )
1123 void Magick::DrawableScaling::operator()
1124 ( MagickCore::DrawingWand * context_ )
const
1126 DrawScale( context_, _x, _y );
1130 return new DrawableScaling(*
this);
1134 Magick::DrawableSkewX::~DrawableSkewX (
void )
1137 void Magick::DrawableSkewX::operator()
1138 ( MagickCore::DrawingWand * context_ )
const
1140 DrawSkewX( context_, _angle );
1144 return new DrawableSkewX(*
this);
1148 Magick::DrawableSkewY::~DrawableSkewY (
void )
1151 void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ )
const
1153 DrawSkewY( context_, _angle );
1157 return new DrawableSkewY(*
this);
1161 Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
const double* dasharray_)
1165 dasharray(dasharray_);
1168 Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
1170 : DrawableBase (original_),
1171 _size(original_._size),
1172 _dasharray(new double[_size+1])
1176 for (
size_t i=0; i < _size; i++)
1177 _dasharray[i]=original_._dasharray[i];
1178 _dasharray[_size]=0.0;
1182 Magick::DrawableStrokeDashArray::~DrawableStrokeDashArray(
void)
1184 delete [] _dasharray;
1186 _dasharray=(
double *) NULL;
1192 if (
this != &original_)
1194 delete [] _dasharray;
1195 _size=original_._size;
1196 _dasharray =
new double[_size+1];
1199 for (
size_t i=0; i < _size; i++)
1200 _dasharray[i]=original_._dasharray[i];
1201 _dasharray[_size]=0.0;
1207 void Magick::DrawableStrokeDashArray::operator()(
1208 MagickCore::DrawingWand *context_)
const
1210 (void) DrawSetStrokeDashArray(context_,(
unsigned long) _size,_dasharray);
1215 return(
new DrawableStrokeDashArray(*
this));
1218 void Magick::DrawableStrokeDashArray::dasharray(
const double* dasharray_)
1223 delete [] _dasharray;
1227 if (dasharray_ != (
const double *) NULL)
1242 _dasharray=
new double[_size+1];
1245 for (
size_t i=0; i < _size; i++)
1246 _dasharray[i]=dasharray_[i];
1247 _dasharray[_size]=0.0;
1252 const double* Magick::DrawableStrokeDashArray::dasharray(
void)
const
1258 Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(
void)
1262 void Magick::DrawableStrokeDashOffset::operator()
1263 ( MagickCore::DrawingWand * context_)
const
1265 DrawSetStrokeDashOffset(context_,_offset);
1270 return(
new DrawableStrokeDashOffset(*
this));
1273 void Magick::DrawableStrokeDashOffset::offset(
const double offset_)
1278 double Magick::DrawableStrokeDashOffset::offset(
void)
const
1284 Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap (
void )
1287 void Magick::DrawableStrokeLineCap::operator()
1288 ( MagickCore::DrawingWand * context_ )
const
1290 DrawSetStrokeLineCap( context_, _linecap );
1294 return new DrawableStrokeLineCap(*
this);
1298 Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin (
void )
1301 void Magick::DrawableStrokeLineJoin::operator()
1302 ( MagickCore::DrawingWand * context_ )
const
1304 DrawSetStrokeLineJoin( context_, _linejoin );
1308 return new DrawableStrokeLineJoin(*
this);
1312 Magick::DrawableMiterLimit::~DrawableMiterLimit (
void )
1315 void Magick::DrawableMiterLimit::operator()
1316 ( MagickCore::DrawingWand * context_ )
const
1318 DrawSetStrokeMiterLimit( context_, _miterlimit );
1322 return new DrawableMiterLimit(*
this);
1327 Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1328 const std::string &url_)
1333 Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1335 : DrawableBase(original_),
1336 _url(original_._url)
1340 Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(
void)
1344 void Magick::DrawableStrokePatternUrl::operator()(
1345 MagickCore::DrawingWand * context_)
const
1347 DrawSetStrokePatternURL(context_, _url.c_str());
1350 void Magick::DrawableStrokePatternUrl::url(
const std::string &url_)
1355 std::string Magick::DrawableStrokePatternUrl::url(
void)
const
1362 return(
new DrawableStrokePatternUrl(*
this));
1366 Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias (
void )
1369 void Magick::DrawableStrokeAntialias::operator()
1370 ( MagickCore::DrawingWand * context_ )
const
1372 DrawSetStrokeAntialias( context_,
static_cast<MagickBooleanType
>
1373 (_flag ? MagickTrue : MagickFalse) );
1377 return new DrawableStrokeAntialias(*
this);
1381 Magick::DrawableStrokeColor::DrawableStrokeColor
1386 Magick::DrawableStrokeColor::DrawableStrokeColor
1388 : DrawableBase (original_),
1389 _color(original_._color)
1392 Magick::DrawableStrokeColor::~DrawableStrokeColor (
void )
1395 void Magick::DrawableStrokeColor::operator()
1396 ( MagickCore::DrawingWand * context_ )
const
1398 PixelInfo color =
static_cast<PixelInfo
>(_color);
1399 PixelWand *pixel_wand=NewPixelWand();
1400 PixelSetPixelColor(pixel_wand,&color);
1401 DrawSetStrokeColor(context_,pixel_wand);
1402 pixel_wand=DestroyPixelWand(pixel_wand);
1406 return new DrawableStrokeColor(*
this);
1409 Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(
void)
1413 void Magick::DrawableStrokeOpacity::operator()
1414 (MagickCore::DrawingWand * context_)
const
1416 DrawSetStrokeOpacity(context_,_opacity);
1421 return new DrawableStrokeOpacity(*
this);
1425 Magick::DrawableStrokeWidth::~DrawableStrokeWidth (
void )
1428 void Magick::DrawableStrokeWidth::operator()
1429 ( MagickCore::DrawingWand * context_ )
const
1431 DrawSetStrokeWidth( context_, _width );
1435 return new DrawableStrokeWidth(*
this);
1439 Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1440 const std::string &text_ )
1447 Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1448 const std::string &text_,
const std::string &encoding_)
1452 _encoding(encoding_)
1456 : DrawableBase (original_),
1459 _text(original_._text),
1460 _encoding(original_._encoding)
1463 Magick::DrawableText::~DrawableText (
void )
1466 void Magick::DrawableText::operator()
1467 ( MagickCore::DrawingWand * context_ )
const
1469 DrawSetTextEncoding( context_, _encoding.c_str() );
1470 DrawAnnotation( context_, _x, _y,
1471 reinterpret_cast<const unsigned char*
>(_text.c_str()) );
1475 return new DrawableText(*
this);
1479 Magick::DrawableTextAlignment::DrawableTextAlignment(
1480 Magick::AlignType alignment_)
1481 : _alignment(alignment_)
1485 Magick::DrawableTextAlignment::DrawableTextAlignment
1487 : DrawableBase(original_),
1488 _alignment(original_._alignment)
1492 Magick::DrawableTextAlignment::~DrawableTextAlignment(
void)
1496 void Magick::DrawableTextAlignment::operator()(
1497 MagickCore::DrawingWand * context_)
const
1499 DrawSetTextAlignment(context_, _alignment);
1502 void Magick::DrawableTextAlignment::alignment(AlignType alignment_)
1504 _alignment=alignment_;
1507 Magick::AlignType Magick::DrawableTextAlignment::alignment(
void)
const
1514 return new DrawableTextAlignment(*
this);
1518 Magick::DrawableTextAntialias::DrawableTextAntialias (
bool flag_ )
1523 : DrawableBase (original_),
1524 _flag(original_._flag)
1527 Magick::DrawableTextAntialias::~DrawableTextAntialias (
void )
1530 void Magick::DrawableTextAntialias::operator()
1531 ( MagickCore::DrawingWand * context_ )
const
1533 DrawSetTextAntialias( context_,
static_cast<MagickBooleanType
>
1534 (_flag ? MagickTrue : MagickFalse) );
1538 return new DrawableTextAntialias(*
this);
1543 Magick::DrawableTextDecoration::DrawableTextDecoration
1544 ( Magick::DecorationType decoration_ )
1545 : _decoration(decoration_)
1548 Magick::DrawableTextDecoration::DrawableTextDecoration
1550 : DrawableBase (original_),
1551 _decoration(original_._decoration)
1554 Magick::DrawableTextDecoration::~DrawableTextDecoration(
void )
1557 void Magick::DrawableTextDecoration::operator()
1558 ( MagickCore::DrawingWand * context_ )
const
1560 DrawSetTextDecoration( context_, _decoration );
1564 return new DrawableTextDecoration(*
this);
1568 Magick::DrawableTextDirection::DrawableTextDirection(
1569 DirectionType direction_)
1570 : _direction(direction_)
1574 Magick::DrawableTextDirection::~DrawableTextDirection(
void)
1578 void Magick::DrawableTextDirection::operator()(
1579 MagickCore::DrawingWand *context_)
const
1581 DrawSetTextDirection(context_,_direction);
1584 void Magick::DrawableTextDirection::direction(DirectionType direction_)
1586 _direction=direction_;
1589 Magick::DirectionType Magick::DrawableTextDirection::direction(
void)
const
1596 return new DrawableTextDirection(*
this);
1600 Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1602 : _spacing(spacing_)
1606 Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(
void)
1610 void Magick::DrawableTextInterlineSpacing::operator()(
1611 MagickCore::DrawingWand *context_)
const
1613 DrawSetTextInterlineSpacing(context_,_spacing);
1616 void Magick::DrawableTextInterlineSpacing::spacing(
double spacing_)
1621 double Magick::DrawableTextInterlineSpacing::spacing(
void)
const
1628 return new DrawableTextInterlineSpacing(*
this);
1632 Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1634 : _spacing(spacing_)
1638 Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(
void)
1642 void Magick::DrawableTextInterwordSpacing::operator()(
1643 MagickCore::DrawingWand *context_)
const
1645 DrawSetTextInterwordSpacing(context_,_spacing);
1648 void Magick::DrawableTextInterwordSpacing::spacing(
double spacing_)
1653 double Magick::DrawableTextInterwordSpacing::spacing(
void)
const
1660 return new DrawableTextInterwordSpacing(*
this);
1664 Magick::DrawableTextKerning::DrawableTextKerning(
1666 : _kerning(kerning_)
1670 Magick::DrawableTextKerning::~DrawableTextKerning(
void)
1674 void Magick::DrawableTextKerning::operator()(
1675 MagickCore::DrawingWand *context_)
const
1677 DrawSetTextKerning(context_,_kerning);
1680 void Magick::DrawableTextKerning::kerning(
double kerning_)
1685 double Magick::DrawableTextKerning::kerning(
void)
const
1692 return new DrawableTextKerning(*
this);
1696 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1701 Magick::DrawableTextUnderColor::DrawableTextUnderColor
1703 : DrawableBase (original_),
1704 _color(original_._color)
1707 Magick::DrawableTextUnderColor::~DrawableTextUnderColor (
void )
1710 void Magick::DrawableTextUnderColor::operator()
1711 ( MagickCore::DrawingWand * context_ )
const
1713 PixelInfo color =
static_cast<PixelInfo
>(_color);
1714 PixelWand *pixel_wand=NewPixelWand();
1715 PixelSetPixelColor(pixel_wand,&color);
1716 DrawSetTextUnderColor(context_,pixel_wand);
1717 pixel_wand=DestroyPixelWand(pixel_wand);
1721 return new DrawableTextUnderColor(*
this);
1725 Magick::DrawableTranslation::~DrawableTranslation (
void )
1728 void Magick::DrawableTranslation::operator()
1729 ( MagickCore::DrawingWand * context_ )
const
1731 DrawTranslate( context_, _x, _y );
1735 return new DrawableTranslation(*
this);
1739 Magick::DrawableViewbox::~DrawableViewbox (
void )
1742 void Magick::DrawableViewbox::operator()
1743 ( MagickCore::DrawingWand * context_ )
const
1745 DrawSetViewbox( context_, _x1, _y1, _x2, _y2 );
1749 return new DrawableViewbox(*
this);
1782 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1787 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1790 Magick::PathArcArgs::PathArcArgs(
void )
1794 _largeArcFlag(false),
1801 Magick::PathArcArgs::PathArcArgs(
double radiusX_,
double radiusY_,
1802 double xAxisRotation_,
bool largeArcFlag_,
1803 bool sweepFlag_,
double x_,
double y_ )
1804 : _radiusX(radiusX_),
1806 _xAxisRotation(xAxisRotation_),
1807 _largeArcFlag(largeArcFlag_),
1808 _sweepFlag(sweepFlag_),
1815 : _radiusX(original_._radiusX),
1816 _radiusY(original_._radiusY),
1817 _xAxisRotation(original_._xAxisRotation),
1818 _largeArcFlag(original_._largeArcFlag),
1819 _sweepFlag(original_._sweepFlag),
1825 Magick::PathArcArgs::~PathArcArgs (
void )
1831 : _coordinates(1,coordinates_)
1834 Magick::PathArcAbs::PathArcAbs (
const PathArcArgsList &coordinates_ )
1835 : _coordinates(coordinates_)
1839 : VPathBase (original_),
1840 _coordinates(original_._coordinates)
1843 Magick::PathArcAbs::~PathArcAbs (
void )
1846 void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ )
const
1848 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1849 p != _coordinates.end(); p++ )
1851 DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1852 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1853 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1858 return new PathArcAbs(*
this);
1862 : _coordinates(1,coordinates_)
1865 Magick::PathArcRel::PathArcRel (
const PathArcArgsList &coordinates_ )
1866 : _coordinates(coordinates_)
1870 : VPathBase (original_),
1871 _coordinates(original_._coordinates)
1874 Magick::PathArcRel::~PathArcRel (
void )
1877 void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ )
const
1879 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1880 p != _coordinates.end(); p++ )
1882 DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1883 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1884 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1889 return new PathArcRel(*
this);
1895 Magick::PathClosePath::~PathClosePath (
void )
1898 void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ )
const
1900 DrawPathClose( context_ );
1904 return new PathClosePath(*
this);
1933 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1938 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1941 Magick::PathCurvetoArgs::PathCurvetoArgs(
void )
1951 Magick::PathCurvetoArgs::PathCurvetoArgs(
double x1_,
double y1_,
1952 double x2_,
double y2_,
1953 double x_,
double y_ )
1963 Magick::PathCurvetoArgs::PathCurvetoArgs(
const PathCurvetoArgs &original_ )
1964 : _x1(original_._x1),
1973 Magick::PathCurvetoArgs::~PathCurvetoArgs (
void )
1981 Magick::PathCurvetoAbs::PathCurvetoAbs (
const PathCurveToArgsList &args_ )
1985 Magick::PathCurvetoAbs::PathCurvetoAbs
1987 : VPathBase (original_),
1988 _args(original_._args)
1991 Magick::PathCurvetoAbs::~PathCurvetoAbs (
void )
1994 void Magick::PathCurvetoAbs::operator()
1995 ( MagickCore::DrawingWand * context_ )
const
1997 for( PathCurveToArgsList::const_iterator p = _args.begin();
1998 p != _args.end(); p++ )
2000 DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2006 return new PathCurvetoAbs(*
this);
2012 Magick::PathCurvetoRel::PathCurvetoRel (
const PathCurveToArgsList &args_ )
2016 Magick::PathCurvetoRel::PathCurvetoRel
2018 : VPathBase (original_),
2019 _args(original_._args)
2022 Magick::PathCurvetoRel::~PathCurvetoRel (
void )
2025 void Magick::PathCurvetoRel::operator()
2026 ( MagickCore::DrawingWand * context_ )
const
2028 for( PathCurveToArgsList::const_iterator p = _args.begin();
2029 p != _args.end(); p++ )
2031 DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2037 return new PathCurvetoRel(*
this);
2039 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2041 : _coordinates(1,coordinates_)
2044 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2045 (
const CoordinateList &coordinates_ )
2046 : _coordinates(coordinates_)
2049 Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2051 : VPathBase (original_),
2052 _coordinates(original_._coordinates)
2055 Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs (
void )
2058 void Magick::PathSmoothCurvetoAbs::operator()
2059 ( MagickCore::DrawingWand * context_ )
const
2061 for( CoordinateList::const_iterator p = _coordinates.begin();
2062 p != _coordinates.end(); p++ )
2067 if (p == _coordinates.end() )
2069 DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
2074 return new PathSmoothCurvetoAbs(*
this);
2076 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2078 : _coordinates(1,coordinates_)
2081 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2082 (
const CoordinateList &coordinates_ )
2083 : _coordinates(coordinates_)
2086 Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2088 : VPathBase (original_),
2089 _coordinates(original_._coordinates)
2092 Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel (
void )
2095 void Magick::PathSmoothCurvetoRel::operator()
2096 ( MagickCore::DrawingWand * context_ )
const
2098 for( CoordinateList::const_iterator p = _coordinates.begin();
2099 p != _coordinates.end(); p++ )
2104 if (p == _coordinates.end() )
2106 DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
2111 return new PathSmoothCurvetoRel(*
this);
2117 MagickPPExport
int Magick::operator ==
2123 MagickPPExport
int Magick::operator !=
2129 MagickPPExport
int Magick::operator >
2135 MagickPPExport
int Magick::operator <
2141 MagickPPExport
int Magick::operator >=
2145 return ( ( left_ > right_ ) || ( left_ == right_ ) );
2147 MagickPPExport
int Magick::operator <=
2151 return ( ( left_ < right_ ) || ( left_ == right_ ) );
2154 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
void )
2162 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
double x1_,
2173 Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
const PathQuadraticCurvetoArgs &original_ )
2174 : _x1(original_._x1),
2181 Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs (
void )
2185 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2190 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2191 (
const PathQuadraticCurvetoArgsList &args_ )
2195 Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2197 : VPathBase (original_),
2198 _args(original_._args)
2201 Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs (
void )
2204 void Magick::PathQuadraticCurvetoAbs::operator()
2205 ( MagickCore::DrawingWand * context_ )
const
2207 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2208 p != _args.end(); p++ )
2210 DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
2216 return new PathQuadraticCurvetoAbs(*
this);
2218 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2223 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2224 (
const PathQuadraticCurvetoArgsList &args_ )
2228 Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2230 : VPathBase (original_),
2231 _args(original_._args)
2234 Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel (
void )
2237 void Magick::PathQuadraticCurvetoRel::operator()
2238 ( MagickCore::DrawingWand * context_ )
const
2240 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2241 p != _args.end(); p++ )
2243 DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
2249 return new PathQuadraticCurvetoRel(*
this);
2251 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2253 : _coordinates(1,coordinate_)
2256 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2257 (
const CoordinateList &coordinates_ )
2258 : _coordinates(coordinates_)
2261 Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2263 : VPathBase (original_),
2264 _coordinates(original_._coordinates)
2267 Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs (
void )
2270 void Magick::PathSmoothQuadraticCurvetoAbs::operator()
2271 ( MagickCore::DrawingWand * context_ )
const
2273 for( CoordinateList::const_iterator p = _coordinates.begin();
2274 p != _coordinates.end(); p++ )
2276 DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
2281 return new PathSmoothQuadraticCurvetoAbs(*
this);
2283 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2285 : _coordinates(1,coordinate_)
2288 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2289 (
const CoordinateList &coordinates_ )
2290 : _coordinates(coordinates_)
2293 Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2294 (
const PathSmoothQuadraticCurvetoRel& original_ )
2295 : VPathBase (original_),
2296 _coordinates(original_._coordinates)
2299 Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel (
void )
2302 void Magick::PathSmoothQuadraticCurvetoRel::operator()
2303 ( MagickCore::DrawingWand * context_ )
const
2305 for( CoordinateList::const_iterator p = _coordinates.begin();
2306 p != _coordinates.end(); p++ )
2308 DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
2313 return new PathSmoothQuadraticCurvetoRel(*
this);
2320 : _coordinates(1,coordinate_)
2323 Magick::PathLinetoAbs::PathLinetoAbs (
const CoordinateList &coordinates_ )
2324 : _coordinates(coordinates_)
2328 : VPathBase (original_),
2329 _coordinates(original_._coordinates)
2332 Magick::PathLinetoAbs::~PathLinetoAbs (
void )
2335 void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2337 for( CoordinateList::const_iterator p = _coordinates.begin();
2338 p != _coordinates.end(); p++ )
2340 DrawPathLineToAbsolute( context_, p->x(), p->y() );
2345 return new PathLinetoAbs(*
this);
2348 : _coordinates(1,coordinate_)
2351 Magick::PathLinetoRel::PathLinetoRel (
const CoordinateList &coordinates_ )
2352 : _coordinates(coordinates_)
2356 : VPathBase (original_),
2357 _coordinates(original_._coordinates)
2360 Magick::PathLinetoRel::~PathLinetoRel (
void )
2363 void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2365 for( CoordinateList::const_iterator p = _coordinates.begin();
2366 p != _coordinates.end(); p++ )
2368 DrawPathLineToRelative( context_, p->x(), p->y() );
2373 return new PathLinetoRel(*
this);
2380 Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs (
void )
2383 void Magick::PathLinetoHorizontalAbs::operator()
2384 ( MagickCore::DrawingWand * context_ )
const
2386 DrawPathLineToHorizontalAbsolute( context_, _x );
2390 return new PathLinetoHorizontalAbs(*
this);
2392 Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel (
void )
2395 void Magick::PathLinetoHorizontalRel::operator()
2396 ( MagickCore::DrawingWand * context_ )
const
2398 DrawPathLineToHorizontalRelative( context_, _x );
2402 return new PathLinetoHorizontalRel(*
this);
2408 Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs (
void )
2411 void Magick::PathLinetoVerticalAbs::operator()
2412 ( MagickCore::DrawingWand * context_ )
const
2414 DrawPathLineToVerticalAbsolute( context_, _y );
2418 return new PathLinetoVerticalAbs(*
this);
2420 Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel (
void )
2423 void Magick::PathLinetoVerticalRel::operator()
2424 ( MagickCore::DrawingWand * context_ )
const
2426 DrawPathLineToVerticalRelative( context_, _y );
2430 return new PathLinetoVerticalRel(*
this);
2438 : _coordinates(1,coordinate_)
2441 Magick::PathMovetoAbs::PathMovetoAbs (
const CoordinateList &coordinates_ )
2442 : _coordinates(coordinates_)
2446 : VPathBase (original_),
2447 _coordinates(original_._coordinates)
2450 Magick::PathMovetoAbs::~PathMovetoAbs (
void )
2453 void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2455 for( CoordinateList::const_iterator p = _coordinates.begin();
2456 p != _coordinates.end(); p++ )
2458 DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2463 return new PathMovetoAbs(*
this);
2466 : _coordinates(1,coordinate_)
2469 Magick::PathMovetoRel::PathMovetoRel (
const CoordinateList &coordinates_ )
2470 : _coordinates(coordinates_)
2474 : VPathBase (original_),
2475 _coordinates(original_._coordinates)
2478 Magick::PathMovetoRel::~PathMovetoRel (
void )
2481 void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2483 for( CoordinateList::const_iterator p = _coordinates.begin();
2484 p != _coordinates.end(); p++ )
2486 DrawPathMoveToRelative( context_, p->x(), p->y() );
2491 return new PathMovetoRel(*
this);