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_));
63Magick::DrawableBase::DrawableBase()
67Magick::DrawableBase::~DrawableBase(
void)
71void Magick::DrawableBase::operator()(MagickCore::DrawingWand * context_)
const
78 return new DrawableBase(*
this);
82Magick::Drawable::Drawable(
void)
83 : dp((Magick::DrawableBase *) NULL)
88 : dp(original_.copy())
92Magick::Drawable::~Drawable(
void)
99 : dp((original_.dp != (Magick::DrawableBase *) NULL ? original_.dp->copy() :
100 (Magick::DrawableBase *) NULL))
110 if (
this != &original_)
120void Magick::Drawable::operator()(MagickCore::DrawingWand * context_)
const
123 dp->operator()(context_);
127Magick::VPathBase::~VPathBase (
void )
132Magick::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);
169void Magick::VPath::operator()( MagickCore::DrawingWand * context_ )
const
172 dp->operator()( context_ );
180Magick::DrawableAffine::DrawableAffine(
double sx_,
double sy_,
181 double rx_,
double ry_,
182 double tx_,
double ty_ )
191Magick::DrawableAffine::DrawableAffine(
void )
193 GetAffineMatrix(&_affine);
195Magick::DrawableAffine::~DrawableAffine(
void )
198void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ )
const
200 DrawAffine( context_, &_affine );
204 return new DrawableAffine(*
this);
207Magick::DrawableAlpha::~DrawableAlpha(
void)
211void Magick::DrawableAlpha::operator()(MagickCore::DrawingWand * context_)
const
213 DrawAlpha(context_,_x,_y,_paintMethod);
218 return new DrawableAlpha(*
this);
222Magick::DrawableArc::~DrawableArc(
void )
225void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ )
const
227 DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
231 return new DrawableArc(*
this);
238Magick::DrawableBezier::DrawableBezier (
const CoordinateList &coordinates_ )
239 : _coordinates(coordinates_)
244 : DrawableBase (original_),
245 _coordinates(original_._coordinates)
249Magick::DrawableBezier::~DrawableBezier(
void )
252void 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);
278Magick::DrawableBorderColor::DrawableBorderColor(
const Magick::Color &color_)
283Magick::DrawableBorderColor::DrawableBorderColor
285 : DrawableBase(original_),
286 _color(original_._color)
290Magick::DrawableBorderColor::~DrawableBorderColor(
void)
294void 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);
310void Magick::DrawableBorderColor::color(
const Color &color_)
322 return(
new DrawableBorderColor(*
this));
327Magick::DrawableClipRule::DrawableClipRule(
const FillRule fillRule_)
332Magick::DrawableClipRule::~DrawableClipRule(
void)
336void Magick::DrawableClipRule::operator()(
337 MagickCore::DrawingWand * context_)
const
339 DrawSetClipRule(context_,_fillRule);
342void Magick::DrawableClipRule::fillRule(
const FillRule fillRule_)
347Magick::FillRule Magick::DrawableClipRule::fillRule(
void)
const
354 return(
new DrawableClipRule(*
this));
359Magick::DrawableClipUnits::DrawableClipUnits(
const ClipPathUnits units_)
364Magick::DrawableClipUnits::~DrawableClipUnits(
void)
368void Magick::DrawableClipUnits::operator()(
369 MagickCore::DrawingWand * context_)
const
371 DrawSetClipUnits(context_, _units);
374void Magick::DrawableClipUnits::units(
const ClipPathUnits units_)
379Magick::ClipPathUnits Magick::DrawableClipUnits::units(
void)
const
386 return(
new DrawableClipUnits(*
this));
395Magick::DrawablePopClipPath::~DrawablePopClipPath (
void )
398void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ )
const
400 DrawPopClipPath( context_ );
401 DrawPopDefs(context_);
405 return new DrawablePopClipPath(*
this);
409Magick::DrawablePushClipPath::DrawablePushClipPath(
const std::string &id_)
413Magick::DrawablePushClipPath::DrawablePushClipPath
415 : DrawableBase (original_),
416 _id(original_._id.c_str())
419Magick::DrawablePushClipPath::~DrawablePushClipPath(
void )
422void Magick::DrawablePushClipPath::operator()
423 ( MagickCore::DrawingWand * context_ )
const
425 DrawPushDefs(context_);
426 DrawPushClipPath( context_, _id.c_str());
430 return new DrawablePushClipPath(*
this);
435Magick::DrawableClipPath::DrawableClipPath(
const std::string &id_ )
441 : DrawableBase (original_),
442 _id(original_._id.c_str())
445Magick::DrawableClipPath::~DrawableClipPath(
void )
448void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ )
const
450 (void) DrawSetClipPath( context_, _id.c_str());
454 return new DrawableClipPath(*
this);
458Magick::DrawableCircle::~DrawableCircle (
void )
461void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ )
const
463 DrawCircle( context_, _originX, _originY, _perimX, _perimY );
467 return new DrawableCircle(*
this);
471Magick::DrawableColor::~DrawableColor(
void )
474void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ )
const
476 DrawColor( context_, _x, _y, _paintMethod );
480 return new DrawableColor(*
this);
484Magick::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_))
497Magick::DrawableCompositeImage::DrawableCompositeImage
498(
double x_,
double y_,
499 double width_,
double height_,
501 Magick::CompositeOperator composition_ )
502 : _composition(composition_),
507 _image(new Image(image_))
510Magick::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_))
522Magick::DrawableCompositeImage::DrawableCompositeImage
523(
double x_,
double y_,
524 double width_,
double height_,
526 :_composition(CopyCompositeOp),
531 _image(new Image(image_))
534Magick::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();
547Magick::DrawableCompositeImage::DrawableCompositeImage
548(
double x_,
double y_,
550 : _composition(CopyCompositeOp),
555 _image(new Image(image_))
557 _width=_image->columns();
558 _height=_image->rows();
561Magick::DrawableCompositeImage::DrawableCompositeImage
563 : Magick::DrawableBase(original_),
564 _composition(original_._composition),
567 _width(original_._width),
568 _height(original_._height),
569 _image(new Image(*original_._image))
572Magick::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);
594void Magick::DrawableCompositeImage::filename(
const std::string &filename_ )
596 Image* temp_image =
new Image(filename_);
600std::string Magick::DrawableCompositeImage::filename(
void )
const
602 return _image->fileName();
605void Magick::DrawableCompositeImage::image(
const Magick::Image &image_ )
607 Image* temp_image =
new Image(image_);
611Magick::Image Magick::DrawableCompositeImage::image(
void )
const
617void Magick::DrawableCompositeImage::magick( std::string magick_ )
619 _image->magick( magick_ );
621std::string Magick::DrawableCompositeImage::magick(
void )
623 return _image->magick();
626void 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);
643Magick::DrawableDensity::DrawableDensity(
const Point &density_)
648Magick::DrawableDensity::DrawableDensity(
const std::string &density_)
653Magick::DrawableDensity::~DrawableDensity(
void)
657void Magick::DrawableDensity::operator()(
658 MagickCore::DrawingWand *context_)
const
660 DrawSetDensity(context_,_density.c_str());
665 return(
new DrawableDensity(*
this));
669Magick::DrawableEllipse::~DrawableEllipse(
void )
672void Magick::DrawableEllipse::operator()
673 ( MagickCore::DrawingWand * context_ )
const
675 DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
676 _arcStart, _arcEnd );
680 return new DrawableEllipse(*
this);
684Magick::DrawableFillColor::DrawableFillColor(
const Magick::Color &color_ )
688Magick::DrawableFillColor::DrawableFillColor
690 : DrawableBase (original_),
691 _color(original_._color)
694Magick::DrawableFillColor::~DrawableFillColor(
void )
697void 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);
712Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
const std::string &url_)
717Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
719 : DrawableBase(original_),
724Magick::DrawableFillPatternUrl::~DrawableFillPatternUrl(
void)
728void Magick::DrawableFillPatternUrl::operator()(
729 MagickCore::DrawingWand * context_)
const
731 DrawSetFillPatternURL(context_, _url.c_str());
734void Magick::DrawableFillPatternUrl::url(
const std::string &url_)
739std::string Magick::DrawableFillPatternUrl::url(
void)
const
746 return(
new DrawableFillPatternUrl(*
this));
750Magick::DrawableFillRule::~DrawableFillRule (
void )
753void Magick::DrawableFillRule::operator()
754 ( MagickCore::DrawingWand * context_ )
const
756 DrawSetFillRule( context_, _fillRule );
760 return new DrawableFillRule(*
this);
763Magick::DrawableFillOpacity::~DrawableFillOpacity(
void)
767void Magick::DrawableFillOpacity::operator()
768 (MagickCore::DrawingWand *context_)
const
770 DrawSetFillOpacity(context_,_opacity);
775 return new DrawableFillOpacity(*
this);
779Magick::DrawableFont::DrawableFont (
const std::string &font_ )
782 _style(Magick::AnyStyle),
784 _stretch(Magick::NormalStretch)
787Magick::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)
807Magick::DrawableFont::~DrawableFont (
void )
810void 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);
839Magick::DrawableGravity::~DrawableGravity (
void )
842void Magick::DrawableGravity::operator()
843 ( MagickCore::DrawingWand * context_ )
const
845 DrawSetGravity( context_, _gravity );
849 return new DrawableGravity(*
this);
853Magick::DrawableLine::~DrawableLine (
void )
856void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ )
const
858 DrawLine( context_, _startX, _startY, _endX, _endY );
862 return new DrawableLine(*
this);
866Magick::DrawablePath::DrawablePath (
const VPathList &path_ )
871 : DrawableBase (original_),
872 _path(original_._path)
875Magick::DrawablePath::~DrawablePath (
void )
878void 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);
894Magick::DrawablePoint::~DrawablePoint (
void )
897void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ )
const
899 DrawPoint( context_, _x, _y );
903 return new DrawablePoint(*
this);
907Magick::DrawablePointSize::~DrawablePointSize (
void )
910void Magick::DrawablePointSize::operator()
911 ( MagickCore::DrawingWand * context_ )
const
913 DrawSetFontSize( context_, _pointSize );
917 return new DrawablePointSize(*
this);
921Magick::DrawablePolygon::DrawablePolygon (
const CoordinateList &coordinates_ )
922 : _coordinates(coordinates_)
925Magick::DrawablePolygon::DrawablePolygon
927 : DrawableBase (original_),
928 _coordinates(original_._coordinates)
931Magick::DrawablePolygon::~DrawablePolygon (
void )
934void 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);
960Magick::DrawablePolyline::DrawablePolyline
961(
const CoordinateList &coordinates_ )
962 : _coordinates(coordinates_)
965Magick::DrawablePolyline::DrawablePolyline
967 : DrawableBase (original_),
968 _coordinates(original_._coordinates)
971Magick::DrawablePolyline::~DrawablePolyline (
void )
974void 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);
1000Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext (
void )
1003void Magick::DrawablePopGraphicContext::operator()
1004 ( MagickCore::DrawingWand * context_ )
const
1006 PopDrawingWand( context_ );
1010 return new DrawablePopGraphicContext(*
this);
1014Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext (
void )
1017void Magick::DrawablePushGraphicContext::operator()
1018 ( MagickCore::DrawingWand * context_ )
const
1020 PushDrawingWand( context_ );
1024 return new DrawablePushGraphicContext(*
this);
1028Magick::DrawablePopPattern::~DrawablePopPattern (
void )
1031void Magick::DrawablePopPattern::operator()
1032 ( MagickCore::DrawingWand * context_ )
const
1034 (void) DrawPopPattern( context_ );
1038 return new DrawablePopPattern(*
this);
1042Magick::DrawablePushPattern::DrawablePushPattern
1043(
const std::string &id_, ssize_t x_, ssize_t y_,
1044 size_t width_,
size_t height_ )
1052Magick::DrawablePushPattern::DrawablePushPattern
1054 : DrawableBase (original_),
1058 _width(original_._width),
1059 _height(original_._height)
1062Magick::DrawablePushPattern::~DrawablePushPattern (
void )
1065void Magick::DrawablePushPattern::operator()
1066 ( MagickCore::DrawingWand * context_ )
const
1068 (void) DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height );
1072 return new DrawablePushPattern(*
this);
1076Magick::DrawableRectangle::~DrawableRectangle (
void )
1079void Magick::DrawableRectangle::operator()
1080 ( MagickCore::DrawingWand * context_ )
const
1082 DrawRectangle( context_, _upperLeftX, _upperLeftY,
1083 _lowerRightX, _lowerRightY );
1087 return new DrawableRectangle(*
this);
1091Magick::DrawableRotation::~DrawableRotation (
void )
1094void Magick::DrawableRotation::operator()
1095 ( MagickCore::DrawingWand * context_ )
const
1097 DrawRotate( context_, _angle );
1101 return new DrawableRotation(*
this);
1105Magick::DrawableRoundRectangle::~DrawableRoundRectangle (
void )
1108void Magick::DrawableRoundRectangle::operator()
1109 ( MagickCore::DrawingWand * context_ )
const
1111 DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX,
1112 _lowerRightY,_cornerWidth, _cornerHeight);
1116 return new DrawableRoundRectangle(*
this);
1120Magick::DrawableScaling::~DrawableScaling (
void )
1123void Magick::DrawableScaling::operator()
1124 ( MagickCore::DrawingWand * context_ )
const
1126 DrawScale( context_, _x, _y );
1130 return new DrawableScaling(*
this);
1134Magick::DrawableSkewX::~DrawableSkewX (
void )
1137void Magick::DrawableSkewX::operator()
1138 ( MagickCore::DrawingWand * context_ )
const
1140 DrawSkewX( context_, _angle );
1144 return new DrawableSkewX(*
this);
1148Magick::DrawableSkewY::~DrawableSkewY (
void )
1151void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ )
const
1153 DrawSkewY( context_, _angle );
1157 return new DrawableSkewY(*
this);
1161Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
const double* dasharray_)
1165 dasharray(dasharray_);
1168Magick::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;
1182Magick::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;
1207void Magick::DrawableStrokeDashArray::operator()(
1208 MagickCore::DrawingWand *context_)
const
1210 (void) DrawSetStrokeDashArray(context_,(
unsigned long) _size,_dasharray);
1215 return(
new DrawableStrokeDashArray(*
this));
1218void 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;
1252const double* Magick::DrawableStrokeDashArray::dasharray(
void)
const
1258Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(
void)
1262void Magick::DrawableStrokeDashOffset::operator()
1263 ( MagickCore::DrawingWand * context_)
const
1265 DrawSetStrokeDashOffset(context_,_offset);
1270 return(
new DrawableStrokeDashOffset(*
this));
1273void Magick::DrawableStrokeDashOffset::offset(
const double offset_)
1278double Magick::DrawableStrokeDashOffset::offset(
void)
const
1284Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap (
void )
1287void Magick::DrawableStrokeLineCap::operator()
1288 ( MagickCore::DrawingWand * context_ )
const
1290 DrawSetStrokeLineCap( context_, _linecap );
1294 return new DrawableStrokeLineCap(*
this);
1298Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin (
void )
1301void Magick::DrawableStrokeLineJoin::operator()
1302 ( MagickCore::DrawingWand * context_ )
const
1304 DrawSetStrokeLineJoin( context_, _linejoin );
1308 return new DrawableStrokeLineJoin(*
this);
1312Magick::DrawableMiterLimit::~DrawableMiterLimit (
void )
1315void Magick::DrawableMiterLimit::operator()
1316 ( MagickCore::DrawingWand * context_ )
const
1318 DrawSetStrokeMiterLimit( context_, _miterlimit );
1322 return new DrawableMiterLimit(*
this);
1327Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1328 const std::string &url_)
1333Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1335 : DrawableBase(original_),
1336 _url(original_._url)
1340Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(
void)
1344void Magick::DrawableStrokePatternUrl::operator()(
1345 MagickCore::DrawingWand * context_)
const
1347 DrawSetStrokePatternURL(context_, _url.c_str());
1350void Magick::DrawableStrokePatternUrl::url(
const std::string &url_)
1355std::string Magick::DrawableStrokePatternUrl::url(
void)
const
1362 return(
new DrawableStrokePatternUrl(*
this));
1366Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias (
void )
1369void Magick::DrawableStrokeAntialias::operator()
1370( MagickCore::DrawingWand * context_ )
const
1372 DrawSetStrokeAntialias( context_,
static_cast<MagickBooleanType
>
1373 (_flag ? MagickTrue : MagickFalse) );
1377 return new DrawableStrokeAntialias(*
this);
1381Magick::DrawableStrokeColor::DrawableStrokeColor
1386Magick::DrawableStrokeColor::DrawableStrokeColor
1388 : DrawableBase (original_),
1389 _color(original_._color)
1392Magick::DrawableStrokeColor::~DrawableStrokeColor (
void )
1395void 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);
1409Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(
void)
1413void Magick::DrawableStrokeOpacity::operator()
1414 (MagickCore::DrawingWand * context_)
const
1416 DrawSetStrokeOpacity(context_,_opacity);
1421 return new DrawableStrokeOpacity(*
this);
1425Magick::DrawableStrokeWidth::~DrawableStrokeWidth (
void )
1428void Magick::DrawableStrokeWidth::operator()
1429 ( MagickCore::DrawingWand * context_ )
const
1431 DrawSetStrokeWidth( context_, _width );
1435 return new DrawableStrokeWidth(*
this);
1439Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1440 const std::string &text_ )
1447Magick::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)
1463Magick::DrawableText::~DrawableText (
void )
1466void 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);
1479Magick::DrawableTextAlignment::DrawableTextAlignment(
1480 Magick::AlignType alignment_)
1481 : _alignment(alignment_)
1485Magick::DrawableTextAlignment::DrawableTextAlignment
1487 : DrawableBase(original_),
1488 _alignment(original_._alignment)
1492Magick::DrawableTextAlignment::~DrawableTextAlignment(
void)
1496void Magick::DrawableTextAlignment::operator()(
1497 MagickCore::DrawingWand * context_)
const
1499 DrawSetTextAlignment(context_, _alignment);
1502void Magick::DrawableTextAlignment::alignment(AlignType alignment_)
1504 _alignment=alignment_;
1507Magick::AlignType Magick::DrawableTextAlignment::alignment(
void)
const
1514 return new DrawableTextAlignment(*
this);
1518Magick::DrawableTextAntialias::DrawableTextAntialias (
bool flag_ )
1523 : DrawableBase (original_),
1524 _flag(original_._flag)
1527Magick::DrawableTextAntialias::~DrawableTextAntialias (
void )
1530void Magick::DrawableTextAntialias::operator()
1531 ( MagickCore::DrawingWand * context_ )
const
1533 DrawSetTextAntialias( context_,
static_cast<MagickBooleanType
>
1534 (_flag ? MagickTrue : MagickFalse) );
1538 return new DrawableTextAntialias(*
this);
1543Magick::DrawableTextDecoration::DrawableTextDecoration
1544 ( Magick::DecorationType decoration_ )
1545 : _decoration(decoration_)
1548Magick::DrawableTextDecoration::DrawableTextDecoration
1550 : DrawableBase (original_),
1551 _decoration(original_._decoration)
1554Magick::DrawableTextDecoration::~DrawableTextDecoration(
void )
1557void Magick::DrawableTextDecoration::operator()
1558 ( MagickCore::DrawingWand * context_ )
const
1560 DrawSetTextDecoration( context_, _decoration );
1564 return new DrawableTextDecoration(*
this);
1568Magick::DrawableTextDirection::DrawableTextDirection(
1569 DirectionType direction_)
1570 : _direction(direction_)
1574Magick::DrawableTextDirection::~DrawableTextDirection(
void)
1578void Magick::DrawableTextDirection::operator()(
1579 MagickCore::DrawingWand *context_)
const
1581 DrawSetTextDirection(context_,_direction);
1584void Magick::DrawableTextDirection::direction(DirectionType direction_)
1586 _direction=direction_;
1589Magick::DirectionType Magick::DrawableTextDirection::direction(
void)
const
1596 return new DrawableTextDirection(*
this);
1600Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1602 : _spacing(spacing_)
1606Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(
void)
1610void Magick::DrawableTextInterlineSpacing::operator()(
1611 MagickCore::DrawingWand *context_)
const
1613 DrawSetTextInterlineSpacing(context_,_spacing);
1616void Magick::DrawableTextInterlineSpacing::spacing(
double spacing_)
1621double Magick::DrawableTextInterlineSpacing::spacing(
void)
const
1628 return new DrawableTextInterlineSpacing(*
this);
1632Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1634 : _spacing(spacing_)
1638Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(
void)
1642void Magick::DrawableTextInterwordSpacing::operator()(
1643 MagickCore::DrawingWand *context_)
const
1645 DrawSetTextInterwordSpacing(context_,_spacing);
1648void Magick::DrawableTextInterwordSpacing::spacing(
double spacing_)
1653double Magick::DrawableTextInterwordSpacing::spacing(
void)
const
1660 return new DrawableTextInterwordSpacing(*
this);
1664Magick::DrawableTextKerning::DrawableTextKerning(
1666 : _kerning(kerning_)
1670Magick::DrawableTextKerning::~DrawableTextKerning(
void)
1674void Magick::DrawableTextKerning::operator()(
1675 MagickCore::DrawingWand *context_)
const
1677 DrawSetTextKerning(context_,_kerning);
1680void Magick::DrawableTextKerning::kerning(
double kerning_)
1685double Magick::DrawableTextKerning::kerning(
void)
const
1692 return new DrawableTextKerning(*
this);
1696Magick::DrawableTextUnderColor::DrawableTextUnderColor
1701Magick::DrawableTextUnderColor::DrawableTextUnderColor
1703 : DrawableBase (original_),
1704 _color(original_._color)
1707Magick::DrawableTextUnderColor::~DrawableTextUnderColor (
void )
1710void 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);
1725Magick::DrawableTranslation::~DrawableTranslation (
void )
1728void Magick::DrawableTranslation::operator()
1729 ( MagickCore::DrawingWand * context_ )
const
1731 DrawTranslate( context_, _x, _y );
1735 return new DrawableTranslation(*
this);
1739Magick::DrawableViewbox::~DrawableViewbox (
void )
1742void 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_ ) );
1790Magick::PathArcArgs::PathArcArgs(
void )
1794 _largeArcFlag(false),
1801Magick::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),
1825Magick::PathArcArgs::~PathArcArgs (
void )
1831 : _coordinates(1,coordinates_)
1834Magick::PathArcAbs::PathArcAbs (
const PathArcArgsList &coordinates_ )
1835 : _coordinates(coordinates_)
1839 : VPathBase (original_),
1840 _coordinates(original_._coordinates)
1843Magick::PathArcAbs::~PathArcAbs (
void )
1846void 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_)
1865Magick::PathArcRel::PathArcRel (
const PathArcArgsList &coordinates_ )
1866 : _coordinates(coordinates_)
1870 : VPathBase (original_),
1871 _coordinates(original_._coordinates)
1874Magick::PathArcRel::~PathArcRel (
void )
1877void 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);
1895Magick::PathClosePath::~PathClosePath (
void )
1898void 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_ ) );
1941Magick::PathCurvetoArgs::PathCurvetoArgs(
void )
1951Magick::PathCurvetoArgs::PathCurvetoArgs(
double x1_,
double y1_,
1952 double x2_,
double y2_,
1953 double x_,
double y_ )
1963Magick::PathCurvetoArgs::PathCurvetoArgs(
const PathCurvetoArgs &original_ )
1964 : _x1(original_._x1),
1973Magick::PathCurvetoArgs::~PathCurvetoArgs (
void )
1981Magick::PathCurvetoAbs::PathCurvetoAbs (
const PathCurveToArgsList &args_ )
1985Magick::PathCurvetoAbs::PathCurvetoAbs
1987 : VPathBase (original_),
1988 _args(original_._args)
1991Magick::PathCurvetoAbs::~PathCurvetoAbs (
void )
1994void 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);
2012Magick::PathCurvetoRel::PathCurvetoRel (
const PathCurveToArgsList &args_ )
2016Magick::PathCurvetoRel::PathCurvetoRel
2018 : VPathBase (original_),
2019 _args(original_._args)
2022Magick::PathCurvetoRel::~PathCurvetoRel (
void )
2025void 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);
2039Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2041 : _coordinates(1,coordinates_)
2044Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2045(
const CoordinateList &coordinates_ )
2046 : _coordinates(coordinates_)
2049Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2051 : VPathBase (original_),
2052 _coordinates(original_._coordinates)
2055Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs (
void )
2058void 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);
2076Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2078 : _coordinates(1,coordinates_)
2081Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2082(
const CoordinateList &coordinates_ )
2083 : _coordinates(coordinates_)
2086Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2088 : VPathBase (original_),
2089 _coordinates(original_._coordinates)
2092Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel (
void )
2095void 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);
2117MagickPPExport
int Magick::operator ==
2123MagickPPExport
int Magick::operator !=
2129MagickPPExport
int Magick::operator >
2135MagickPPExport
int Magick::operator <
2141MagickPPExport
int Magick::operator >=
2145 return ( ( left_ > right_ ) || ( left_ == right_ ) );
2147MagickPPExport
int Magick::operator <=
2151 return ( ( left_ < right_ ) || ( left_ == right_ ) );
2154Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
void )
2162Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
double x1_,
2173Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
const PathQuadraticCurvetoArgs &original_ )
2174 : _x1(original_._x1),
2181Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs (
void )
2185Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2190Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2191(
const PathQuadraticCurvetoArgsList &args_ )
2195Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2197 : VPathBase (original_),
2198 _args(original_._args)
2201Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs (
void )
2204void 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);
2218Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2223Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2224(
const PathQuadraticCurvetoArgsList &args_ )
2228Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2230 : VPathBase (original_),
2231 _args(original_._args)
2234Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel (
void )
2237void 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);
2251Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2253 : _coordinates(1,coordinate_)
2256Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2257(
const CoordinateList &coordinates_ )
2258 : _coordinates(coordinates_)
2261Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2263 : VPathBase (original_),
2264 _coordinates(original_._coordinates)
2267Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs (
void )
2270void 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);
2283Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2285 : _coordinates(1,coordinate_)
2288Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2289(
const CoordinateList &coordinates_ )
2290 : _coordinates(coordinates_)
2293Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2294(
const PathSmoothQuadraticCurvetoRel& original_ )
2295 : VPathBase (original_),
2296 _coordinates(original_._coordinates)
2299Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel (
void )
2302void 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_)
2323Magick::PathLinetoAbs::PathLinetoAbs (
const CoordinateList &coordinates_ )
2324 : _coordinates(coordinates_)
2328 : VPathBase (original_),
2329 _coordinates(original_._coordinates)
2332Magick::PathLinetoAbs::~PathLinetoAbs (
void )
2335void 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_)
2351Magick::PathLinetoRel::PathLinetoRel (
const CoordinateList &coordinates_ )
2352 : _coordinates(coordinates_)
2356 : VPathBase (original_),
2357 _coordinates(original_._coordinates)
2360Magick::PathLinetoRel::~PathLinetoRel (
void )
2363void 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);
2380Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs (
void )
2383void Magick::PathLinetoHorizontalAbs::operator()
2384 ( MagickCore::DrawingWand * context_ )
const
2386 DrawPathLineToHorizontalAbsolute( context_, _x );
2390 return new PathLinetoHorizontalAbs(*
this);
2392Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel (
void )
2395void Magick::PathLinetoHorizontalRel::operator()
2396 ( MagickCore::DrawingWand * context_ )
const
2398 DrawPathLineToHorizontalRelative( context_, _x );
2402 return new PathLinetoHorizontalRel(*
this);
2408Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs (
void )
2411void Magick::PathLinetoVerticalAbs::operator()
2412 ( MagickCore::DrawingWand * context_ )
const
2414 DrawPathLineToVerticalAbsolute( context_, _y );
2418 return new PathLinetoVerticalAbs(*
this);
2420Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel (
void )
2423void Magick::PathLinetoVerticalRel::operator()
2424 ( MagickCore::DrawingWand * context_ )
const
2426 DrawPathLineToVerticalRelative( context_, _y );
2430 return new PathLinetoVerticalRel(*
this);
2438 : _coordinates(1,coordinate_)
2441Magick::PathMovetoAbs::PathMovetoAbs (
const CoordinateList &coordinates_ )
2442 : _coordinates(coordinates_)
2446 : VPathBase (original_),
2447 _coordinates(original_._coordinates)
2450Magick::PathMovetoAbs::~PathMovetoAbs (
void )
2453void 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_)
2469Magick::PathMovetoRel::PathMovetoRel (
const CoordinateList &coordinates_ )
2470 : _coordinates(coordinates_)
2474 : VPathBase (original_),
2475 _coordinates(original_._coordinates)
2478Magick::PathMovetoRel::~PathMovetoRel (
void )
2481void 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);