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=(double) _image->columns();
545 _height=(double) _image->rows();
547Magick::DrawableCompositeImage::DrawableCompositeImage
548(
double x_,
double y_,
550 : _composition(CopyCompositeOp),
555 _image(new Image(image_))
557 _width=(double) _image->columns();
558 _height=(double) _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(), (double) _x, (
double) _y,
1069 (double) _width, (
double) _height);
1073 return new DrawablePushPattern(*
this);
1077Magick::DrawableRectangle::~DrawableRectangle (
void )
1080void Magick::DrawableRectangle::operator()
1081 ( MagickCore::DrawingWand * context_ )
const
1083 DrawRectangle( context_, _upperLeftX, _upperLeftY,
1084 _lowerRightX, _lowerRightY );
1088 return new DrawableRectangle(*
this);
1092Magick::DrawableRotation::~DrawableRotation (
void )
1095void Magick::DrawableRotation::operator()
1096 ( MagickCore::DrawingWand * context_ )
const
1098 DrawRotate( context_, _angle );
1102 return new DrawableRotation(*
this);
1106Magick::DrawableRoundRectangle::~DrawableRoundRectangle (
void )
1109void Magick::DrawableRoundRectangle::operator()
1110 ( MagickCore::DrawingWand * context_ )
const
1112 DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX,
1113 _lowerRightY,_cornerWidth, _cornerHeight);
1117 return new DrawableRoundRectangle(*
this);
1121Magick::DrawableScaling::~DrawableScaling (
void )
1124void Magick::DrawableScaling::operator()
1125 ( MagickCore::DrawingWand * context_ )
const
1127 DrawScale( context_, _x, _y );
1131 return new DrawableScaling(*
this);
1135Magick::DrawableSkewX::~DrawableSkewX (
void )
1138void Magick::DrawableSkewX::operator()
1139 ( MagickCore::DrawingWand * context_ )
const
1141 DrawSkewX( context_, _angle );
1145 return new DrawableSkewX(*
this);
1149Magick::DrawableSkewY::~DrawableSkewY (
void )
1152void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ )
const
1154 DrawSkewY( context_, _angle );
1158 return new DrawableSkewY(*
this);
1162Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
const double* dasharray_)
1166 dasharray(dasharray_);
1169Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
1171 : DrawableBase (original_),
1172 _size(original_._size),
1173 _dasharray(new double[_size+1])
1177 for (
size_t i=0; i < _size; i++)
1178 _dasharray[i]=original_._dasharray[i];
1179 _dasharray[_size]=0.0;
1183Magick::DrawableStrokeDashArray::~DrawableStrokeDashArray(
void)
1185 delete [] _dasharray;
1187 _dasharray=(
double *) NULL;
1193 if (
this != &original_)
1195 delete [] _dasharray;
1196 _size=original_._size;
1197 _dasharray =
new double[_size+1];
1200 for (
size_t i=0; i < _size; i++)
1201 _dasharray[i]=original_._dasharray[i];
1202 _dasharray[_size]=0.0;
1208void Magick::DrawableStrokeDashArray::operator()(
1209 MagickCore::DrawingWand *context_)
const
1211 (void) DrawSetStrokeDashArray(context_,(
unsigned long) _size,_dasharray);
1216 return(
new DrawableStrokeDashArray(*
this));
1219void Magick::DrawableStrokeDashArray::dasharray(
const double* dasharray_)
1224 delete [] _dasharray;
1228 if (dasharray_ != (
const double *) NULL)
1243 _dasharray=
new double[_size+1];
1246 for (
size_t i=0; i < _size; i++)
1247 _dasharray[i]=dasharray_[i];
1248 _dasharray[_size]=0.0;
1253const double* Magick::DrawableStrokeDashArray::dasharray(
void)
const
1259Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(
void)
1263void Magick::DrawableStrokeDashOffset::operator()
1264 ( MagickCore::DrawingWand * context_)
const
1266 DrawSetStrokeDashOffset(context_,_offset);
1271 return(
new DrawableStrokeDashOffset(*
this));
1274void Magick::DrawableStrokeDashOffset::offset(
const double offset_)
1279double Magick::DrawableStrokeDashOffset::offset(
void)
const
1285Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap (
void )
1288void Magick::DrawableStrokeLineCap::operator()
1289 ( MagickCore::DrawingWand * context_ )
const
1291 DrawSetStrokeLineCap( context_, _linecap );
1295 return new DrawableStrokeLineCap(*
this);
1299Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin (
void )
1302void Magick::DrawableStrokeLineJoin::operator()
1303 ( MagickCore::DrawingWand * context_ )
const
1305 DrawSetStrokeLineJoin( context_, _linejoin );
1309 return new DrawableStrokeLineJoin(*
this);
1313Magick::DrawableMiterLimit::~DrawableMiterLimit (
void )
1316void Magick::DrawableMiterLimit::operator()
1317 ( MagickCore::DrawingWand * context_ )
const
1319 DrawSetStrokeMiterLimit( context_, _miterlimit );
1323 return new DrawableMiterLimit(*
this);
1328Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1329 const std::string &url_)
1334Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1336 : DrawableBase(original_),
1337 _url(original_._url)
1341Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(
void)
1345void Magick::DrawableStrokePatternUrl::operator()(
1346 MagickCore::DrawingWand * context_)
const
1348 DrawSetStrokePatternURL(context_, _url.c_str());
1351void Magick::DrawableStrokePatternUrl::url(
const std::string &url_)
1356std::string Magick::DrawableStrokePatternUrl::url(
void)
const
1363 return(
new DrawableStrokePatternUrl(*
this));
1367Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias (
void )
1370void Magick::DrawableStrokeAntialias::operator()
1371( MagickCore::DrawingWand * context_ )
const
1373 DrawSetStrokeAntialias( context_,
static_cast<MagickBooleanType
>
1374 (_flag ? MagickTrue : MagickFalse) );
1378 return new DrawableStrokeAntialias(*
this);
1382Magick::DrawableStrokeColor::DrawableStrokeColor
1387Magick::DrawableStrokeColor::DrawableStrokeColor
1389 : DrawableBase (original_),
1390 _color(original_._color)
1393Magick::DrawableStrokeColor::~DrawableStrokeColor (
void )
1396void Magick::DrawableStrokeColor::operator()
1397 ( MagickCore::DrawingWand * context_ )
const
1399 PixelInfo color =
static_cast<PixelInfo
>(_color);
1400 PixelWand *pixel_wand=NewPixelWand();
1401 PixelSetPixelColor(pixel_wand,&color);
1402 DrawSetStrokeColor(context_,pixel_wand);
1403 pixel_wand=DestroyPixelWand(pixel_wand);
1407 return new DrawableStrokeColor(*
this);
1410Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(
void)
1414void Magick::DrawableStrokeOpacity::operator()
1415 (MagickCore::DrawingWand * context_)
const
1417 DrawSetStrokeOpacity(context_,_opacity);
1422 return new DrawableStrokeOpacity(*
this);
1426Magick::DrawableStrokeWidth::~DrawableStrokeWidth (
void )
1429void Magick::DrawableStrokeWidth::operator()
1430 ( MagickCore::DrawingWand * context_ )
const
1432 DrawSetStrokeWidth( context_, _width );
1436 return new DrawableStrokeWidth(*
this);
1440Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1441 const std::string &text_ )
1448Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1449 const std::string &text_,
const std::string &encoding_)
1453 _encoding(encoding_)
1457 : DrawableBase (original_),
1460 _text(original_._text),
1461 _encoding(original_._encoding)
1464Magick::DrawableText::~DrawableText (
void )
1467void Magick::DrawableText::operator()
1468 ( MagickCore::DrawingWand * context_ )
const
1470 DrawSetTextEncoding( context_, _encoding.c_str() );
1471 DrawAnnotation( context_, _x, _y,
1472 reinterpret_cast<const unsigned char*
>(_text.c_str()) );
1476 return new DrawableText(*
this);
1480Magick::DrawableTextAlignment::DrawableTextAlignment(
1481 Magick::AlignType alignment_)
1482 : _alignment(alignment_)
1486Magick::DrawableTextAlignment::DrawableTextAlignment
1488 : DrawableBase(original_),
1489 _alignment(original_._alignment)
1493Magick::DrawableTextAlignment::~DrawableTextAlignment(
void)
1497void Magick::DrawableTextAlignment::operator()(
1498 MagickCore::DrawingWand * context_)
const
1500 DrawSetTextAlignment(context_, _alignment);
1503void Magick::DrawableTextAlignment::alignment(AlignType alignment_)
1505 _alignment=alignment_;
1508Magick::AlignType Magick::DrawableTextAlignment::alignment(
void)
const
1515 return new DrawableTextAlignment(*
this);
1519Magick::DrawableTextAntialias::DrawableTextAntialias (
bool flag_ )
1524 : DrawableBase (original_),
1525 _flag(original_._flag)
1528Magick::DrawableTextAntialias::~DrawableTextAntialias (
void )
1531void Magick::DrawableTextAntialias::operator()
1532 ( MagickCore::DrawingWand * context_ )
const
1534 DrawSetTextAntialias( context_,
static_cast<MagickBooleanType
>
1535 (_flag ? MagickTrue : MagickFalse) );
1539 return new DrawableTextAntialias(*
this);
1544Magick::DrawableTextDecoration::DrawableTextDecoration
1545 ( Magick::DecorationType decoration_ )
1546 : _decoration(decoration_)
1549Magick::DrawableTextDecoration::DrawableTextDecoration
1551 : DrawableBase (original_),
1552 _decoration(original_._decoration)
1555Magick::DrawableTextDecoration::~DrawableTextDecoration(
void )
1558void Magick::DrawableTextDecoration::operator()
1559 ( MagickCore::DrawingWand * context_ )
const
1561 DrawSetTextDecoration( context_, _decoration );
1565 return new DrawableTextDecoration(*
this);
1569Magick::DrawableTextDirection::DrawableTextDirection(
1570 DirectionType direction_)
1571 : _direction(direction_)
1575Magick::DrawableTextDirection::~DrawableTextDirection(
void)
1579void Magick::DrawableTextDirection::operator()(
1580 MagickCore::DrawingWand *context_)
const
1582 DrawSetTextDirection(context_,_direction);
1585void Magick::DrawableTextDirection::direction(DirectionType direction_)
1587 _direction=direction_;
1590Magick::DirectionType Magick::DrawableTextDirection::direction(
void)
const
1597 return new DrawableTextDirection(*
this);
1601Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1603 : _spacing(spacing_)
1607Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(
void)
1611void Magick::DrawableTextInterlineSpacing::operator()(
1612 MagickCore::DrawingWand *context_)
const
1614 DrawSetTextInterlineSpacing(context_,_spacing);
1617void Magick::DrawableTextInterlineSpacing::spacing(
double spacing_)
1622double Magick::DrawableTextInterlineSpacing::spacing(
void)
const
1629 return new DrawableTextInterlineSpacing(*
this);
1633Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1635 : _spacing(spacing_)
1639Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(
void)
1643void Magick::DrawableTextInterwordSpacing::operator()(
1644 MagickCore::DrawingWand *context_)
const
1646 DrawSetTextInterwordSpacing(context_,_spacing);
1649void Magick::DrawableTextInterwordSpacing::spacing(
double spacing_)
1654double Magick::DrawableTextInterwordSpacing::spacing(
void)
const
1661 return new DrawableTextInterwordSpacing(*
this);
1665Magick::DrawableTextKerning::DrawableTextKerning(
1667 : _kerning(kerning_)
1671Magick::DrawableTextKerning::~DrawableTextKerning(
void)
1675void Magick::DrawableTextKerning::operator()(
1676 MagickCore::DrawingWand *context_)
const
1678 DrawSetTextKerning(context_,_kerning);
1681void Magick::DrawableTextKerning::kerning(
double kerning_)
1686double Magick::DrawableTextKerning::kerning(
void)
const
1693 return new DrawableTextKerning(*
this);
1697Magick::DrawableTextUnderColor::DrawableTextUnderColor
1702Magick::DrawableTextUnderColor::DrawableTextUnderColor
1704 : DrawableBase (original_),
1705 _color(original_._color)
1708Magick::DrawableTextUnderColor::~DrawableTextUnderColor (
void )
1711void Magick::DrawableTextUnderColor::operator()
1712 ( MagickCore::DrawingWand * context_ )
const
1714 PixelInfo color =
static_cast<PixelInfo
>(_color);
1715 PixelWand *pixel_wand=NewPixelWand();
1716 PixelSetPixelColor(pixel_wand,&color);
1717 DrawSetTextUnderColor(context_,pixel_wand);
1718 pixel_wand=DestroyPixelWand(pixel_wand);
1722 return new DrawableTextUnderColor(*
this);
1726Magick::DrawableTranslation::~DrawableTranslation (
void )
1729void Magick::DrawableTranslation::operator()
1730 ( MagickCore::DrawingWand * context_ )
const
1732 DrawTranslate( context_, _x, _y );
1736 return new DrawableTranslation(*
this);
1740Magick::DrawableViewbox::~DrawableViewbox (
void )
1743void Magick::DrawableViewbox::operator()
1744 ( MagickCore::DrawingWand * context_ )
const
1746 DrawSetViewbox( context_, (
double) _x1, (
double) _y1, (
double) _x2,
1751 return new DrawableViewbox(*
this);
1784 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1789 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1792Magick::PathArcArgs::PathArcArgs(
void )
1796 _largeArcFlag(false),
1803Magick::PathArcArgs::PathArcArgs(
double radiusX_,
double radiusY_,
1804 double xAxisRotation_,
bool largeArcFlag_,
1805 bool sweepFlag_,
double x_,
double y_ )
1806 : _radiusX(radiusX_),
1808 _xAxisRotation(xAxisRotation_),
1809 _largeArcFlag(largeArcFlag_),
1810 _sweepFlag(sweepFlag_),
1817 : _radiusX(original_._radiusX),
1818 _radiusY(original_._radiusY),
1819 _xAxisRotation(original_._xAxisRotation),
1820 _largeArcFlag(original_._largeArcFlag),
1821 _sweepFlag(original_._sweepFlag),
1827Magick::PathArcArgs::~PathArcArgs (
void )
1833 : _coordinates(1,coordinates_)
1836Magick::PathArcAbs::PathArcAbs (
const PathArcArgsList &coordinates_ )
1837 : _coordinates(coordinates_)
1841 : VPathBase (original_),
1842 _coordinates(original_._coordinates)
1845Magick::PathArcAbs::~PathArcAbs (
void )
1848void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ )
const
1850 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1851 p != _coordinates.end(); p++ )
1853 DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1854 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1855 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1860 return new PathArcAbs(*
this);
1864 : _coordinates(1,coordinates_)
1867Magick::PathArcRel::PathArcRel (
const PathArcArgsList &coordinates_ )
1868 : _coordinates(coordinates_)
1872 : VPathBase (original_),
1873 _coordinates(original_._coordinates)
1876Magick::PathArcRel::~PathArcRel (
void )
1879void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ )
const
1881 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1882 p != _coordinates.end(); p++ )
1884 DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1885 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1886 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1891 return new PathArcRel(*
this);
1897Magick::PathClosePath::~PathClosePath (
void )
1900void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ )
const
1902 DrawPathClose( context_ );
1906 return new PathClosePath(*
this);
1935 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1940 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1943Magick::PathCurvetoArgs::PathCurvetoArgs(
void )
1953Magick::PathCurvetoArgs::PathCurvetoArgs(
double x1_,
double y1_,
1954 double x2_,
double y2_,
1955 double x_,
double y_ )
1965Magick::PathCurvetoArgs::PathCurvetoArgs(
const PathCurvetoArgs &original_ )
1966 : _x1(original_._x1),
1975Magick::PathCurvetoArgs::~PathCurvetoArgs (
void )
1983Magick::PathCurvetoAbs::PathCurvetoAbs (
const PathCurveToArgsList &args_ )
1987Magick::PathCurvetoAbs::PathCurvetoAbs
1989 : VPathBase (original_),
1990 _args(original_._args)
1993Magick::PathCurvetoAbs::~PathCurvetoAbs (
void )
1996void Magick::PathCurvetoAbs::operator()
1997 ( MagickCore::DrawingWand * context_ )
const
1999 for( PathCurveToArgsList::const_iterator p = _args.begin();
2000 p != _args.end(); p++ )
2002 DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2008 return new PathCurvetoAbs(*
this);
2014Magick::PathCurvetoRel::PathCurvetoRel (
const PathCurveToArgsList &args_ )
2018Magick::PathCurvetoRel::PathCurvetoRel
2020 : VPathBase (original_),
2021 _args(original_._args)
2024Magick::PathCurvetoRel::~PathCurvetoRel (
void )
2027void Magick::PathCurvetoRel::operator()
2028 ( MagickCore::DrawingWand * context_ )
const
2030 for( PathCurveToArgsList::const_iterator p = _args.begin();
2031 p != _args.end(); p++ )
2033 DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2039 return new PathCurvetoRel(*
this);
2041Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2043 : _coordinates(1,coordinates_)
2046Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2047(
const CoordinateList &coordinates_ )
2048 : _coordinates(coordinates_)
2051Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2053 : VPathBase (original_),
2054 _coordinates(original_._coordinates)
2057Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs (
void )
2060void Magick::PathSmoothCurvetoAbs::operator()
2061 ( MagickCore::DrawingWand * context_ )
const
2063 for( CoordinateList::const_iterator p = _coordinates.begin();
2064 p != _coordinates.end(); p++ )
2069 if (p == _coordinates.end() )
2071 DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
2076 return new PathSmoothCurvetoAbs(*
this);
2078Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2080 : _coordinates(1,coordinates_)
2083Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2084(
const CoordinateList &coordinates_ )
2085 : _coordinates(coordinates_)
2088Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2090 : VPathBase (original_),
2091 _coordinates(original_._coordinates)
2094Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel (
void )
2097void Magick::PathSmoothCurvetoRel::operator()
2098 ( MagickCore::DrawingWand * context_ )
const
2100 for( CoordinateList::const_iterator p = _coordinates.begin();
2101 p != _coordinates.end(); p++ )
2106 if (p == _coordinates.end() )
2108 DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
2113 return new PathSmoothCurvetoRel(*
this);
2119MagickPPExport
int Magick::operator ==
2125MagickPPExport
int Magick::operator !=
2131MagickPPExport
int Magick::operator >
2137MagickPPExport
int Magick::operator <
2143MagickPPExport
int Magick::operator >=
2147 return ( ( left_ > right_ ) || ( left_ == right_ ) );
2149MagickPPExport
int Magick::operator <=
2153 return ( ( left_ < right_ ) || ( left_ == right_ ) );
2156Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
void )
2164Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
double x1_,
2175Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
const PathQuadraticCurvetoArgs &original_ )
2176 : _x1(original_._x1),
2183Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs (
void )
2187Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2192Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2193(
const PathQuadraticCurvetoArgsList &args_ )
2197Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2199 : VPathBase (original_),
2200 _args(original_._args)
2203Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs (
void )
2206void Magick::PathQuadraticCurvetoAbs::operator()
2207 ( MagickCore::DrawingWand * context_ )
const
2209 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2210 p != _args.end(); p++ )
2212 DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
2218 return new PathQuadraticCurvetoAbs(*
this);
2220Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2225Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2226(
const PathQuadraticCurvetoArgsList &args_ )
2230Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2232 : VPathBase (original_),
2233 _args(original_._args)
2236Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel (
void )
2239void Magick::PathQuadraticCurvetoRel::operator()
2240 ( MagickCore::DrawingWand * context_ )
const
2242 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2243 p != _args.end(); p++ )
2245 DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
2251 return new PathQuadraticCurvetoRel(*
this);
2253Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2255 : _coordinates(1,coordinate_)
2258Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2259(
const CoordinateList &coordinates_ )
2260 : _coordinates(coordinates_)
2263Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2265 : VPathBase (original_),
2266 _coordinates(original_._coordinates)
2269Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs (
void )
2272void Magick::PathSmoothQuadraticCurvetoAbs::operator()
2273 ( MagickCore::DrawingWand * context_ )
const
2275 for( CoordinateList::const_iterator p = _coordinates.begin();
2276 p != _coordinates.end(); p++ )
2278 DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
2283 return new PathSmoothQuadraticCurvetoAbs(*
this);
2285Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2287 : _coordinates(1,coordinate_)
2290Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2291(
const CoordinateList &coordinates_ )
2292 : _coordinates(coordinates_)
2295Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2296(
const PathSmoothQuadraticCurvetoRel& original_ )
2297 : VPathBase (original_),
2298 _coordinates(original_._coordinates)
2301Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel (
void )
2304void Magick::PathSmoothQuadraticCurvetoRel::operator()
2305 ( MagickCore::DrawingWand * context_ )
const
2307 for( CoordinateList::const_iterator p = _coordinates.begin();
2308 p != _coordinates.end(); p++ )
2310 DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
2315 return new PathSmoothQuadraticCurvetoRel(*
this);
2322 : _coordinates(1,coordinate_)
2325Magick::PathLinetoAbs::PathLinetoAbs (
const CoordinateList &coordinates_ )
2326 : _coordinates(coordinates_)
2330 : VPathBase (original_),
2331 _coordinates(original_._coordinates)
2334Magick::PathLinetoAbs::~PathLinetoAbs (
void )
2337void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2339 for( CoordinateList::const_iterator p = _coordinates.begin();
2340 p != _coordinates.end(); p++ )
2342 DrawPathLineToAbsolute( context_, p->x(), p->y() );
2347 return new PathLinetoAbs(*
this);
2350 : _coordinates(1,coordinate_)
2353Magick::PathLinetoRel::PathLinetoRel (
const CoordinateList &coordinates_ )
2354 : _coordinates(coordinates_)
2358 : VPathBase (original_),
2359 _coordinates(original_._coordinates)
2362Magick::PathLinetoRel::~PathLinetoRel (
void )
2365void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2367 for( CoordinateList::const_iterator p = _coordinates.begin();
2368 p != _coordinates.end(); p++ )
2370 DrawPathLineToRelative( context_, p->x(), p->y() );
2375 return new PathLinetoRel(*
this);
2382Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs (
void )
2385void Magick::PathLinetoHorizontalAbs::operator()
2386 ( MagickCore::DrawingWand * context_ )
const
2388 DrawPathLineToHorizontalAbsolute( context_, _x );
2392 return new PathLinetoHorizontalAbs(*
this);
2394Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel (
void )
2397void Magick::PathLinetoHorizontalRel::operator()
2398 ( MagickCore::DrawingWand * context_ )
const
2400 DrawPathLineToHorizontalRelative( context_, _x );
2404 return new PathLinetoHorizontalRel(*
this);
2410Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs (
void )
2413void Magick::PathLinetoVerticalAbs::operator()
2414 ( MagickCore::DrawingWand * context_ )
const
2416 DrawPathLineToVerticalAbsolute( context_, _y );
2420 return new PathLinetoVerticalAbs(*
this);
2422Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel (
void )
2425void Magick::PathLinetoVerticalRel::operator()
2426 ( MagickCore::DrawingWand * context_ )
const
2428 DrawPathLineToVerticalRelative( context_, _y );
2432 return new PathLinetoVerticalRel(*
this);
2440 : _coordinates(1,coordinate_)
2443Magick::PathMovetoAbs::PathMovetoAbs (
const CoordinateList &coordinates_ )
2444 : _coordinates(coordinates_)
2448 : VPathBase (original_),
2449 _coordinates(original_._coordinates)
2452Magick::PathMovetoAbs::~PathMovetoAbs (
void )
2455void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2457 for( CoordinateList::const_iterator p = _coordinates.begin();
2458 p != _coordinates.end(); p++ )
2460 DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2465 return new PathMovetoAbs(*
this);
2468 : _coordinates(1,coordinate_)
2471Magick::PathMovetoRel::PathMovetoRel (
const CoordinateList &coordinates_ )
2472 : _coordinates(coordinates_)
2476 : VPathBase (original_),
2477 _coordinates(original_._coordinates)
2480Magick::PathMovetoRel::~PathMovetoRel (
void )
2483void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2485 for( CoordinateList::const_iterator p = _coordinates.begin();
2486 p != _coordinates.end(); p++ )
2488 DrawPathMoveToRelative( context_, p->x(), p->y() );
2493 return new PathMovetoRel(*
this);