11#define MAGICKCORE_IMPLEMENTATION 1
12#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
13#define MAGICK_DRAWABLE_IMPLEMENTATION
15#include "Magick++/Include.h"
16#include "Magick++/Drawable.h"
17#include "Magick++/Image.h"
24 return((left_.x() == right_.x()) && (left_.y() == right_.y()));
30 return(!(left_ == right_));
36 return (!(left_ < right_) && (left_ != right_));
43 return((sqrt(left_.x()*left_.x() + left_.y()*left_.y())) <
44 (sqrt(right_.x()*right_.x() + right_.y()*right_.y())));
50 return((left_ > right_) || (left_ == right_));
56 return((left_ < right_) || (left_ == right_));
60Magick::DrawableBase::DrawableBase()
64Magick::DrawableBase::~DrawableBase(
void)
68void Magick::DrawableBase::operator()(MagickCore::DrawingWand * context_)
const
75 return new DrawableBase(*
this);
79Magick::Drawable::Drawable(
void)
80 : dp((Magick::DrawableBase *) NULL)
85 : dp(original_.copy())
89Magick::Drawable::~Drawable(
void)
96 : dp((original_.dp != (Magick::DrawableBase *) NULL ? original_.dp->copy() :
97 (Magick::DrawableBase *) NULL))
107 if (
this != &original_)
117void Magick::Drawable::operator()(MagickCore::DrawingWand * context_)
const
120 dp->operator()(context_);
124Magick::VPathBase::~VPathBase (
void )
129Magick::VPath::VPath (
void )
136 : dp(original_.copy())
141 Magick::VPath::~VPath (
void )
149 : dp(original_.dp? original_.dp->copy(): 0)
156 if (
this != &original_)
158 VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0);
166void Magick::VPath::operator()( MagickCore::DrawingWand * context_ )
const
169 dp->operator()( context_ );
177Magick::DrawableAffine::DrawableAffine(
double sx_,
double sy_,
178 double rx_,
double ry_,
179 double tx_,
double ty_ )
188Magick::DrawableAffine::DrawableAffine(
void )
190 GetAffineMatrix(&_affine);
192Magick::DrawableAffine::~DrawableAffine(
void )
195void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ )
const
197 DrawAffine( context_, &_affine );
201 return new DrawableAffine(*
this);
204Magick::DrawableAlpha::~DrawableAlpha(
void)
208void Magick::DrawableAlpha::operator()(MagickCore::DrawingWand * context_)
const
210 DrawAlpha(context_,_x,_y,_paintMethod);
215 return new DrawableAlpha(*
this);
219Magick::DrawableArc::~DrawableArc(
void )
222void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ )
const
224 DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees );
228 return new DrawableArc(*
this);
235Magick::DrawableBezier::DrawableBezier (
const CoordinateList &coordinates_ )
236 : _coordinates(coordinates_)
241 : DrawableBase (original_),
242 _coordinates(original_._coordinates)
246Magick::DrawableBezier::~DrawableBezier(
void )
249void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ )
const
251 size_t num_coords = (size_t) _coordinates.size();
252 PointInfo *coordinates =
new PointInfo[num_coords];
254 PointInfo *q = coordinates;
255 CoordinateList::const_iterator p = _coordinates.begin();
257 while( p != _coordinates.end() )
265 DrawBezier( context_, num_coords, coordinates );
266 delete [] coordinates;
270 return new DrawableBezier(*
this);
275Magick::DrawableBorderColor::DrawableBorderColor(
const Magick::Color &color_)
280Magick::DrawableBorderColor::DrawableBorderColor
282 : DrawableBase(original_),
283 _color(original_._color)
287Magick::DrawableBorderColor::~DrawableBorderColor(
void)
291void Magick::DrawableBorderColor::operator()(
292 MagickCore::DrawingWand *context_)
const
300 color=
static_cast<PixelInfo
>(_color);
301 pixel_wand=NewPixelWand();
302 PixelSetPixelColor(pixel_wand,&color);
303 DrawSetBorderColor(context_,pixel_wand);
304 pixel_wand=DestroyPixelWand(pixel_wand);
307void Magick::DrawableBorderColor::color(
const Color &color_)
319 return(
new DrawableBorderColor(*
this));
324Magick::DrawableClipRule::DrawableClipRule(
const FillRule fillRule_)
329Magick::DrawableClipRule::~DrawableClipRule(
void)
333void Magick::DrawableClipRule::operator()(
334 MagickCore::DrawingWand * context_)
const
336 DrawSetClipRule(context_,_fillRule);
339void Magick::DrawableClipRule::fillRule(
const FillRule fillRule_)
344Magick::FillRule Magick::DrawableClipRule::fillRule(
void)
const
351 return(
new DrawableClipRule(*
this));
356Magick::DrawableClipUnits::DrawableClipUnits(
const ClipPathUnits units_)
361Magick::DrawableClipUnits::~DrawableClipUnits(
void)
365void Magick::DrawableClipUnits::operator()(
366 MagickCore::DrawingWand * context_)
const
368 DrawSetClipUnits(context_, _units);
371void Magick::DrawableClipUnits::units(
const ClipPathUnits units_)
376Magick::ClipPathUnits Magick::DrawableClipUnits::units(
void)
const
383 return(
new DrawableClipUnits(*
this));
392Magick::DrawablePopClipPath::~DrawablePopClipPath (
void )
395void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ )
const
397 DrawPopClipPath( context_ );
398 DrawPopDefs(context_);
402 return new DrawablePopClipPath(*
this);
406Magick::DrawablePushClipPath::DrawablePushClipPath(
const std::string &id_)
410Magick::DrawablePushClipPath::DrawablePushClipPath
412 : DrawableBase (original_),
413 _id(original_._id.c_str())
416Magick::DrawablePushClipPath::~DrawablePushClipPath(
void )
419void Magick::DrawablePushClipPath::operator()
420 ( MagickCore::DrawingWand * context_ )
const
422 DrawPushDefs(context_);
423 DrawPushClipPath( context_, _id.c_str());
427 return new DrawablePushClipPath(*
this);
432Magick::DrawableClipPath::DrawableClipPath(
const std::string &id_ )
438 : DrawableBase (original_),
439 _id(original_._id.c_str())
442Magick::DrawableClipPath::~DrawableClipPath(
void )
445void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ )
const
447 (void) DrawSetClipPath( context_, _id.c_str());
451 return new DrawableClipPath(*
this);
455Magick::DrawableCircle::~DrawableCircle (
void )
458void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ )
const
460 DrawCircle( context_, _originX, _originY, _perimX, _perimY );
464 return new DrawableCircle(*
this);
468Magick::DrawableColor::~DrawableColor(
void )
471void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ )
const
473 DrawColor( context_, _x, _y, _paintMethod );
477 return new DrawableColor(*
this);
481Magick::DrawableCompositeImage::DrawableCompositeImage
482(
double x_,
double y_,
483 double width_,
double height_,
484 const std::string &filename_,
485 Magick::CompositeOperator composition_ )
486 : _composition(composition_),
491 _image(new Image(filename_))
494Magick::DrawableCompositeImage::DrawableCompositeImage
495(
double x_,
double y_,
496 double width_,
double height_,
498 Magick::CompositeOperator composition_ )
499 : _composition(composition_),
504 _image(new Image(image_))
507Magick::DrawableCompositeImage::DrawableCompositeImage
508(
double x_,
double y_,
509 double width_,
double height_,
510 const std::string &filename_ )
511 :_composition(CopyCompositeOp),
516 _image(new Image(filename_))
519Magick::DrawableCompositeImage::DrawableCompositeImage
520(
double x_,
double y_,
521 double width_,
double height_,
523 :_composition(CopyCompositeOp),
528 _image(new Image(image_))
531Magick::DrawableCompositeImage::DrawableCompositeImage
532(
double x_,
double y_,
533 const std::string &filename_ )
534 : _composition(CopyCompositeOp),
539 _image(new Image(filename_))
541 _width=(double) _image->columns();
542 _height=(double) _image->rows();
544Magick::DrawableCompositeImage::DrawableCompositeImage
545(
double x_,
double y_,
547 : _composition(CopyCompositeOp),
552 _image(new Image(image_))
554 _width=(double) _image->columns();
555 _height=(double) _image->rows();
558Magick::DrawableCompositeImage::DrawableCompositeImage
560 : Magick::DrawableBase(original_),
561 _composition(original_._composition),
564 _width(original_._width),
565 _height(original_._height),
566 _image(new Image(*original_._image))
569Magick::DrawableCompositeImage::~DrawableCompositeImage(
void )
578 if (
this != &original_ )
580 _composition = original_._composition;
583 _width = original_._width;
584 _height = original_._height;
585 Image* temp_image =
new Image(*original_._image);
591void Magick::DrawableCompositeImage::filename(
const std::string &filename_ )
593 Image* temp_image =
new Image(filename_);
597std::string Magick::DrawableCompositeImage::filename(
void )
const
599 return _image->fileName();
602void Magick::DrawableCompositeImage::image(
const Magick::Image &image_ )
604 Image* temp_image =
new Image(image_);
608Magick::Image Magick::DrawableCompositeImage::image(
void )
const
614void Magick::DrawableCompositeImage::magick( std::string magick_ )
616 _image->magick( magick_ );
618std::string Magick::DrawableCompositeImage::magick(
void )
620 return _image->magick();
623void Magick::DrawableCompositeImage::operator()
624 ( MagickCore::DrawingWand * context_ )
const
629 magick_wand=NewMagickWandFromImage(_image->constImage());
630 (void) DrawComposite( context_, _composition, _x, _y, _width, _height,
632 magick_wand=DestroyMagickWand(magick_wand);
637 return new DrawableCompositeImage(*
this);
640Magick::DrawableDensity::DrawableDensity(
const Point &density_)
645Magick::DrawableDensity::DrawableDensity(
const std::string &density_)
650Magick::DrawableDensity::~DrawableDensity(
void)
654void Magick::DrawableDensity::operator()(
655 MagickCore::DrawingWand *context_)
const
657 DrawSetDensity(context_,_density.c_str());
662 return(
new DrawableDensity(*
this));
666Magick::DrawableEllipse::~DrawableEllipse(
void )
669void Magick::DrawableEllipse::operator()
670 ( MagickCore::DrawingWand * context_ )
const
672 DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY,
673 _arcStart, _arcEnd );
677 return new DrawableEllipse(*
this);
681Magick::DrawableFillColor::DrawableFillColor(
const Magick::Color &color_ )
685Magick::DrawableFillColor::DrawableFillColor
687 : DrawableBase (original_),
688 _color(original_._color)
691Magick::DrawableFillColor::~DrawableFillColor(
void )
694void Magick::DrawableFillColor::operator()
695 ( MagickCore::DrawingWand * context_ )
const
697 PixelInfo color =
static_cast<PixelInfo
>(_color);
698 PixelWand *pixel_wand=NewPixelWand();
699 PixelSetPixelColor(pixel_wand,&color);
700 DrawSetFillColor(context_,pixel_wand);
701 pixel_wand=DestroyPixelWand(pixel_wand);
705 return new DrawableFillColor(*
this);
709Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
const std::string &url_)
714Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(
716 : DrawableBase(original_),
721Magick::DrawableFillPatternUrl::~DrawableFillPatternUrl(
void)
725void Magick::DrawableFillPatternUrl::operator()(
726 MagickCore::DrawingWand * context_)
const
728 DrawSetFillPatternURL(context_, _url.c_str());
731void Magick::DrawableFillPatternUrl::url(
const std::string &url_)
736std::string Magick::DrawableFillPatternUrl::url(
void)
const
743 return(
new DrawableFillPatternUrl(*
this));
747Magick::DrawableFillRule::~DrawableFillRule (
void )
750void Magick::DrawableFillRule::operator()
751 ( MagickCore::DrawingWand * context_ )
const
753 DrawSetFillRule( context_, _fillRule );
757 return new DrawableFillRule(*
this);
760Magick::DrawableFillOpacity::~DrawableFillOpacity(
void)
764void Magick::DrawableFillOpacity::operator()
765 (MagickCore::DrawingWand *context_)
const
767 DrawSetFillOpacity(context_,_opacity);
772 return new DrawableFillOpacity(*
this);
776Magick::DrawableFont::DrawableFont (
const std::string &font_ )
779 _style(Magick::AnyStyle),
781 _stretch(Magick::NormalStretch)
784Magick::DrawableFont::DrawableFont (
const std::string &family_,
785 Magick::StyleType style_,
786 const unsigned int weight_,
787 Magick::StretchType stretch_ )
796 : DrawableBase (original_),
797 _font(original_._font),
798 _family(original_._family),
799 _style(original_._style),
800 _weight(original_._weight),
801 _stretch(original_._stretch)
804Magick::DrawableFont::~DrawableFont (
void )
807void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ )
const
812 (void) DrawSetFont( context_, _font.c_str() );
818 (void) DrawSetFontFamily( context_, _family.c_str() );
821 DrawSetFontStyle( context_, _style );
824 DrawSetFontWeight( context_, _weight );
827 DrawSetFontStretch( context_, _stretch );
832 return new DrawableFont(*
this);
836Magick::DrawableGravity::~DrawableGravity (
void )
839void Magick::DrawableGravity::operator()
840 ( MagickCore::DrawingWand * context_ )
const
842 DrawSetGravity( context_, _gravity );
846 return new DrawableGravity(*
this);
850Magick::DrawableLine::~DrawableLine (
void )
853void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ )
const
855 DrawLine( context_, _startX, _startY, _endX, _endY );
859 return new DrawableLine(*
this);
863Magick::DrawablePath::DrawablePath (
const VPathList &path_ )
868 : DrawableBase (original_),
869 _path(original_._path)
872Magick::DrawablePath::~DrawablePath (
void )
875void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ )
const
877 DrawPathStart( context_ );
879 for( VPathList::const_iterator p = _path.begin();
880 p != _path.end(); p++ )
881 p->operator()( context_ );
883 DrawPathFinish( context_ );
887 return new DrawablePath(*
this);
891Magick::DrawablePoint::~DrawablePoint (
void )
894void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ )
const
896 DrawPoint( context_, _x, _y );
900 return new DrawablePoint(*
this);
904Magick::DrawablePointSize::~DrawablePointSize (
void )
907void Magick::DrawablePointSize::operator()
908 ( MagickCore::DrawingWand * context_ )
const
910 DrawSetFontSize( context_, _pointSize );
914 return new DrawablePointSize(*
this);
918Magick::DrawablePolygon::DrawablePolygon (
const CoordinateList &coordinates_ )
919 : _coordinates(coordinates_)
922Magick::DrawablePolygon::DrawablePolygon
924 : DrawableBase (original_),
925 _coordinates(original_._coordinates)
928Magick::DrawablePolygon::~DrawablePolygon (
void )
931void Magick::DrawablePolygon::operator()
932 ( MagickCore::DrawingWand * context_ )
const
934 size_t num_coords = (size_t) _coordinates.size();
935 PointInfo *coordinates =
new PointInfo[num_coords];
937 PointInfo *q = coordinates;
938 CoordinateList::const_iterator p = _coordinates.begin();
940 while( p != _coordinates.end() )
948 DrawPolygon( context_, num_coords, coordinates );
949 delete [] coordinates;
953 return new DrawablePolygon(*
this);
957Magick::DrawablePolyline::DrawablePolyline
958(
const CoordinateList &coordinates_ )
959 : _coordinates(coordinates_)
962Magick::DrawablePolyline::DrawablePolyline
964 : DrawableBase (original_),
965 _coordinates(original_._coordinates)
968Magick::DrawablePolyline::~DrawablePolyline (
void )
971void Magick::DrawablePolyline::operator()
972 ( MagickCore::DrawingWand * context_ )
const
974 size_t num_coords = (size_t) _coordinates.size();
975 PointInfo *coordinates =
new PointInfo[num_coords];
977 PointInfo *q = coordinates;
978 CoordinateList::const_iterator p = _coordinates.begin();
980 while( p != _coordinates.end() )
988 DrawPolyline( context_, num_coords, coordinates );
989 delete [] coordinates;
993 return new DrawablePolyline(*
this);
997Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext (
void )
1000void Magick::DrawablePopGraphicContext::operator()
1001 ( MagickCore::DrawingWand * context_ )
const
1003 PopDrawingWand( context_ );
1007 return new DrawablePopGraphicContext(*
this);
1011Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext (
void )
1014void Magick::DrawablePushGraphicContext::operator()
1015 ( MagickCore::DrawingWand * context_ )
const
1017 PushDrawingWand( context_ );
1021 return new DrawablePushGraphicContext(*
this);
1025Magick::DrawablePopPattern::~DrawablePopPattern (
void )
1028void Magick::DrawablePopPattern::operator()
1029 ( MagickCore::DrawingWand * context_ )
const
1031 (void) DrawPopPattern( context_ );
1035 return new DrawablePopPattern(*
this);
1039Magick::DrawablePushPattern::DrawablePushPattern
1040(
const std::string &id_, ssize_t x_, ssize_t y_,
1041 size_t width_,
size_t height_ )
1049Magick::DrawablePushPattern::DrawablePushPattern
1051 : DrawableBase (original_),
1055 _width(original_._width),
1056 _height(original_._height)
1059Magick::DrawablePushPattern::~DrawablePushPattern (
void )
1062void Magick::DrawablePushPattern::operator()
1063 ( MagickCore::DrawingWand * context_ )
const
1065 (void) DrawPushPattern( context_, _id.c_str(), (double) _x, (
double) _y,
1066 (double) _width, (
double) _height);
1070 return new DrawablePushPattern(*
this);
1074Magick::DrawableRectangle::~DrawableRectangle (
void )
1077void Magick::DrawableRectangle::operator()
1078 ( MagickCore::DrawingWand * context_ )
const
1080 DrawRectangle( context_, _upperLeftX, _upperLeftY,
1081 _lowerRightX, _lowerRightY );
1085 return new DrawableRectangle(*
this);
1089Magick::DrawableRotation::~DrawableRotation (
void )
1092void Magick::DrawableRotation::operator()
1093 ( MagickCore::DrawingWand * context_ )
const
1095 DrawRotate( context_, _angle );
1099 return new DrawableRotation(*
this);
1103Magick::DrawableRoundRectangle::~DrawableRoundRectangle (
void )
1106void Magick::DrawableRoundRectangle::operator()
1107 ( MagickCore::DrawingWand * context_ )
const
1109 DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX,
1110 _lowerRightY,_cornerWidth, _cornerHeight);
1114 return new DrawableRoundRectangle(*
this);
1118Magick::DrawableScaling::~DrawableScaling (
void )
1121void Magick::DrawableScaling::operator()
1122 ( MagickCore::DrawingWand * context_ )
const
1124 DrawScale( context_, _x, _y );
1128 return new DrawableScaling(*
this);
1132Magick::DrawableSkewX::~DrawableSkewX (
void )
1135void Magick::DrawableSkewX::operator()
1136 ( MagickCore::DrawingWand * context_ )
const
1138 DrawSkewX( context_, _angle );
1142 return new DrawableSkewX(*
this);
1146Magick::DrawableSkewY::~DrawableSkewY (
void )
1149void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ )
const
1151 DrawSkewY( context_, _angle );
1155 return new DrawableSkewY(*
this);
1159Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
const double* dasharray_)
1163 dasharray(dasharray_);
1166Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(
1168 : DrawableBase (original_),
1169 _size(original_._size),
1170 _dasharray(new double[_size+1])
1174 for (
size_t i=0; i < _size; i++)
1175 _dasharray[i]=original_._dasharray[i];
1176 _dasharray[_size]=0.0;
1180Magick::DrawableStrokeDashArray::~DrawableStrokeDashArray(
void)
1182 delete [] _dasharray;
1184 _dasharray=(
double *) NULL;
1190 if (
this != &original_)
1192 delete [] _dasharray;
1193 _size=original_._size;
1194 _dasharray =
new double[_size+1];
1197 for (
size_t i=0; i < _size; i++)
1198 _dasharray[i]=original_._dasharray[i];
1199 _dasharray[_size]=0.0;
1205void Magick::DrawableStrokeDashArray::operator()(
1206 MagickCore::DrawingWand *context_)
const
1208 (void) DrawSetStrokeDashArray(context_,(
unsigned long) _size,_dasharray);
1213 return(
new DrawableStrokeDashArray(*
this));
1216void Magick::DrawableStrokeDashArray::dasharray(
const double* dasharray_)
1221 delete [] _dasharray;
1225 if (dasharray_ != (
const double *) NULL)
1240 _dasharray=
new double[_size+1];
1243 for (
size_t i=0; i < _size; i++)
1244 _dasharray[i]=dasharray_[i];
1245 _dasharray[_size]=0.0;
1250const double* Magick::DrawableStrokeDashArray::dasharray(
void)
const
1256Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(
void)
1260void Magick::DrawableStrokeDashOffset::operator()
1261 ( MagickCore::DrawingWand * context_)
const
1263 DrawSetStrokeDashOffset(context_,_offset);
1268 return(
new DrawableStrokeDashOffset(*
this));
1271void Magick::DrawableStrokeDashOffset::offset(
const double offset_)
1276double Magick::DrawableStrokeDashOffset::offset(
void)
const
1282Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap (
void )
1285void Magick::DrawableStrokeLineCap::operator()
1286 ( MagickCore::DrawingWand * context_ )
const
1288 DrawSetStrokeLineCap( context_, _linecap );
1292 return new DrawableStrokeLineCap(*
this);
1296Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin (
void )
1299void Magick::DrawableStrokeLineJoin::operator()
1300 ( MagickCore::DrawingWand * context_ )
const
1302 DrawSetStrokeLineJoin( context_, _linejoin );
1306 return new DrawableStrokeLineJoin(*
this);
1310Magick::DrawableMiterLimit::~DrawableMiterLimit (
void )
1313void Magick::DrawableMiterLimit::operator()
1314 ( MagickCore::DrawingWand * context_ )
const
1316 DrawSetStrokeMiterLimit( context_, _miterlimit );
1320 return new DrawableMiterLimit(*
this);
1325Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1326 const std::string &url_)
1331Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl(
1333 : DrawableBase(original_),
1334 _url(original_._url)
1338Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(
void)
1342void Magick::DrawableStrokePatternUrl::operator()(
1343 MagickCore::DrawingWand * context_)
const
1345 DrawSetStrokePatternURL(context_, _url.c_str());
1348void Magick::DrawableStrokePatternUrl::url(
const std::string &url_)
1353std::string Magick::DrawableStrokePatternUrl::url(
void)
const
1360 return(
new DrawableStrokePatternUrl(*
this));
1364Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias (
void )
1367void Magick::DrawableStrokeAntialias::operator()
1368( MagickCore::DrawingWand * context_ )
const
1370 DrawSetStrokeAntialias( context_,
static_cast<MagickBooleanType
>
1371 (_flag ? MagickTrue : MagickFalse) );
1375 return new DrawableStrokeAntialias(*
this);
1379Magick::DrawableStrokeColor::DrawableStrokeColor
1384Magick::DrawableStrokeColor::DrawableStrokeColor
1386 : DrawableBase (original_),
1387 _color(original_._color)
1390Magick::DrawableStrokeColor::~DrawableStrokeColor (
void )
1393void Magick::DrawableStrokeColor::operator()
1394 ( MagickCore::DrawingWand * context_ )
const
1396 PixelInfo color =
static_cast<PixelInfo
>(_color);
1397 PixelWand *pixel_wand=NewPixelWand();
1398 PixelSetPixelColor(pixel_wand,&color);
1399 DrawSetStrokeColor(context_,pixel_wand);
1400 pixel_wand=DestroyPixelWand(pixel_wand);
1404 return new DrawableStrokeColor(*
this);
1407Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(
void)
1411void Magick::DrawableStrokeOpacity::operator()
1412 (MagickCore::DrawingWand * context_)
const
1414 DrawSetStrokeOpacity(context_,_opacity);
1419 return new DrawableStrokeOpacity(*
this);
1423Magick::DrawableStrokeWidth::~DrawableStrokeWidth (
void )
1426void Magick::DrawableStrokeWidth::operator()
1427 ( MagickCore::DrawingWand * context_ )
const
1429 DrawSetStrokeWidth( context_, _width );
1433 return new DrawableStrokeWidth(*
this);
1437Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1438 const std::string &text_ )
1445Magick::DrawableText::DrawableText (
const double x_,
const double y_,
1446 const std::string &text_,
const std::string &encoding_)
1450 _encoding(encoding_)
1454 : DrawableBase (original_),
1457 _text(original_._text),
1458 _encoding(original_._encoding)
1461Magick::DrawableText::~DrawableText (
void )
1464void Magick::DrawableText::operator()
1465 ( MagickCore::DrawingWand * context_ )
const
1467 DrawSetTextEncoding( context_, _encoding.c_str() );
1468 DrawAnnotation( context_, _x, _y,
1469 reinterpret_cast<const unsigned char*
>(_text.c_str()) );
1473 return new DrawableText(*
this);
1477Magick::DrawableTextAlignment::DrawableTextAlignment(
1478 Magick::AlignType alignment_)
1479 : _alignment(alignment_)
1483Magick::DrawableTextAlignment::DrawableTextAlignment
1485 : DrawableBase(original_),
1486 _alignment(original_._alignment)
1490Magick::DrawableTextAlignment::~DrawableTextAlignment(
void)
1494void Magick::DrawableTextAlignment::operator()(
1495 MagickCore::DrawingWand * context_)
const
1497 DrawSetTextAlignment(context_, _alignment);
1500void Magick::DrawableTextAlignment::alignment(AlignType alignment_)
1502 _alignment=alignment_;
1505Magick::AlignType Magick::DrawableTextAlignment::alignment(
void)
const
1512 return new DrawableTextAlignment(*
this);
1516Magick::DrawableTextAntialias::DrawableTextAntialias (
bool flag_ )
1521 : DrawableBase (original_),
1522 _flag(original_._flag)
1525Magick::DrawableTextAntialias::~DrawableTextAntialias (
void )
1528void Magick::DrawableTextAntialias::operator()
1529 ( MagickCore::DrawingWand * context_ )
const
1531 DrawSetTextAntialias( context_,
static_cast<MagickBooleanType
>
1532 (_flag ? MagickTrue : MagickFalse) );
1536 return new DrawableTextAntialias(*
this);
1541Magick::DrawableTextDecoration::DrawableTextDecoration
1542 ( Magick::DecorationType decoration_ )
1543 : _decoration(decoration_)
1546Magick::DrawableTextDecoration::DrawableTextDecoration
1548 : DrawableBase (original_),
1549 _decoration(original_._decoration)
1552Magick::DrawableTextDecoration::~DrawableTextDecoration(
void )
1555void Magick::DrawableTextDecoration::operator()
1556 ( MagickCore::DrawingWand * context_ )
const
1558 DrawSetTextDecoration( context_, _decoration );
1562 return new DrawableTextDecoration(*
this);
1566Magick::DrawableTextDirection::DrawableTextDirection(
1567 DirectionType direction_)
1568 : _direction(direction_)
1572Magick::DrawableTextDirection::~DrawableTextDirection(
void)
1576void Magick::DrawableTextDirection::operator()(
1577 MagickCore::DrawingWand *context_)
const
1579 DrawSetTextDirection(context_,_direction);
1582void Magick::DrawableTextDirection::direction(DirectionType direction_)
1584 _direction=direction_;
1587Magick::DirectionType Magick::DrawableTextDirection::direction(
void)
const
1594 return new DrawableTextDirection(*
this);
1598Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing(
1600 : _spacing(spacing_)
1604Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(
void)
1608void Magick::DrawableTextInterlineSpacing::operator()(
1609 MagickCore::DrawingWand *context_)
const
1611 DrawSetTextInterlineSpacing(context_,_spacing);
1614void Magick::DrawableTextInterlineSpacing::spacing(
double spacing_)
1619double Magick::DrawableTextInterlineSpacing::spacing(
void)
const
1626 return new DrawableTextInterlineSpacing(*
this);
1630Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing(
1632 : _spacing(spacing_)
1636Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(
void)
1640void Magick::DrawableTextInterwordSpacing::operator()(
1641 MagickCore::DrawingWand *context_)
const
1643 DrawSetTextInterwordSpacing(context_,_spacing);
1646void Magick::DrawableTextInterwordSpacing::spacing(
double spacing_)
1651double Magick::DrawableTextInterwordSpacing::spacing(
void)
const
1658 return new DrawableTextInterwordSpacing(*
this);
1662Magick::DrawableTextKerning::DrawableTextKerning(
1664 : _kerning(kerning_)
1668Magick::DrawableTextKerning::~DrawableTextKerning(
void)
1672void Magick::DrawableTextKerning::operator()(
1673 MagickCore::DrawingWand *context_)
const
1675 DrawSetTextKerning(context_,_kerning);
1678void Magick::DrawableTextKerning::kerning(
double kerning_)
1683double Magick::DrawableTextKerning::kerning(
void)
const
1690 return new DrawableTextKerning(*
this);
1694Magick::DrawableTextUnderColor::DrawableTextUnderColor
1699Magick::DrawableTextUnderColor::DrawableTextUnderColor
1701 : DrawableBase (original_),
1702 _color(original_._color)
1705Magick::DrawableTextUnderColor::~DrawableTextUnderColor (
void )
1708void Magick::DrawableTextUnderColor::operator()
1709 ( MagickCore::DrawingWand * context_ )
const
1711 PixelInfo color =
static_cast<PixelInfo
>(_color);
1712 PixelWand *pixel_wand=NewPixelWand();
1713 PixelSetPixelColor(pixel_wand,&color);
1714 DrawSetTextUnderColor(context_,pixel_wand);
1715 pixel_wand=DestroyPixelWand(pixel_wand);
1719 return new DrawableTextUnderColor(*
this);
1723Magick::DrawableTranslation::~DrawableTranslation (
void )
1726void Magick::DrawableTranslation::operator()
1727 ( MagickCore::DrawingWand * context_ )
const
1729 DrawTranslate( context_, _x, _y );
1733 return new DrawableTranslation(*
this);
1737Magick::DrawableViewbox::~DrawableViewbox (
void )
1740void Magick::DrawableViewbox::operator()
1741 ( MagickCore::DrawingWand * context_ )
const
1743 DrawSetViewbox( context_, (
double) _x1, (
double) _y1, (
double) _x2,
1748 return new DrawableViewbox(*
this);
1781 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1786 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1789Magick::PathArcArgs::PathArcArgs(
void )
1793 _largeArcFlag(false),
1800Magick::PathArcArgs::PathArcArgs(
double radiusX_,
double radiusY_,
1801 double xAxisRotation_,
bool largeArcFlag_,
1802 bool sweepFlag_,
double x_,
double y_ )
1803 : _radiusX(radiusX_),
1805 _xAxisRotation(xAxisRotation_),
1806 _largeArcFlag(largeArcFlag_),
1807 _sweepFlag(sweepFlag_),
1814 : _radiusX(original_._radiusX),
1815 _radiusY(original_._radiusY),
1816 _xAxisRotation(original_._xAxisRotation),
1817 _largeArcFlag(original_._largeArcFlag),
1818 _sweepFlag(original_._sweepFlag),
1824Magick::PathArcArgs::~PathArcArgs (
void )
1830 : _coordinates(1,coordinates_)
1833Magick::PathArcAbs::PathArcAbs (
const PathArcArgsList &coordinates_ )
1834 : _coordinates(coordinates_)
1838 : VPathBase (original_),
1839 _coordinates(original_._coordinates)
1842Magick::PathArcAbs::~PathArcAbs (
void )
1845void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ )
const
1847 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1848 p != _coordinates.end(); p++ )
1850 DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(),
1851 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1852 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1857 return new PathArcAbs(*
this);
1861 : _coordinates(1,coordinates_)
1864Magick::PathArcRel::PathArcRel (
const PathArcArgsList &coordinates_ )
1865 : _coordinates(coordinates_)
1869 : VPathBase (original_),
1870 _coordinates(original_._coordinates)
1873Magick::PathArcRel::~PathArcRel (
void )
1876void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ )
const
1878 for( PathArcArgsList::const_iterator p = _coordinates.begin();
1879 p != _coordinates.end(); p++ )
1881 DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(),
1882 p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(),
1883 (MagickBooleanType) p->sweepFlag(), p->x(), p->y() );
1888 return new PathArcRel(*
this);
1894Magick::PathClosePath::~PathClosePath (
void )
1897void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ )
const
1899 DrawPathClose( context_ );
1903 return new PathClosePath(*
this);
1932 return ( ( left_ > right_ ) || ( left_ == right_ ) );
1937 return ( ( left_ < right_ ) || ( left_ == right_ ) );
1940Magick::PathCurvetoArgs::PathCurvetoArgs(
void )
1950Magick::PathCurvetoArgs::PathCurvetoArgs(
double x1_,
double y1_,
1951 double x2_,
double y2_,
1952 double x_,
double y_ )
1962Magick::PathCurvetoArgs::PathCurvetoArgs(
const PathCurvetoArgs &original_ )
1963 : _x1(original_._x1),
1972Magick::PathCurvetoArgs::~PathCurvetoArgs (
void )
1980Magick::PathCurvetoAbs::PathCurvetoAbs (
const PathCurveToArgsList &args_ )
1984Magick::PathCurvetoAbs::PathCurvetoAbs
1986 : VPathBase (original_),
1987 _args(original_._args)
1990Magick::PathCurvetoAbs::~PathCurvetoAbs (
void )
1993void Magick::PathCurvetoAbs::operator()
1994 ( MagickCore::DrawingWand * context_ )
const
1996 for( PathCurveToArgsList::const_iterator p = _args.begin();
1997 p != _args.end(); p++ )
1999 DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2005 return new PathCurvetoAbs(*
this);
2011Magick::PathCurvetoRel::PathCurvetoRel (
const PathCurveToArgsList &args_ )
2015Magick::PathCurvetoRel::PathCurvetoRel
2017 : VPathBase (original_),
2018 _args(original_._args)
2021Magick::PathCurvetoRel::~PathCurvetoRel (
void )
2024void Magick::PathCurvetoRel::operator()
2025 ( MagickCore::DrawingWand * context_ )
const
2027 for( PathCurveToArgsList::const_iterator p = _args.begin();
2028 p != _args.end(); p++ )
2030 DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(),
2036 return new PathCurvetoRel(*
this);
2038Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2040 : _coordinates(1,coordinates_)
2043Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2044(
const CoordinateList &coordinates_ )
2045 : _coordinates(coordinates_)
2048Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs
2050 : VPathBase (original_),
2051 _coordinates(original_._coordinates)
2054Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs (
void )
2057void Magick::PathSmoothCurvetoAbs::operator()
2058 ( MagickCore::DrawingWand * context_ )
const
2060 for( CoordinateList::const_iterator p = _coordinates.begin();
2061 p != _coordinates.end(); p++ )
2066 if (p == _coordinates.end() )
2068 DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() );
2073 return new PathSmoothCurvetoAbs(*
this);
2075Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2077 : _coordinates(1,coordinates_)
2080Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2081(
const CoordinateList &coordinates_ )
2082 : _coordinates(coordinates_)
2085Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel
2087 : VPathBase (original_),
2088 _coordinates(original_._coordinates)
2091Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel (
void )
2094void Magick::PathSmoothCurvetoRel::operator()
2095 ( MagickCore::DrawingWand * context_ )
const
2097 for( CoordinateList::const_iterator p = _coordinates.begin();
2098 p != _coordinates.end(); p++ )
2103 if (p == _coordinates.end() )
2105 DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() );
2110 return new PathSmoothCurvetoRel(*
this);
2116MagickPPExport
int Magick::operator ==
2122MagickPPExport
int Magick::operator !=
2128MagickPPExport
int Magick::operator >
2134MagickPPExport
int Magick::operator <
2140MagickPPExport
int Magick::operator >=
2144 return ( ( left_ > right_ ) || ( left_ == right_ ) );
2146MagickPPExport
int Magick::operator <=
2150 return ( ( left_ < right_ ) || ( left_ == right_ ) );
2153Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
void )
2161Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
double x1_,
2172Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs(
const PathQuadraticCurvetoArgs &original_ )
2173 : _x1(original_._x1),
2180Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs (
void )
2184Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2189Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2190(
const PathQuadraticCurvetoArgsList &args_ )
2194Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs
2196 : VPathBase (original_),
2197 _args(original_._args)
2200Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs (
void )
2203void Magick::PathQuadraticCurvetoAbs::operator()
2204 ( MagickCore::DrawingWand * context_ )
const
2206 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2207 p != _args.end(); p++ )
2209 DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(),
2215 return new PathQuadraticCurvetoAbs(*
this);
2217Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2222Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2223(
const PathQuadraticCurvetoArgsList &args_ )
2227Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel
2229 : VPathBase (original_),
2230 _args(original_._args)
2233Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel (
void )
2236void Magick::PathQuadraticCurvetoRel::operator()
2237 ( MagickCore::DrawingWand * context_ )
const
2239 for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin();
2240 p != _args.end(); p++ )
2242 DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(),
2248 return new PathQuadraticCurvetoRel(*
this);
2250Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2252 : _coordinates(1,coordinate_)
2255Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2256(
const CoordinateList &coordinates_ )
2257 : _coordinates(coordinates_)
2260Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs
2262 : VPathBase (original_),
2263 _coordinates(original_._coordinates)
2266Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs (
void )
2269void Magick::PathSmoothQuadraticCurvetoAbs::operator()
2270 ( MagickCore::DrawingWand * context_ )
const
2272 for( CoordinateList::const_iterator p = _coordinates.begin();
2273 p != _coordinates.end(); p++ )
2275 DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() );
2280 return new PathSmoothQuadraticCurvetoAbs(*
this);
2282Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2284 : _coordinates(1,coordinate_)
2287Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2288(
const CoordinateList &coordinates_ )
2289 : _coordinates(coordinates_)
2292Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel
2293(
const PathSmoothQuadraticCurvetoRel& original_ )
2294 : VPathBase (original_),
2295 _coordinates(original_._coordinates)
2298Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel (
void )
2301void Magick::PathSmoothQuadraticCurvetoRel::operator()
2302 ( MagickCore::DrawingWand * context_ )
const
2304 for( CoordinateList::const_iterator p = _coordinates.begin();
2305 p != _coordinates.end(); p++ )
2307 DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() );
2312 return new PathSmoothQuadraticCurvetoRel(*
this);
2319 : _coordinates(1,coordinate_)
2322Magick::PathLinetoAbs::PathLinetoAbs (
const CoordinateList &coordinates_ )
2323 : _coordinates(coordinates_)
2327 : VPathBase (original_),
2328 _coordinates(original_._coordinates)
2331Magick::PathLinetoAbs::~PathLinetoAbs (
void )
2334void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2336 for( CoordinateList::const_iterator p = _coordinates.begin();
2337 p != _coordinates.end(); p++ )
2339 DrawPathLineToAbsolute( context_, p->x(), p->y() );
2344 return new PathLinetoAbs(*
this);
2347 : _coordinates(1,coordinate_)
2350Magick::PathLinetoRel::PathLinetoRel (
const CoordinateList &coordinates_ )
2351 : _coordinates(coordinates_)
2355 : VPathBase (original_),
2356 _coordinates(original_._coordinates)
2359Magick::PathLinetoRel::~PathLinetoRel (
void )
2362void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2364 for( CoordinateList::const_iterator p = _coordinates.begin();
2365 p != _coordinates.end(); p++ )
2367 DrawPathLineToRelative( context_, p->x(), p->y() );
2372 return new PathLinetoRel(*
this);
2379Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs (
void )
2382void Magick::PathLinetoHorizontalAbs::operator()
2383 ( MagickCore::DrawingWand * context_ )
const
2385 DrawPathLineToHorizontalAbsolute( context_, _x );
2389 return new PathLinetoHorizontalAbs(*
this);
2391Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel (
void )
2394void Magick::PathLinetoHorizontalRel::operator()
2395 ( MagickCore::DrawingWand * context_ )
const
2397 DrawPathLineToHorizontalRelative( context_, _x );
2401 return new PathLinetoHorizontalRel(*
this);
2407Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs (
void )
2410void Magick::PathLinetoVerticalAbs::operator()
2411 ( MagickCore::DrawingWand * context_ )
const
2413 DrawPathLineToVerticalAbsolute( context_, _y );
2417 return new PathLinetoVerticalAbs(*
this);
2419Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel (
void )
2422void Magick::PathLinetoVerticalRel::operator()
2423 ( MagickCore::DrawingWand * context_ )
const
2425 DrawPathLineToVerticalRelative( context_, _y );
2429 return new PathLinetoVerticalRel(*
this);
2437 : _coordinates(1,coordinate_)
2440Magick::PathMovetoAbs::PathMovetoAbs (
const CoordinateList &coordinates_ )
2441 : _coordinates(coordinates_)
2445 : VPathBase (original_),
2446 _coordinates(original_._coordinates)
2449Magick::PathMovetoAbs::~PathMovetoAbs (
void )
2452void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ )
const
2454 for( CoordinateList::const_iterator p = _coordinates.begin();
2455 p != _coordinates.end(); p++ )
2457 DrawPathMoveToAbsolute( context_, p->x(), p->y() );
2462 return new PathMovetoAbs(*
this);
2465 : _coordinates(1,coordinate_)
2468Magick::PathMovetoRel::PathMovetoRel (
const CoordinateList &coordinates_ )
2469 : _coordinates(coordinates_)
2473 : VPathBase (original_),
2474 _coordinates(original_._coordinates)
2477Magick::PathMovetoRel::~PathMovetoRel (
void )
2480void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ )
const
2482 for( CoordinateList::const_iterator p = _coordinates.begin();
2483 p != _coordinates.end(); p++ )
2485 DrawPathMoveToRelative( context_, p->x(), p->y() );
2490 return new PathMovetoRel(*
this);