cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | // This may look like C code, but it is really -*- C++ -*- |
| 2 | // |
| 3 | // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 |
| 4 | // |
| 5 | // Implementation of Drawable (Graphic objects) |
| 6 | // |
| 7 | |
| 8 | #define MAGICKCORE_IMPLEMENTATION 1 |
| 9 | #define MAGICK_PLUSPLUS_IMPLEMENTATION 1 |
| 10 | #define MAGICK_DRAWABLE_IMPLEMENTATION |
| 11 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 12 | #include <math.h> |
| 13 | #include <string> |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 14 | #include "Magick++/Include.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 15 | |
| 16 | #include "Magick++/Drawable.h" |
| 17 | #include "Magick++/Image.h" |
| 18 | |
| 19 | using namespace std; |
| 20 | |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 21 | MagickPPExport int Magick::operator == ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 22 | const Magick::Coordinate& right_ ) |
| 23 | { |
| 24 | return ( ( left_.x() == right_.x() ) && ( left_.y() == right_.y() ) ); |
| 25 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 26 | MagickPPExport int Magick::operator != ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 27 | const Magick::Coordinate& right_ ) |
| 28 | { |
| 29 | return ( ! (left_ == right_) ); |
| 30 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 31 | MagickPPExport int Magick::operator > ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 32 | const Magick::Coordinate& right_ ) |
| 33 | { |
| 34 | return ( !( left_ < right_ ) && ( left_ != right_ ) ); |
| 35 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 36 | MagickPPExport int Magick::operator < ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 37 | const Magick::Coordinate& right_ ) |
| 38 | { |
| 39 | // Based on distance from origin |
| 40 | return ( (sqrt(left_.x()*left_.x() + left_.y()*left_.y())) < |
| 41 | (sqrt(right_.x()*right_.x() + right_.y()*right_.y())) ); |
| 42 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 43 | MagickPPExport int Magick::operator >= ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 44 | const Magick::Coordinate& right_ ) |
| 45 | { |
| 46 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 47 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 48 | MagickPPExport int Magick::operator <= ( const Magick::Coordinate& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 49 | const Magick::Coordinate& right_ ) |
| 50 | { |
| 51 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 52 | } |
| 53 | |
| 54 | /*virtual*/ |
| 55 | Magick::DrawableBase::~DrawableBase ( void ) |
| 56 | { |
| 57 | } |
| 58 | |
| 59 | // Constructor |
| 60 | Magick::Drawable::Drawable ( void ) |
| 61 | : dp(0) |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | // Construct from DrawableBase |
| 66 | Magick::Drawable::Drawable ( const Magick::DrawableBase& original_ ) |
| 67 | : dp(original_.copy()) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | // Destructor |
| 72 | Magick::Drawable::~Drawable ( void ) |
| 73 | { |
| 74 | delete dp; |
| 75 | dp = 0; |
| 76 | } |
| 77 | |
| 78 | // Copy constructor |
| 79 | Magick::Drawable::Drawable ( const Magick::Drawable& original_ ) |
| 80 | : dp(original_.dp? original_.dp->copy(): 0) |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | // Assignment operator |
| 85 | Magick::Drawable& Magick::Drawable::operator= (const Magick::Drawable& original_ ) |
| 86 | { |
| 87 | if (this != &original_) |
| 88 | { |
| 89 | DrawableBase* temp_dp = (original_.dp ? original_.dp->copy() : 0); |
| 90 | delete dp; |
| 91 | dp = temp_dp; |
| 92 | } |
| 93 | return *this; |
| 94 | } |
| 95 | |
| 96 | // Operator to invoke contained object |
| 97 | void Magick::Drawable::operator()( MagickCore::DrawingWand * context_ ) const |
| 98 | { |
| 99 | if(dp) |
| 100 | dp->operator()( context_ ); |
| 101 | } |
| 102 | |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 103 | MagickPPExport int Magick::operator == ( const Magick::Drawable& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 104 | const Magick::Drawable& /*right_*/ ) |
| 105 | { |
| 106 | return ( 1 ); |
| 107 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 108 | MagickPPExport int Magick::operator != ( const Magick::Drawable& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 109 | const Magick::Drawable& /*right_*/ ) |
| 110 | { |
| 111 | return ( 0 ); |
| 112 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 113 | MagickPPExport int Magick::operator > ( const Magick::Drawable& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 114 | const Magick::Drawable& /*right_*/ ) |
| 115 | { |
| 116 | return ( 0 ); |
| 117 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 118 | MagickPPExport int Magick::operator < ( const Magick::Drawable& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 119 | const Magick::Drawable& /*right_*/ ) |
| 120 | { |
| 121 | return ( 0 ); |
| 122 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 123 | MagickPPExport int Magick::operator >= ( const Magick::Drawable& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 124 | const Magick::Drawable& right_ ) |
| 125 | { |
| 126 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 127 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 128 | MagickPPExport int Magick::operator <= ( const Magick::Drawable& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 129 | const Magick::Drawable& right_ ) |
| 130 | { |
| 131 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 132 | } |
| 133 | |
| 134 | /*virtual*/ |
| 135 | Magick::VPathBase::~VPathBase ( void ) |
| 136 | { |
| 137 | } |
| 138 | |
| 139 | // Constructor |
| 140 | Magick::VPath::VPath ( void ) |
| 141 | : dp(0) |
| 142 | { |
| 143 | } |
| 144 | |
| 145 | // Construct from VPathBase |
| 146 | Magick::VPath::VPath ( const Magick::VPathBase& original_ ) |
| 147 | : dp(original_.copy()) |
| 148 | { |
| 149 | } |
| 150 | |
| 151 | // Destructor |
| 152 | /* virtual */ Magick::VPath::~VPath ( void ) |
| 153 | { |
| 154 | delete dp; |
| 155 | dp = 0; |
| 156 | } |
| 157 | |
| 158 | // Copy constructor |
| 159 | Magick::VPath::VPath ( const Magick::VPath& original_ ) |
| 160 | : dp(original_.dp? original_.dp->copy(): 0) |
| 161 | { |
| 162 | } |
| 163 | |
| 164 | // Assignment operator |
| 165 | Magick::VPath& Magick::VPath::operator= (const Magick::VPath& original_ ) |
| 166 | { |
| 167 | if (this != &original_) |
| 168 | { |
| 169 | VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0); |
| 170 | delete dp; |
| 171 | dp = temp_dp; |
| 172 | } |
| 173 | return *this; |
| 174 | } |
| 175 | |
| 176 | // Operator to invoke contained object |
| 177 | void Magick::VPath::operator()( MagickCore::DrawingWand * context_ ) const |
| 178 | { |
| 179 | if(dp) |
| 180 | dp->operator()( context_ ); |
| 181 | } |
| 182 | |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 183 | MagickPPExport int Magick::operator == ( const Magick::VPath& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 184 | const Magick::VPath& /*right_*/ ) |
| 185 | { |
| 186 | return ( 1 ); |
| 187 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 188 | MagickPPExport int Magick::operator != ( const Magick::VPath& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 189 | const Magick::VPath& /*right_*/ ) |
| 190 | { |
| 191 | return ( 0 ); |
| 192 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 193 | MagickPPExport int Magick::operator > ( const Magick::VPath& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 194 | const Magick::VPath& /*right_*/ ) |
| 195 | { |
| 196 | return ( 0 ); |
| 197 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 198 | MagickPPExport int Magick::operator < ( const Magick::VPath& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 199 | const Magick::VPath& /*right_*/ ) |
| 200 | { |
| 201 | return ( 0 ); |
| 202 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 203 | MagickPPExport int Magick::operator >= ( const Magick::VPath& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 204 | const Magick::VPath& right_ ) |
| 205 | { |
| 206 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 207 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 208 | MagickPPExport int Magick::operator <= ( const Magick::VPath& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 209 | const Magick::VPath& right_ ) |
| 210 | { |
| 211 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 212 | } |
| 213 | |
| 214 | // |
| 215 | // Drawable Objects |
| 216 | // |
| 217 | |
| 218 | // Affine (scaling, rotation, and translation) |
| 219 | Magick::DrawableAffine::DrawableAffine( double sx_, double sy_, |
| 220 | double rx_, double ry_, |
| 221 | double tx_, double ty_ ) |
| 222 | { |
| 223 | _affine.sx = sx_; |
| 224 | _affine.rx = rx_; |
| 225 | _affine.ry = ry_; |
| 226 | _affine.sy = sy_; |
| 227 | _affine.tx = tx_; |
| 228 | _affine.ty = ty_; |
| 229 | } |
| 230 | Magick::DrawableAffine::DrawableAffine( void ) |
| 231 | { |
| 232 | GetAffineMatrix(&_affine); |
| 233 | } |
| 234 | Magick::DrawableAffine::~DrawableAffine( void ) |
| 235 | { |
| 236 | } |
| 237 | void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ ) const |
| 238 | { |
| 239 | DrawAffine( context_, &_affine ); |
| 240 | } |
| 241 | Magick::DrawableBase* Magick::DrawableAffine::copy() const |
| 242 | { |
| 243 | return new DrawableAffine(*this); |
| 244 | } |
| 245 | |
| 246 | // Arc |
| 247 | Magick::DrawableArc::~DrawableArc( void ) |
| 248 | { |
| 249 | } |
| 250 | void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ ) const |
| 251 | { |
| 252 | DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees ); |
| 253 | } |
| 254 | Magick::DrawableBase* Magick::DrawableArc::copy() const |
| 255 | { |
| 256 | return new DrawableArc(*this); |
| 257 | } |
| 258 | |
| 259 | // |
| 260 | // Bezier curve |
| 261 | // |
| 262 | // Construct from coordinates (Coordinate list must contain at least three members) |
| 263 | Magick::DrawableBezier::DrawableBezier ( const CoordinateList &coordinates_ ) |
| 264 | : _coordinates(coordinates_) |
| 265 | { |
| 266 | } |
| 267 | // Copy constructor |
| 268 | Magick::DrawableBezier::DrawableBezier( const Magick::DrawableBezier& original_ ) |
| 269 | : DrawableBase (original_), |
| 270 | _coordinates(original_._coordinates) |
| 271 | { |
| 272 | } |
| 273 | // Destructor |
| 274 | Magick::DrawableBezier::~DrawableBezier( void ) |
| 275 | { |
| 276 | } |
| 277 | void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ ) const |
| 278 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 279 | size_t num_coords = (size_t) _coordinates.size(); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 280 | PointInfo *coordinates = new PointInfo[num_coords]; |
| 281 | |
| 282 | PointInfo *q = coordinates; |
| 283 | CoordinateList::const_iterator p = _coordinates.begin(); |
| 284 | |
| 285 | while( p != _coordinates.end() ) |
| 286 | { |
| 287 | q->x = p->x(); |
| 288 | q->y = p->y(); |
| 289 | q++; |
| 290 | p++; |
| 291 | } |
| 292 | |
| 293 | DrawBezier( context_, num_coords, coordinates ); |
| 294 | delete [] coordinates; |
| 295 | } |
| 296 | Magick::DrawableBase* Magick::DrawableBezier::copy() const |
| 297 | { |
| 298 | return new DrawableBezier(*this); |
| 299 | } |
| 300 | |
| 301 | // |
| 302 | //Clip Path |
| 303 | // |
| 304 | |
| 305 | // Pop (terminate) Clip path definition |
| 306 | Magick::DrawablePopClipPath::~DrawablePopClipPath ( void ) |
| 307 | { |
| 308 | } |
| 309 | void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ ) const |
| 310 | { |
| 311 | DrawPopClipPath( context_ ); |
| 312 | DrawPopDefs(context_); |
| 313 | } |
| 314 | Magick::DrawableBase* Magick::DrawablePopClipPath::copy() const |
| 315 | { |
| 316 | return new DrawablePopClipPath(*this); |
| 317 | } |
| 318 | |
| 319 | // Push clip path definition |
| 320 | Magick::DrawablePushClipPath::DrawablePushClipPath( const std::string &id_) |
| 321 | : _id(id_.c_str()) //multithread safe const char* |
| 322 | { |
| 323 | } |
| 324 | Magick::DrawablePushClipPath::DrawablePushClipPath |
| 325 | ( const Magick::DrawablePushClipPath& original_ ) //multithread safe const char* |
| 326 | : DrawableBase (original_), |
| 327 | _id(original_._id.c_str()) |
| 328 | { |
| 329 | } |
| 330 | Magick::DrawablePushClipPath::~DrawablePushClipPath( void ) |
| 331 | { |
| 332 | } |
| 333 | void Magick::DrawablePushClipPath::operator() |
| 334 | ( MagickCore::DrawingWand * context_ ) const |
| 335 | { |
| 336 | DrawPushDefs(context_); |
| 337 | DrawPushClipPath( context_, _id.c_str()); |
| 338 | } |
| 339 | Magick::DrawableBase* Magick::DrawablePushClipPath::copy() const |
| 340 | { |
| 341 | return new DrawablePushClipPath(*this); |
| 342 | } |
| 343 | // |
| 344 | // ClipPath |
| 345 | // |
| 346 | Magick::DrawableClipPath::DrawableClipPath( const std::string &id_ ) |
| 347 | :_id(id_.c_str()) |
| 348 | { |
| 349 | } |
| 350 | |
| 351 | Magick::DrawableClipPath::DrawableClipPath ( const Magick::DrawableClipPath& original_ ) |
| 352 | : DrawableBase (original_), |
| 353 | _id(original_._id.c_str()) |
| 354 | { |
| 355 | } |
| 356 | Magick::DrawableClipPath::~DrawableClipPath( void ) |
| 357 | { |
| 358 | } |
| 359 | void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ ) const |
| 360 | { |
| 361 | (void) DrawSetClipPath( context_, _id.c_str()); |
| 362 | } |
| 363 | Magick::DrawableBase* Magick::DrawableClipPath::copy() const |
| 364 | { |
| 365 | return new DrawableClipPath(*this); |
| 366 | } |
| 367 | |
| 368 | // Circle |
| 369 | Magick::DrawableCircle::~DrawableCircle ( void ) |
| 370 | { |
| 371 | } |
| 372 | void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ ) const |
| 373 | { |
| 374 | DrawCircle( context_, _originX, _originY, _perimX, _perimY ); |
| 375 | } |
| 376 | Magick::DrawableBase* Magick::DrawableCircle::copy() const |
| 377 | { |
| 378 | return new DrawableCircle(*this); |
| 379 | } |
| 380 | |
| 381 | // Colorize at point using PaintMethod |
| 382 | Magick::DrawableColor::~DrawableColor( void ) |
| 383 | { |
| 384 | } |
| 385 | void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ ) const |
| 386 | { |
| 387 | DrawColor( context_, _x, _y, _paintMethod ); |
| 388 | } |
| 389 | Magick::DrawableBase* Magick::DrawableColor::copy() const |
| 390 | { |
| 391 | return new DrawableColor(*this); |
| 392 | } |
| 393 | |
| 394 | // Draw image at point |
| 395 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 396 | ( double x_, double y_, |
| 397 | double width_, double height_, |
| 398 | const std::string &filename_, |
| 399 | Magick::CompositeOperator composition_ ) |
| 400 | : _composition(composition_), |
| 401 | _x(x_), |
| 402 | _y(y_), |
| 403 | _width(width_), |
| 404 | _height(height_), |
| 405 | _image(new Image(filename_)) |
| 406 | { |
| 407 | } |
| 408 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 409 | ( double x_, double y_, |
| 410 | double width_, double height_, |
| 411 | const Magick::Image &image_, |
| 412 | Magick::CompositeOperator composition_ ) |
| 413 | : _composition(composition_), |
| 414 | _x(x_), |
| 415 | _y(y_), |
| 416 | _width(width_), |
| 417 | _height(height_), |
| 418 | _image(new Image(image_)) |
| 419 | { |
| 420 | } |
| 421 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 422 | ( double x_, double y_, |
| 423 | double width_, double height_, |
| 424 | const std::string &filename_ ) |
| 425 | :_composition(CopyCompositeOp), |
| 426 | _x(x_), |
| 427 | _y(y_), |
| 428 | _width(width_), |
| 429 | _height(height_), |
| 430 | _image(new Image(filename_)) |
| 431 | { |
| 432 | } |
| 433 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 434 | ( double x_, double y_, |
| 435 | double width_, double height_, |
| 436 | const Magick::Image &image_ ) |
| 437 | :_composition(CopyCompositeOp), |
| 438 | _x(x_), |
| 439 | _y(y_), |
| 440 | _width(width_), |
| 441 | _height(height_), |
| 442 | _image(new Image(image_)) |
| 443 | { |
| 444 | } |
| 445 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 446 | ( double x_, double y_, |
| 447 | const std::string &filename_ ) |
| 448 | : _composition(CopyCompositeOp), |
| 449 | _x(x_), |
| 450 | _y(y_), |
| 451 | _width(0), |
| 452 | _height(0), |
| 453 | _image(new Image(filename_)) |
| 454 | { |
| 455 | _width=_image->columns(); |
| 456 | _height=_image->rows(); |
| 457 | } |
| 458 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 459 | ( double x_, double y_, |
| 460 | const Magick::Image &image_ ) |
| 461 | : _composition(CopyCompositeOp), |
| 462 | _x(x_), |
| 463 | _y(y_), |
| 464 | _width(0), |
| 465 | _height(0), |
| 466 | _image(new Image(image_)) |
| 467 | { |
| 468 | _width=_image->columns(); |
| 469 | _height=_image->rows(); |
| 470 | } |
| 471 | // Copy constructor |
| 472 | Magick::DrawableCompositeImage::DrawableCompositeImage |
| 473 | ( const Magick::DrawableCompositeImage& original_ ) |
| 474 | : Magick::DrawableBase(original_), |
| 475 | _composition(original_._composition), |
| 476 | _x(original_._x), |
| 477 | _y(original_._y), |
| 478 | _width(original_._width), |
| 479 | _height(original_._height), |
| 480 | _image(new Image(*original_._image)) |
| 481 | { |
| 482 | } |
| 483 | Magick::DrawableCompositeImage::~DrawableCompositeImage( void ) |
| 484 | { |
| 485 | delete _image; |
| 486 | } |
| 487 | // Assignment operator |
| 488 | Magick::DrawableCompositeImage& Magick::DrawableCompositeImage::operator= |
| 489 | (const Magick::DrawableCompositeImage& original_ ) |
| 490 | { |
| 491 | // If not being set to ourself |
| 492 | if ( this != &original_ ) |
| 493 | { |
| 494 | _composition = original_._composition; |
| 495 | _x = original_._x; |
| 496 | _y = original_._y; |
| 497 | _width = original_._width; |
| 498 | _height = original_._height; |
| 499 | Image* temp_image = new Image(*original_._image); |
| 500 | delete _image; |
| 501 | _image = temp_image; |
| 502 | } |
| 503 | return *this; |
| 504 | } |
| 505 | void Magick::DrawableCompositeImage::filename( const std::string &filename_ ) |
| 506 | { |
| 507 | Image* temp_image = new Image(filename_); |
| 508 | delete _image; |
| 509 | _image = temp_image; |
| 510 | } |
| 511 | std::string Magick::DrawableCompositeImage::filename( void ) const |
| 512 | { |
| 513 | return _image->fileName(); |
| 514 | } |
| 515 | |
| 516 | void Magick::DrawableCompositeImage::image( const Magick::Image &image_ ) |
| 517 | { |
| 518 | Image* temp_image = new Image(image_); |
| 519 | delete _image; |
| 520 | _image = temp_image; |
| 521 | } |
| 522 | Magick::Image Magick::DrawableCompositeImage::image( void ) const |
| 523 | { |
| 524 | return *_image; |
| 525 | } |
| 526 | |
| 527 | // Specify image format used to output Base64 inlined image data. |
| 528 | void Magick::DrawableCompositeImage::magick( std::string magick_ ) |
| 529 | { |
| 530 | _image->magick( magick_ ); |
| 531 | } |
| 532 | std::string Magick::DrawableCompositeImage::magick( void ) |
| 533 | { |
| 534 | return _image->magick(); |
| 535 | } |
| 536 | |
| 537 | void Magick::DrawableCompositeImage::operator() |
| 538 | ( MagickCore::DrawingWand * context_ ) const |
| 539 | { |
| 540 | MagickWand |
| 541 | *magick_wand; |
| 542 | |
| 543 | magick_wand=NewMagickWandFromImage(_image->constImage()); |
| 544 | (void) DrawComposite( context_, _composition, _x, _y, _width, _height, |
| 545 | magick_wand ); |
| 546 | magick_wand=DestroyMagickWand(magick_wand); |
| 547 | } |
| 548 | |
| 549 | Magick::DrawableBase* Magick::DrawableCompositeImage::copy() const |
| 550 | { |
| 551 | return new DrawableCompositeImage(*this); |
| 552 | } |
| 553 | |
| 554 | // Ellipse |
| 555 | Magick::DrawableEllipse::~DrawableEllipse( void ) |
| 556 | { |
| 557 | } |
| 558 | void Magick::DrawableEllipse::operator() |
| 559 | ( MagickCore::DrawingWand * context_ ) const |
| 560 | { |
| 561 | DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY, |
| 562 | _arcStart, _arcEnd ); |
| 563 | } |
| 564 | Magick::DrawableBase* Magick::DrawableEllipse::copy() const |
| 565 | { |
| 566 | return new DrawableEllipse(*this); |
| 567 | } |
| 568 | |
| 569 | // Specify drawing fill color |
| 570 | Magick::DrawableFillColor::DrawableFillColor( const Magick::Color &color_ ) |
| 571 | : _color(color_) |
| 572 | { |
| 573 | } |
| 574 | Magick::DrawableFillColor::DrawableFillColor |
| 575 | ( const Magick::DrawableFillColor& original_ ) |
| 576 | : DrawableBase (original_), |
| 577 | _color(original_._color) |
| 578 | { |
| 579 | } |
| 580 | Magick::DrawableFillColor::~DrawableFillColor( void ) |
| 581 | { |
| 582 | } |
| 583 | void Magick::DrawableFillColor::operator() |
| 584 | ( MagickCore::DrawingWand * context_ ) const |
| 585 | { |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 586 | PixelInfo color = static_cast<PixelInfo>(_color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 587 | PixelWand *pixel_wand=NewPixelWand(); |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 588 | PixelSetQuantumPacket(pixel_wand,&color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 589 | DrawSetFillColor(context_,pixel_wand); |
| 590 | pixel_wand=DestroyPixelWand(pixel_wand); |
| 591 | } |
| 592 | Magick::DrawableBase* Magick::DrawableFillColor::copy() const |
| 593 | { |
| 594 | return new DrawableFillColor(*this); |
| 595 | } |
| 596 | |
| 597 | // Specify drawing fill fule |
| 598 | Magick::DrawableFillRule::~DrawableFillRule ( void ) |
| 599 | { |
| 600 | } |
| 601 | void Magick::DrawableFillRule::operator() |
| 602 | ( MagickCore::DrawingWand * context_ ) const |
| 603 | { |
| 604 | DrawSetFillRule( context_, _fillRule ); |
| 605 | } |
| 606 | Magick::DrawableBase* Magick::DrawableFillRule::copy() const |
| 607 | { |
| 608 | return new DrawableFillRule(*this); |
| 609 | } |
| 610 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 611 | // Specify drawing fill alpha |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 612 | Magick::DrawableFillAlpha::~DrawableFillAlpha ( void ) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 613 | { |
| 614 | } |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 615 | void Magick::DrawableFillAlpha::operator() |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 616 | ( MagickCore::DrawingWand * context_ ) const |
| 617 | { |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 618 | DrawSetFillAlpha( context_, _alpha ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 619 | } |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 620 | Magick::DrawableBase* Magick::DrawableFillAlpha::copy() const |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 621 | { |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 622 | return new DrawableFillAlpha(*this); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | // Specify text font |
| 626 | Magick::DrawableFont::DrawableFont ( const std::string &font_ ) |
| 627 | : _font(font_), |
| 628 | _family(), |
| 629 | _style(Magick::AnyStyle), |
| 630 | _weight(400), |
| 631 | _stretch(Magick::NormalStretch) |
| 632 | { |
| 633 | } |
| 634 | Magick::DrawableFont::DrawableFont ( const std::string &family_, |
| 635 | Magick::StyleType style_, |
cristy | 9e7ec53 | 2010-06-03 18:40:45 +0000 | [diff] [blame] | 636 | const unsigned int weight_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 637 | Magick::StretchType stretch_ ) |
| 638 | : _font(), |
| 639 | _family(family_), |
| 640 | _style(style_), |
| 641 | _weight(weight_), |
| 642 | _stretch(stretch_) |
| 643 | { |
| 644 | } |
| 645 | Magick::DrawableFont::DrawableFont ( const Magick::DrawableFont& original_ ) |
| 646 | : DrawableBase (original_), |
| 647 | _font(original_._font), |
| 648 | _family(original_._family), |
| 649 | _style(original_._style), |
| 650 | _weight(original_._weight), |
| 651 | _stretch(original_._stretch) |
| 652 | { |
| 653 | } |
| 654 | Magick::DrawableFont::~DrawableFont ( void ) |
| 655 | { |
| 656 | } |
| 657 | void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ ) const |
| 658 | { |
| 659 | // font |
| 660 | if(_font.length()) |
| 661 | { |
| 662 | (void) DrawSetFont( context_, _font.c_str() ); |
| 663 | } |
| 664 | |
| 665 | if(_family.length()) |
| 666 | { |
| 667 | // font-family |
| 668 | (void) DrawSetFontFamily( context_, _family.c_str() ); |
| 669 | |
| 670 | // font-style |
| 671 | DrawSetFontStyle( context_, _style ); |
| 672 | |
| 673 | // font-weight |
| 674 | DrawSetFontWeight( context_, _weight ); |
| 675 | |
| 676 | // font-stretch |
| 677 | DrawSetFontStretch( context_, _stretch ); |
| 678 | } |
| 679 | } |
| 680 | Magick::DrawableBase* Magick::DrawableFont::copy() const |
| 681 | { |
| 682 | return new DrawableFont(*this); |
| 683 | } |
| 684 | |
| 685 | // Specify text positioning gravity |
| 686 | Magick::DrawableGravity::~DrawableGravity ( void ) |
| 687 | { |
| 688 | } |
| 689 | void Magick::DrawableGravity::operator() |
| 690 | ( MagickCore::DrawingWand * context_ ) const |
| 691 | { |
| 692 | DrawSetGravity( context_, _gravity ); |
| 693 | } |
| 694 | Magick::DrawableBase* Magick::DrawableGravity::copy() const |
| 695 | { |
| 696 | return new DrawableGravity(*this); |
| 697 | } |
| 698 | |
| 699 | // Line |
| 700 | Magick::DrawableLine::~DrawableLine ( void ) |
| 701 | { |
| 702 | } |
| 703 | void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ ) const |
| 704 | { |
| 705 | DrawLine( context_, _startX, _startY, _endX, _endY ); |
| 706 | } |
| 707 | Magick::DrawableBase* Magick::DrawableLine::copy() const |
| 708 | { |
| 709 | return new DrawableLine(*this); |
| 710 | } |
| 711 | |
| 712 | // Change pixel matte value to transparent using PaintMethod |
| 713 | Magick::DrawableMatte::~DrawableMatte ( void ) |
| 714 | { |
| 715 | } |
| 716 | void Magick::DrawableMatte::operator()( MagickCore::DrawingWand * context_ ) const |
| 717 | { |
| 718 | DrawMatte( context_, _x, _y, _paintMethod ); |
| 719 | } |
| 720 | Magick::DrawableBase* Magick::DrawableMatte::copy() const |
| 721 | { |
| 722 | return new DrawableMatte(*this); |
| 723 | } |
| 724 | |
| 725 | // Drawable Path |
| 726 | Magick::DrawablePath::DrawablePath ( const VPathList &path_ ) |
| 727 | : _path(path_) |
| 728 | { |
| 729 | } |
| 730 | Magick::DrawablePath::DrawablePath ( const Magick::DrawablePath& original_ ) |
| 731 | : DrawableBase (original_), |
| 732 | _path(original_._path) |
| 733 | { |
| 734 | } |
| 735 | Magick::DrawablePath::~DrawablePath ( void ) |
| 736 | { |
| 737 | } |
| 738 | void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ ) const |
| 739 | { |
| 740 | DrawPathStart( context_ ); |
| 741 | |
| 742 | for( VPathList::const_iterator p = _path.begin(); |
| 743 | p != _path.end(); p++ ) |
| 744 | p->operator()( context_ ); // FIXME, how to quit loop on error? |
| 745 | |
| 746 | DrawPathFinish( context_ ); |
| 747 | } |
| 748 | Magick::DrawableBase* Magick::DrawablePath::copy() const |
| 749 | { |
| 750 | return new DrawablePath(*this); |
| 751 | } |
| 752 | |
| 753 | // Point |
| 754 | Magick::DrawablePoint::~DrawablePoint ( void ) |
| 755 | { |
| 756 | } |
| 757 | void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ ) const |
| 758 | { |
| 759 | DrawPoint( context_, _x, _y ); |
| 760 | } |
| 761 | Magick::DrawableBase* Magick::DrawablePoint::copy() const |
| 762 | { |
| 763 | return new DrawablePoint(*this); |
| 764 | } |
| 765 | |
| 766 | // Text pointsize |
| 767 | Magick::DrawablePointSize::~DrawablePointSize ( void ) |
| 768 | { |
| 769 | } |
| 770 | void Magick::DrawablePointSize::operator() |
| 771 | ( MagickCore::DrawingWand * context_ ) const |
| 772 | { |
| 773 | DrawSetFontSize( context_, _pointSize ); |
| 774 | } |
| 775 | Magick::DrawableBase* Magick::DrawablePointSize::copy() const |
| 776 | { |
| 777 | return new DrawablePointSize(*this); |
| 778 | } |
| 779 | |
| 780 | // Polygon (Coordinate list must contain at least three members) |
| 781 | Magick::DrawablePolygon::DrawablePolygon ( const CoordinateList &coordinates_ ) |
| 782 | : _coordinates(coordinates_) |
| 783 | { |
| 784 | } |
| 785 | Magick::DrawablePolygon::DrawablePolygon |
| 786 | ( const Magick::DrawablePolygon& original_ ) |
| 787 | : DrawableBase (original_), |
| 788 | _coordinates(original_._coordinates) |
| 789 | { |
| 790 | } |
| 791 | Magick::DrawablePolygon::~DrawablePolygon ( void ) |
| 792 | { |
| 793 | } |
| 794 | void Magick::DrawablePolygon::operator() |
| 795 | ( MagickCore::DrawingWand * context_ ) const |
| 796 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 797 | size_t num_coords = (size_t) _coordinates.size(); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 798 | PointInfo *coordinates = new PointInfo[num_coords]; |
| 799 | |
| 800 | PointInfo *q = coordinates; |
| 801 | CoordinateList::const_iterator p = _coordinates.begin(); |
| 802 | |
| 803 | while( p != _coordinates.end() ) |
| 804 | { |
| 805 | q->x = p->x(); |
| 806 | q->y = p->y(); |
| 807 | q++; |
| 808 | p++; |
| 809 | } |
| 810 | |
| 811 | DrawPolygon( context_, num_coords, coordinates ); |
| 812 | delete [] coordinates; |
| 813 | } |
| 814 | Magick::DrawableBase* Magick::DrawablePolygon::copy() const |
| 815 | { |
| 816 | return new DrawablePolygon(*this); |
| 817 | } |
| 818 | |
| 819 | // Polyline (Coordinate list must contain at least three members) |
| 820 | Magick::DrawablePolyline::DrawablePolyline |
| 821 | ( const CoordinateList &coordinates_ ) |
| 822 | : _coordinates(coordinates_) |
| 823 | { |
| 824 | } |
| 825 | Magick::DrawablePolyline::DrawablePolyline |
| 826 | ( const Magick::DrawablePolyline& original_ ) |
| 827 | : DrawableBase (original_), |
| 828 | _coordinates(original_._coordinates) |
| 829 | { |
| 830 | } |
| 831 | Magick::DrawablePolyline::~DrawablePolyline ( void ) |
| 832 | { |
| 833 | } |
| 834 | void Magick::DrawablePolyline::operator() |
| 835 | ( MagickCore::DrawingWand * context_ ) const |
| 836 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 837 | size_t num_coords = (size_t) _coordinates.size(); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 838 | PointInfo *coordinates = new PointInfo[num_coords]; |
| 839 | |
| 840 | PointInfo *q = coordinates; |
| 841 | CoordinateList::const_iterator p = _coordinates.begin(); |
| 842 | |
| 843 | while( p != _coordinates.end() ) |
| 844 | { |
| 845 | q->x = p->x(); |
| 846 | q->y = p->y(); |
| 847 | q++; |
| 848 | p++; |
| 849 | } |
| 850 | |
| 851 | DrawPolyline( context_, num_coords, coordinates ); |
| 852 | delete [] coordinates; |
| 853 | } |
| 854 | Magick::DrawableBase* Magick::DrawablePolyline::copy() const |
| 855 | { |
| 856 | return new DrawablePolyline(*this); |
| 857 | } |
| 858 | |
| 859 | // Pop Graphic Context |
| 860 | Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext ( void ) |
| 861 | { |
| 862 | } |
| 863 | void Magick::DrawablePopGraphicContext::operator() |
| 864 | ( MagickCore::DrawingWand * context_ ) const |
| 865 | { |
| 866 | PopDrawingWand( context_ ); |
| 867 | } |
| 868 | Magick::DrawableBase* Magick::DrawablePopGraphicContext::copy() const |
| 869 | { |
| 870 | return new DrawablePopGraphicContext(*this); |
| 871 | } |
| 872 | |
| 873 | // Push Graphic Context |
| 874 | Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext ( void ) |
| 875 | { |
| 876 | } |
| 877 | void Magick::DrawablePushGraphicContext::operator() |
| 878 | ( MagickCore::DrawingWand * context_ ) const |
| 879 | { |
| 880 | PushDrawingWand( context_ ); |
| 881 | } |
| 882 | Magick::DrawableBase* Magick::DrawablePushGraphicContext::copy() const |
| 883 | { |
| 884 | return new DrawablePushGraphicContext(*this); |
| 885 | } |
| 886 | |
| 887 | // Pop (terminate) Pattern definition |
| 888 | Magick::DrawablePopPattern::~DrawablePopPattern ( void ) |
| 889 | { |
| 890 | } |
| 891 | void Magick::DrawablePopPattern::operator() |
| 892 | ( MagickCore::DrawingWand * context_ ) const |
| 893 | { |
| 894 | (void) DrawPopPattern( context_ ); |
| 895 | } |
| 896 | Magick::DrawableBase* Magick::DrawablePopPattern::copy() const |
| 897 | { |
| 898 | return new DrawablePopPattern(*this); |
| 899 | } |
| 900 | |
| 901 | // Push Pattern definition |
| 902 | Magick::DrawablePushPattern::DrawablePushPattern |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 903 | ( const std::string &id_, ssize_t x_, ssize_t y_, |
cristy | 4e0eef0 | 2010-05-30 21:52:21 +0000 | [diff] [blame] | 904 | size_t width_, size_t height_ ) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 905 | : _id(id_), |
| 906 | _x(x_), |
| 907 | _y(y_), |
| 908 | _width(width_), |
| 909 | _height(height_) |
| 910 | { |
| 911 | } |
| 912 | Magick::DrawablePushPattern::DrawablePushPattern |
| 913 | ( const Magick::DrawablePushPattern& original_ ) |
| 914 | : DrawableBase (original_), |
| 915 | _id(original_._id), |
| 916 | _x(original_._x), |
| 917 | _y(original_._y), |
| 918 | _width(original_._width), |
| 919 | _height(original_._height) |
| 920 | { |
| 921 | } |
| 922 | Magick::DrawablePushPattern::~DrawablePushPattern ( void ) |
| 923 | { |
| 924 | } |
| 925 | void Magick::DrawablePushPattern::operator() |
| 926 | ( MagickCore::DrawingWand * context_ ) const |
| 927 | { |
| 928 | (void) DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height ); |
| 929 | } |
| 930 | Magick::DrawableBase* Magick::DrawablePushPattern::copy() const |
| 931 | { |
| 932 | return new DrawablePushPattern(*this); |
| 933 | } |
| 934 | |
| 935 | // Rectangle |
| 936 | Magick::DrawableRectangle::~DrawableRectangle ( void ) |
| 937 | { |
| 938 | } |
| 939 | void Magick::DrawableRectangle::operator() |
| 940 | ( MagickCore::DrawingWand * context_ ) const |
| 941 | { |
| 942 | DrawRectangle( context_, _upperLeftX, _upperLeftY, |
| 943 | _lowerRightX, _lowerRightY ); |
| 944 | } |
| 945 | Magick::DrawableBase* Magick::DrawableRectangle::copy() const |
| 946 | { |
| 947 | return new DrawableRectangle(*this); |
| 948 | } |
| 949 | |
| 950 | // Apply Rotation |
| 951 | Magick::DrawableRotation::~DrawableRotation ( void ) |
| 952 | { |
| 953 | } |
| 954 | void Magick::DrawableRotation::operator() |
| 955 | ( MagickCore::DrawingWand * context_ ) const |
| 956 | { |
| 957 | DrawRotate( context_, _angle ); |
| 958 | } |
| 959 | Magick::DrawableBase* Magick::DrawableRotation::copy() const |
| 960 | { |
| 961 | return new DrawableRotation(*this); |
| 962 | } |
| 963 | |
| 964 | // Round Rectangle |
| 965 | Magick::DrawableRoundRectangle::~DrawableRoundRectangle ( void ) |
| 966 | { |
| 967 | } |
| 968 | void Magick::DrawableRoundRectangle::operator() |
| 969 | ( MagickCore::DrawingWand * context_ ) const |
| 970 | { |
| 971 | DrawRoundRectangle( context_, _centerX,_centerY, _width,_hight, |
| 972 | _cornerWidth, _cornerHeight); |
| 973 | } |
| 974 | Magick::DrawableBase* Magick::DrawableRoundRectangle::copy() const |
| 975 | { |
| 976 | return new DrawableRoundRectangle(*this); |
| 977 | } |
| 978 | |
| 979 | // Apply Scaling |
| 980 | Magick::DrawableScaling::~DrawableScaling ( void ) |
| 981 | { |
| 982 | } |
| 983 | void Magick::DrawableScaling::operator() |
| 984 | ( MagickCore::DrawingWand * context_ ) const |
| 985 | { |
| 986 | DrawScale( context_, _x, _y ); |
| 987 | } |
| 988 | Magick::DrawableBase* Magick::DrawableScaling::copy() const |
| 989 | { |
| 990 | return new DrawableScaling(*this); |
| 991 | } |
| 992 | |
| 993 | // Apply Skew in the X direction |
| 994 | Magick::DrawableSkewX::~DrawableSkewX ( void ) |
| 995 | { |
| 996 | } |
| 997 | void Magick::DrawableSkewX::operator() |
| 998 | ( MagickCore::DrawingWand * context_ ) const |
| 999 | { |
| 1000 | DrawSkewX( context_, _angle ); |
| 1001 | } |
| 1002 | Magick::DrawableBase* Magick::DrawableSkewX::copy() const |
| 1003 | { |
| 1004 | return new DrawableSkewX(*this); |
| 1005 | } |
| 1006 | |
| 1007 | // Apply Skew in the Y direction |
| 1008 | Magick::DrawableSkewY::~DrawableSkewY ( void ) |
| 1009 | { |
| 1010 | } |
| 1011 | void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ ) const |
| 1012 | { |
| 1013 | DrawSkewY( context_, _angle ); |
| 1014 | } |
| 1015 | Magick::DrawableBase* Magick::DrawableSkewY::copy() const |
| 1016 | { |
| 1017 | return new DrawableSkewY(*this); |
| 1018 | } |
| 1019 | |
| 1020 | // Stroke dasharray |
| 1021 | Magick::DrawableDashArray::DrawableDashArray( const double* dasharray_ ) |
| 1022 | : _size(0), |
| 1023 | _dasharray(0) |
| 1024 | { |
| 1025 | dasharray( dasharray_ ); |
| 1026 | } |
| 1027 | // Deprecated, do not use for new code, and migrate existing code to |
| 1028 | // using double* |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1029 | Magick::DrawableDashArray::DrawableDashArray( const size_t* dasharray_ ) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1030 | : _size(0), |
| 1031 | _dasharray(0) |
| 1032 | { |
| 1033 | dasharray( dasharray_ ); |
| 1034 | } |
| 1035 | Magick::DrawableDashArray::DrawableDashArray |
| 1036 | (const Magick::DrawableDashArray& original_) |
| 1037 | : DrawableBase (original_), |
| 1038 | _size(0), |
| 1039 | _dasharray(0) |
| 1040 | { |
| 1041 | dasharray( original_._dasharray ); |
| 1042 | } |
| 1043 | Magick::DrawableDashArray::~DrawableDashArray( void ) |
| 1044 | { |
cristy | 8e03eb0 | 2010-08-05 13:54:06 +0000 | [diff] [blame] | 1045 | delete [] _dasharray; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1046 | _size = 0; |
| 1047 | _dasharray = 0; |
| 1048 | } |
| 1049 | Magick::DrawableDashArray& Magick::DrawableDashArray::operator= |
| 1050 | (const Magick::DrawableDashArray &original_) |
| 1051 | { |
| 1052 | if( this != &original_ ) |
| 1053 | { |
| 1054 | dasharray( original_._dasharray ); |
| 1055 | } |
| 1056 | return *this; |
| 1057 | } |
| 1058 | void Magick::DrawableDashArray::operator() |
| 1059 | ( MagickCore::DrawingWand * context_ ) const |
| 1060 | { |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 1061 | (void) DrawSetStrokeDashArray( context_, (size_t) _size, _dasharray ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1062 | } |
| 1063 | Magick::DrawableBase* Magick::DrawableDashArray::copy() const |
| 1064 | { |
| 1065 | return new DrawableDashArray(*this); |
| 1066 | } |
| 1067 | void Magick::DrawableDashArray::dasharray ( const double* dasharray_ ) |
| 1068 | { |
| 1069 | _dasharray=(double *) RelinquishMagickMemory(_dasharray); |
| 1070 | |
| 1071 | if(dasharray_) |
| 1072 | { |
| 1073 | // Count elements in dash array |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1074 | size_t n = 0; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1075 | { |
| 1076 | const double *p = dasharray_; |
| 1077 | while(*p++ != 0) |
| 1078 | n++; |
| 1079 | } |
| 1080 | _size = n; |
| 1081 | |
| 1082 | // Allocate elements |
| 1083 | _dasharray=static_cast<double*>(AcquireMagickMemory((n+1)*sizeof(double))); |
| 1084 | // Copy elements |
| 1085 | { |
| 1086 | double *q = _dasharray; |
| 1087 | const double *p = dasharray_; |
| 1088 | while( *p ) |
| 1089 | *q++=*p++; |
| 1090 | *q=0; |
| 1091 | } |
| 1092 | } |
| 1093 | } |
| 1094 | // This method is deprecated. Don't use for new code, and migrate existing |
| 1095 | // code to the const double* version. |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1096 | void Magick::DrawableDashArray::dasharray( const size_t* dasharray_ ) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1097 | { |
| 1098 | _dasharray=(double *) RelinquishMagickMemory(_dasharray); |
| 1099 | |
| 1100 | if(dasharray_) |
| 1101 | { |
| 1102 | // Count elements in dash array |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1103 | size_t n = 0; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1104 | { |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1105 | const size_t *p = dasharray_; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1106 | while(*p++ != 0) |
| 1107 | n++; |
| 1108 | } |
| 1109 | _size = n; |
| 1110 | |
| 1111 | // Allocate elements |
| 1112 | _dasharray=static_cast<double*>(AcquireMagickMemory((n+1)*sizeof(double))); |
| 1113 | // Copy elements |
| 1114 | { |
| 1115 | double *q = _dasharray; |
cristy | eaedf06 | 2010-05-29 22:36:02 +0000 | [diff] [blame] | 1116 | const size_t *p = dasharray_; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1117 | while( *p ) |
| 1118 | *q++=static_cast<double>(*p++); |
| 1119 | *q=0; |
| 1120 | } |
| 1121 | } |
| 1122 | } |
| 1123 | |
| 1124 | // Stroke dashoffset |
| 1125 | Magick::DrawableDashOffset::~DrawableDashOffset ( void ) |
| 1126 | { |
| 1127 | } |
| 1128 | void Magick::DrawableDashOffset::operator() |
| 1129 | ( MagickCore::DrawingWand * context_ ) const |
| 1130 | { |
| 1131 | DrawSetStrokeDashOffset( context_, _offset ); |
| 1132 | } |
| 1133 | Magick::DrawableBase* Magick::DrawableDashOffset::copy() const |
| 1134 | { |
| 1135 | return new DrawableDashOffset(*this); |
| 1136 | } |
| 1137 | |
| 1138 | // Stroke linecap |
| 1139 | Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void ) |
| 1140 | { |
| 1141 | } |
| 1142 | void Magick::DrawableStrokeLineCap::operator() |
| 1143 | ( MagickCore::DrawingWand * context_ ) const |
| 1144 | { |
| 1145 | DrawSetStrokeLineCap( context_, _linecap ); |
| 1146 | } |
| 1147 | Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const |
| 1148 | { |
| 1149 | return new DrawableStrokeLineCap(*this); |
| 1150 | } |
| 1151 | |
| 1152 | // Stroke linejoin |
| 1153 | Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void ) |
| 1154 | { |
| 1155 | } |
| 1156 | void Magick::DrawableStrokeLineJoin::operator() |
| 1157 | ( MagickCore::DrawingWand * context_ ) const |
| 1158 | { |
| 1159 | DrawSetStrokeLineJoin( context_, _linejoin ); |
| 1160 | } |
| 1161 | Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const |
| 1162 | { |
| 1163 | return new DrawableStrokeLineJoin(*this); |
| 1164 | } |
| 1165 | |
| 1166 | // Stroke miterlimit |
| 1167 | Magick::DrawableMiterLimit::~DrawableMiterLimit ( void ) |
| 1168 | { |
| 1169 | } |
| 1170 | void Magick::DrawableMiterLimit::operator() |
| 1171 | ( MagickCore::DrawingWand * context_ ) const |
| 1172 | { |
| 1173 | DrawSetStrokeMiterLimit( context_, _miterlimit ); |
| 1174 | } |
| 1175 | Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const |
| 1176 | { |
| 1177 | return new DrawableMiterLimit(*this); |
| 1178 | } |
| 1179 | |
| 1180 | // Stroke antialias |
| 1181 | Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void ) |
| 1182 | { |
| 1183 | } |
| 1184 | void Magick::DrawableStrokeAntialias::operator() |
| 1185 | ( MagickCore::DrawingWand * context_ ) const |
| 1186 | { |
| 1187 | DrawSetStrokeAntialias( context_, static_cast<MagickBooleanType> |
| 1188 | (_flag ? MagickTrue : MagickFalse) ); |
| 1189 | } |
| 1190 | Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const |
| 1191 | { |
| 1192 | return new DrawableStrokeAntialias(*this); |
| 1193 | } |
| 1194 | |
| 1195 | // Stroke color |
| 1196 | Magick::DrawableStrokeColor::DrawableStrokeColor |
| 1197 | ( const Magick::Color &color_ ) |
| 1198 | : _color(color_) |
| 1199 | { |
| 1200 | } |
| 1201 | Magick::DrawableStrokeColor::DrawableStrokeColor |
| 1202 | ( const Magick::DrawableStrokeColor& original_ ) |
| 1203 | : DrawableBase (original_), |
| 1204 | _color(original_._color) |
| 1205 | { |
| 1206 | } |
| 1207 | Magick::DrawableStrokeColor::~DrawableStrokeColor ( void ) |
| 1208 | { |
| 1209 | } |
| 1210 | void Magick::DrawableStrokeColor::operator() |
| 1211 | ( MagickCore::DrawingWand * context_ ) const |
| 1212 | { |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 1213 | PixelInfo color = static_cast<PixelInfo>(_color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1214 | PixelWand *pixel_wand=NewPixelWand(); |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 1215 | PixelSetQuantumPacket(pixel_wand,&color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1216 | DrawSetStrokeColor(context_,pixel_wand); |
| 1217 | pixel_wand=DestroyPixelWand(pixel_wand); |
| 1218 | } |
| 1219 | Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const |
| 1220 | { |
| 1221 | return new DrawableStrokeColor(*this); |
| 1222 | } |
| 1223 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 1224 | // Stroke alpha |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 1225 | Magick::DrawableStrokeAlpha::~DrawableStrokeAlpha ( void ) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1226 | { |
| 1227 | } |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 1228 | void Magick::DrawableStrokeAlpha::operator() |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1229 | ( MagickCore::DrawingWand * context_ ) const |
| 1230 | { |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 1231 | DrawSetStrokeAlpha( context_, _alpha ); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1232 | } |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 1233 | Magick::DrawableBase* Magick::DrawableStrokeAlpha::copy() const |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1234 | { |
cristy | b6a294d | 2011-10-03 00:55:17 +0000 | [diff] [blame] | 1235 | return new DrawableStrokeAlpha(*this); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1236 | } |
| 1237 | |
| 1238 | // Stroke width |
| 1239 | Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void ) |
| 1240 | { |
| 1241 | } |
| 1242 | void Magick::DrawableStrokeWidth::operator() |
| 1243 | ( MagickCore::DrawingWand * context_ ) const |
| 1244 | { |
| 1245 | DrawSetStrokeWidth( context_, _width ); |
| 1246 | } |
| 1247 | Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const |
| 1248 | { |
| 1249 | return new DrawableStrokeWidth(*this); |
| 1250 | } |
| 1251 | |
| 1252 | // Draw text at point |
| 1253 | Magick::DrawableText::DrawableText ( const double x_, const double y_, |
| 1254 | const std::string &text_ ) |
| 1255 | : _x(x_), |
| 1256 | _y(y_), |
| 1257 | _text(text_), |
| 1258 | _encoding() |
| 1259 | { |
| 1260 | } |
| 1261 | Magick::DrawableText::DrawableText ( const double x_, const double y_, |
| 1262 | const std::string &text_, const std::string &encoding_) |
| 1263 | : _x(x_), |
| 1264 | _y(y_), |
| 1265 | _text(text_), |
| 1266 | _encoding(encoding_) |
| 1267 | { |
| 1268 | } |
| 1269 | Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ ) |
| 1270 | : DrawableBase (original_), |
| 1271 | _x(original_._x), |
| 1272 | _y(original_._y), |
| 1273 | _text(original_._text), |
| 1274 | _encoding(original_._encoding) |
| 1275 | { |
| 1276 | } |
| 1277 | Magick::DrawableText::~DrawableText ( void ) |
| 1278 | { |
| 1279 | } |
| 1280 | void Magick::DrawableText::operator() |
| 1281 | ( MagickCore::DrawingWand * context_ ) const |
| 1282 | { |
| 1283 | DrawSetTextEncoding( context_, _encoding.c_str() ); |
| 1284 | DrawAnnotation( context_, _x, _y, |
| 1285 | reinterpret_cast<const unsigned char*>(_text.c_str()) ); |
| 1286 | } |
| 1287 | Magick::DrawableBase* Magick::DrawableText::copy() const |
| 1288 | { |
| 1289 | return new DrawableText(*this); |
| 1290 | } |
| 1291 | |
| 1292 | // Text antialias |
| 1293 | Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ ) |
| 1294 | : _flag(flag_) |
| 1295 | { |
| 1296 | } |
| 1297 | Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ ) |
| 1298 | : DrawableBase (original_), |
| 1299 | _flag(original_._flag) |
| 1300 | { |
| 1301 | } |
| 1302 | Magick::DrawableTextAntialias::~DrawableTextAntialias ( void ) |
| 1303 | { |
| 1304 | } |
| 1305 | void Magick::DrawableTextAntialias::operator() |
| 1306 | ( MagickCore::DrawingWand * context_ ) const |
| 1307 | { |
| 1308 | DrawSetTextAntialias( context_, static_cast<MagickBooleanType> |
| 1309 | (_flag ? MagickTrue : MagickFalse) ); |
| 1310 | } |
| 1311 | Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const |
| 1312 | { |
| 1313 | return new DrawableTextAntialias(*this); |
| 1314 | } |
| 1315 | |
| 1316 | // Decoration (text decoration) |
| 1317 | Magick::DrawableTextDecoration::DrawableTextDecoration |
| 1318 | ( Magick::DecorationType decoration_ ) |
| 1319 | : _decoration(decoration_) |
| 1320 | { |
| 1321 | } |
| 1322 | Magick::DrawableTextDecoration::DrawableTextDecoration |
| 1323 | ( const Magick::DrawableTextDecoration &original_ ) |
| 1324 | : DrawableBase (original_), |
| 1325 | _decoration(original_._decoration) |
| 1326 | { |
| 1327 | } |
| 1328 | Magick::DrawableTextDecoration::~DrawableTextDecoration( void ) |
| 1329 | { |
| 1330 | } |
| 1331 | void Magick::DrawableTextDecoration::operator() |
| 1332 | ( MagickCore::DrawingWand * context_ ) const |
| 1333 | { |
| 1334 | DrawSetTextDecoration( context_, _decoration ); |
| 1335 | } |
| 1336 | Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const |
| 1337 | { |
| 1338 | return new DrawableTextDecoration(*this); |
| 1339 | } |
| 1340 | |
| 1341 | // Set text undercolor |
| 1342 | Magick::DrawableTextUnderColor::DrawableTextUnderColor |
| 1343 | ( const Magick::Color &color_ ) |
| 1344 | : _color(color_) |
| 1345 | { |
| 1346 | } |
| 1347 | Magick::DrawableTextUnderColor::DrawableTextUnderColor |
| 1348 | ( const Magick::DrawableTextUnderColor& original_ ) |
| 1349 | : DrawableBase (original_), |
| 1350 | _color(original_._color) |
| 1351 | { |
| 1352 | } |
| 1353 | Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void ) |
| 1354 | { |
| 1355 | } |
| 1356 | void Magick::DrawableTextUnderColor::operator() |
| 1357 | ( MagickCore::DrawingWand * context_ ) const |
| 1358 | { |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 1359 | PixelInfo color = static_cast<PixelInfo>(_color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1360 | PixelWand *pixel_wand=NewPixelWand(); |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 1361 | PixelSetQuantumPacket(pixel_wand,&color); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1362 | DrawSetTextUnderColor(context_,pixel_wand); |
| 1363 | pixel_wand=DestroyPixelWand(pixel_wand); |
| 1364 | } |
| 1365 | Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const |
| 1366 | { |
| 1367 | return new DrawableTextUnderColor(*this); |
| 1368 | } |
| 1369 | |
| 1370 | // Apply Translation |
| 1371 | Magick::DrawableTranslation::~DrawableTranslation ( void ) |
| 1372 | { |
| 1373 | } |
| 1374 | void Magick::DrawableTranslation::operator() |
| 1375 | ( MagickCore::DrawingWand * context_ ) const |
| 1376 | { |
| 1377 | DrawTranslate( context_, _x, _y ); |
| 1378 | } |
| 1379 | Magick::DrawableBase* Magick::DrawableTranslation::copy() const |
| 1380 | { |
| 1381 | return new DrawableTranslation(*this); |
| 1382 | } |
| 1383 | |
| 1384 | // Set the size of the viewbox |
| 1385 | Magick::DrawableViewbox::~DrawableViewbox ( void ) |
| 1386 | { |
| 1387 | } |
| 1388 | void Magick::DrawableViewbox::operator() |
| 1389 | ( MagickCore::DrawingWand * context_ ) const |
| 1390 | { |
| 1391 | DrawSetViewbox( context_, _x1, _y1, _x2, _y2 ); |
| 1392 | } |
| 1393 | Magick::DrawableBase* Magick::DrawableViewbox::copy() const |
| 1394 | { |
| 1395 | return new DrawableViewbox(*this); |
| 1396 | } |
| 1397 | |
| 1398 | // |
| 1399 | // Path Classes |
| 1400 | // |
| 1401 | |
| 1402 | // |
| 1403 | // PathArcArgs |
| 1404 | // |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1405 | MagickPPExport int Magick::operator == ( const Magick::PathArcArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1406 | const Magick::PathArcArgs& /*right_*/ ) |
| 1407 | { |
| 1408 | return ( 1 ); |
| 1409 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1410 | MagickPPExport int Magick::operator != ( const Magick::PathArcArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1411 | const Magick::PathArcArgs& /*right_*/ ) |
| 1412 | { |
| 1413 | return ( 0 ); |
| 1414 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1415 | MagickPPExport int Magick::operator > ( const Magick::PathArcArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1416 | const Magick::PathArcArgs& /*right_*/ ) |
| 1417 | { |
| 1418 | return ( 0 ); |
| 1419 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1420 | MagickPPExport int Magick::operator < ( const Magick::PathArcArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1421 | const Magick::PathArcArgs& /*right_*/ ) |
| 1422 | { |
| 1423 | return ( false ); |
| 1424 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1425 | MagickPPExport int Magick::operator >= ( const Magick::PathArcArgs& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1426 | const Magick::PathArcArgs& right_ ) |
| 1427 | { |
| 1428 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 1429 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1430 | MagickPPExport int Magick::operator <= ( const Magick::PathArcArgs& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1431 | const Magick::PathArcArgs& right_ ) |
| 1432 | { |
| 1433 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 1434 | } |
| 1435 | // Default constructor |
| 1436 | Magick::PathArcArgs::PathArcArgs( void ) |
| 1437 | : _radiusX(0), |
| 1438 | _radiusY(0), |
| 1439 | _xAxisRotation(0), |
| 1440 | _largeArcFlag(false), |
| 1441 | _sweepFlag(false), |
| 1442 | _x(0), |
| 1443 | _y(0) |
| 1444 | { |
| 1445 | } |
| 1446 | // Normal constructor |
| 1447 | Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_, |
| 1448 | double xAxisRotation_, bool largeArcFlag_, |
| 1449 | bool sweepFlag_, double x_, double y_ ) |
| 1450 | : _radiusX(radiusX_), |
| 1451 | _radiusY(radiusY_), |
| 1452 | _xAxisRotation(xAxisRotation_), |
| 1453 | _largeArcFlag(largeArcFlag_), |
| 1454 | _sweepFlag(sweepFlag_), |
| 1455 | _x(x_), |
| 1456 | _y(y_) |
| 1457 | { |
| 1458 | } |
| 1459 | // Copy constructor |
| 1460 | Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ ) |
| 1461 | : _radiusX(original_._radiusX), |
| 1462 | _radiusY(original_._radiusY), |
| 1463 | _xAxisRotation(original_._xAxisRotation), |
| 1464 | _largeArcFlag(original_._largeArcFlag), |
| 1465 | _sweepFlag(original_._sweepFlag), |
| 1466 | _x(original_._x), |
| 1467 | _y(original_._y) |
| 1468 | { |
| 1469 | } |
| 1470 | // Destructor |
| 1471 | Magick::PathArcArgs::~PathArcArgs ( void ) |
| 1472 | { |
| 1473 | } |
| 1474 | |
| 1475 | // Path Arc |
| 1476 | Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ ) |
| 1477 | : _coordinates(1,coordinates_) |
| 1478 | { |
| 1479 | } |
| 1480 | Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ ) |
| 1481 | : _coordinates(coordinates_) |
| 1482 | { |
| 1483 | } |
| 1484 | Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ ) |
| 1485 | : VPathBase (original_), |
| 1486 | _coordinates(original_._coordinates) |
| 1487 | { |
| 1488 | } |
| 1489 | Magick::PathArcAbs::~PathArcAbs ( void ) |
| 1490 | { |
| 1491 | } |
| 1492 | void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ ) const |
| 1493 | { |
| 1494 | for( PathArcArgsList::const_iterator p = _coordinates.begin(); |
| 1495 | p != _coordinates.end(); p++ ) |
| 1496 | { |
| 1497 | DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(), |
| 1498 | p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(), |
| 1499 | (MagickBooleanType) p->sweepFlag(), p->x(), p->y() ); |
| 1500 | } |
| 1501 | } |
| 1502 | Magick::VPathBase* Magick::PathArcAbs::copy() const |
| 1503 | { |
| 1504 | return new PathArcAbs(*this); |
| 1505 | } |
| 1506 | |
| 1507 | Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ ) |
| 1508 | : _coordinates(1,coordinates_) |
| 1509 | { |
| 1510 | } |
| 1511 | Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ ) |
| 1512 | : _coordinates(coordinates_) |
| 1513 | { |
| 1514 | } |
| 1515 | Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ ) |
| 1516 | : VPathBase (original_), |
| 1517 | _coordinates(original_._coordinates) |
| 1518 | { |
| 1519 | } |
| 1520 | Magick::PathArcRel::~PathArcRel ( void ) |
| 1521 | { |
| 1522 | } |
| 1523 | void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ ) const |
| 1524 | { |
| 1525 | for( PathArcArgsList::const_iterator p = _coordinates.begin(); |
| 1526 | p != _coordinates.end(); p++ ) |
| 1527 | { |
| 1528 | DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(), |
| 1529 | p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(), |
| 1530 | (MagickBooleanType) p->sweepFlag(), p->x(), p->y() ); |
| 1531 | } |
| 1532 | } |
| 1533 | Magick::VPathBase* Magick::PathArcRel::copy() const |
| 1534 | { |
| 1535 | return new PathArcRel(*this); |
| 1536 | } |
| 1537 | |
| 1538 | // |
| 1539 | // Path Closepath |
| 1540 | // |
| 1541 | Magick::PathClosePath::~PathClosePath ( void ) |
| 1542 | { |
| 1543 | } |
| 1544 | void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ ) const |
| 1545 | { |
| 1546 | DrawPathClose( context_ ); |
| 1547 | } |
| 1548 | Magick::VPathBase* Magick::PathClosePath::copy() const |
| 1549 | { |
| 1550 | return new PathClosePath(*this); |
| 1551 | } |
| 1552 | |
| 1553 | // |
| 1554 | // Path Curveto (Cubic Bezier) |
| 1555 | // |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1556 | MagickPPExport int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1557 | const Magick::PathCurvetoArgs& /*right_*/ ) |
| 1558 | { |
| 1559 | return ( 1 ); |
| 1560 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1561 | MagickPPExport int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1562 | const Magick::PathCurvetoArgs& /*right_*/ ) |
| 1563 | { |
| 1564 | return ( 0 ); |
| 1565 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1566 | MagickPPExport int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1567 | const Magick::PathCurvetoArgs& /*right_*/ ) |
| 1568 | { |
| 1569 | return ( 0 ); |
| 1570 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1571 | MagickPPExport int Magick::operator < ( const Magick::PathCurvetoArgs& /*left_*/, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1572 | const Magick::PathCurvetoArgs& /*right_*/ ) |
| 1573 | { |
| 1574 | return ( false ); |
| 1575 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1576 | MagickPPExport int Magick::operator >= ( const Magick::PathCurvetoArgs& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1577 | const Magick::PathCurvetoArgs& right_ ) |
| 1578 | { |
| 1579 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 1580 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1581 | MagickPPExport int Magick::operator <= ( const Magick::PathCurvetoArgs& left_, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1582 | const Magick::PathCurvetoArgs& right_ ) |
| 1583 | { |
| 1584 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 1585 | } |
| 1586 | // Default constructor |
| 1587 | Magick::PathCurvetoArgs::PathCurvetoArgs( void ) |
| 1588 | : _x1(0), |
| 1589 | _y1(0), |
| 1590 | _x2(0), |
| 1591 | _y2(0), |
| 1592 | _x(0), |
| 1593 | _y(0) |
| 1594 | { |
| 1595 | } |
| 1596 | // Normal constructor |
| 1597 | Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_, |
| 1598 | double x2_, double y2_, |
| 1599 | double x_, double y_ ) |
| 1600 | : _x1(x1_), |
| 1601 | _y1(y1_), |
| 1602 | _x2(x2_), |
| 1603 | _y2(y2_), |
| 1604 | _x(x_), |
| 1605 | _y(y_) |
| 1606 | { |
| 1607 | } |
| 1608 | // Copy constructor |
| 1609 | Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ ) |
| 1610 | : _x1(original_._x1), |
| 1611 | _y1(original_._y1), |
| 1612 | _x2(original_._x2), |
| 1613 | _y2(original_._y2), |
| 1614 | _x(original_._x), |
| 1615 | _y(original_._y) |
| 1616 | { |
| 1617 | } |
| 1618 | // Destructor |
| 1619 | Magick::PathCurvetoArgs::~PathCurvetoArgs ( void ) |
| 1620 | { |
| 1621 | } |
| 1622 | |
| 1623 | Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ ) |
| 1624 | : _args(1,args_) |
| 1625 | { |
| 1626 | } |
| 1627 | Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ ) |
| 1628 | : _args(args_) |
| 1629 | { |
| 1630 | } |
| 1631 | Magick::PathCurvetoAbs::PathCurvetoAbs |
| 1632 | ( const Magick::PathCurvetoAbs& original_ ) |
| 1633 | : VPathBase (original_), |
| 1634 | _args(original_._args) |
| 1635 | { |
| 1636 | } |
| 1637 | Magick::PathCurvetoAbs::~PathCurvetoAbs ( void ) |
| 1638 | { |
| 1639 | } |
| 1640 | void Magick::PathCurvetoAbs::operator() |
| 1641 | ( MagickCore::DrawingWand * context_ ) const |
| 1642 | { |
| 1643 | for( PathCurveToArgsList::const_iterator p = _args.begin(); |
| 1644 | p != _args.end(); p++ ) |
| 1645 | { |
| 1646 | DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(), |
| 1647 | p->x(), p->y() ); |
| 1648 | } |
| 1649 | } |
| 1650 | Magick::VPathBase* Magick::PathCurvetoAbs::copy() const |
| 1651 | { |
| 1652 | return new PathCurvetoAbs(*this); |
| 1653 | } |
| 1654 | Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ ) |
| 1655 | : _args(1,args_) |
| 1656 | { |
| 1657 | } |
| 1658 | Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ ) |
| 1659 | : _args(args_) |
| 1660 | { |
| 1661 | } |
| 1662 | Magick::PathCurvetoRel::PathCurvetoRel |
| 1663 | ( const Magick::PathCurvetoRel& original_ ) |
| 1664 | : VPathBase (original_), |
| 1665 | _args(original_._args) |
| 1666 | { |
| 1667 | } |
| 1668 | Magick::PathCurvetoRel::~PathCurvetoRel ( void ) |
| 1669 | { |
| 1670 | } |
| 1671 | void Magick::PathCurvetoRel::operator() |
| 1672 | ( MagickCore::DrawingWand * context_ ) const |
| 1673 | { |
| 1674 | for( PathCurveToArgsList::const_iterator p = _args.begin(); |
| 1675 | p != _args.end(); p++ ) |
| 1676 | { |
| 1677 | DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(), |
| 1678 | p->x(), p->y() ); |
| 1679 | } |
| 1680 | } |
| 1681 | Magick::VPathBase* Magick::PathCurvetoRel::copy() const |
| 1682 | { |
| 1683 | return new PathCurvetoRel(*this); |
| 1684 | } |
| 1685 | Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs |
| 1686 | ( const Magick::Coordinate &coordinates_ ) |
| 1687 | : _coordinates(1,coordinates_) |
| 1688 | { |
| 1689 | } |
| 1690 | Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs |
| 1691 | ( const CoordinateList &coordinates_ ) |
| 1692 | : _coordinates(coordinates_) |
| 1693 | { |
| 1694 | } |
| 1695 | Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs |
| 1696 | ( const Magick::PathSmoothCurvetoAbs& original_ ) |
| 1697 | : VPathBase (original_), |
| 1698 | _coordinates(original_._coordinates) |
| 1699 | { |
| 1700 | } |
| 1701 | Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void ) |
| 1702 | { |
| 1703 | } |
| 1704 | void Magick::PathSmoothCurvetoAbs::operator() |
| 1705 | ( MagickCore::DrawingWand * context_ ) const |
| 1706 | { |
| 1707 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 1708 | p != _coordinates.end(); p++ ) |
| 1709 | { |
| 1710 | double x2 = p->x(); |
| 1711 | double y2 = p->y(); |
| 1712 | p++; |
| 1713 | if(p != _coordinates.end() ) |
| 1714 | DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() ); |
| 1715 | } |
| 1716 | } |
| 1717 | Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const |
| 1718 | { |
| 1719 | return new PathSmoothCurvetoAbs(*this); |
| 1720 | } |
| 1721 | Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel |
| 1722 | ( const Magick::Coordinate &coordinates_ ) |
| 1723 | : _coordinates(1,coordinates_) |
| 1724 | { |
| 1725 | } |
| 1726 | Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel |
| 1727 | ( const CoordinateList &coordinates_ ) |
| 1728 | : _coordinates(coordinates_) |
| 1729 | { |
| 1730 | } |
| 1731 | Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel |
| 1732 | ( const Magick::PathSmoothCurvetoRel& original_ ) |
| 1733 | : VPathBase (original_), |
| 1734 | _coordinates(original_._coordinates) |
| 1735 | { |
| 1736 | } |
| 1737 | Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void ) |
| 1738 | { |
| 1739 | } |
| 1740 | void Magick::PathSmoothCurvetoRel::operator() |
| 1741 | ( MagickCore::DrawingWand * context_ ) const |
| 1742 | { |
| 1743 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 1744 | p != _coordinates.end(); p++ ) |
| 1745 | { |
| 1746 | double x2 = p->x(); |
| 1747 | double y2 = p->y(); |
| 1748 | p++; |
| 1749 | if(p != _coordinates.end() ) |
| 1750 | DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() ); |
| 1751 | } |
| 1752 | } |
| 1753 | Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const |
| 1754 | { |
| 1755 | return new PathSmoothCurvetoRel(*this); |
| 1756 | } |
| 1757 | |
| 1758 | // |
| 1759 | // Quadratic Curveto (Quadratic Bezier) |
| 1760 | // |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1761 | MagickPPExport int Magick::operator == |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1762 | ( const Magick::PathQuadraticCurvetoArgs& /*left_*/, |
| 1763 | const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) |
| 1764 | { |
| 1765 | return ( 1 ); |
| 1766 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1767 | MagickPPExport int Magick::operator != |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1768 | ( const Magick::PathQuadraticCurvetoArgs& /*left_*/, |
| 1769 | const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) |
| 1770 | { |
| 1771 | return ( 0 ); |
| 1772 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1773 | MagickPPExport int Magick::operator > |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1774 | ( const Magick::PathQuadraticCurvetoArgs& /*left_*/, |
| 1775 | const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) |
| 1776 | { |
| 1777 | return ( 0 ); |
| 1778 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1779 | MagickPPExport int Magick::operator < |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1780 | ( const Magick::PathQuadraticCurvetoArgs& /*left_*/, |
| 1781 | const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) |
| 1782 | { |
| 1783 | return ( 0 ); |
| 1784 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1785 | MagickPPExport int Magick::operator >= |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1786 | ( const Magick::PathQuadraticCurvetoArgs& left_, |
| 1787 | const Magick::PathQuadraticCurvetoArgs& right_ ) |
| 1788 | { |
| 1789 | return ( ( left_ > right_ ) || ( left_ == right_ ) ); |
| 1790 | } |
cristy | af1dd25 | 2011-09-07 19:04:02 +0000 | [diff] [blame] | 1791 | MagickPPExport int Magick::operator <= |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1792 | ( const Magick::PathQuadraticCurvetoArgs& left_, |
| 1793 | const Magick::PathQuadraticCurvetoArgs& right_ ) |
| 1794 | { |
| 1795 | return ( ( left_ < right_ ) || ( left_ == right_ ) ); |
| 1796 | } |
| 1797 | // Default Constructor |
| 1798 | Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void ) |
| 1799 | : _x1(0), |
| 1800 | _y1(0), |
| 1801 | _x(0), |
| 1802 | _y(0) |
| 1803 | { |
| 1804 | } |
| 1805 | // Normal Constructor |
| 1806 | Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_, |
| 1807 | double y1_, |
| 1808 | double x_, |
| 1809 | double y_ ) |
| 1810 | : _x1(x1_), |
| 1811 | _y1(y1_), |
| 1812 | _x(x_), |
| 1813 | _y(y_) |
| 1814 | { |
| 1815 | } |
| 1816 | // Copy Constructor |
| 1817 | Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ ) |
| 1818 | : _x1(original_._x1), |
| 1819 | _y1(original_._y1), |
| 1820 | _x(original_._x), |
| 1821 | _y(original_._y) |
| 1822 | { |
| 1823 | } |
| 1824 | // Destructor |
| 1825 | Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void ) |
| 1826 | { |
| 1827 | } |
| 1828 | |
| 1829 | Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs |
| 1830 | ( const Magick::PathQuadraticCurvetoArgs &args_ ) |
| 1831 | : _args(1,args_) |
| 1832 | { |
| 1833 | } |
| 1834 | Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs |
| 1835 | ( const PathQuadraticCurvetoArgsList &args_ ) |
| 1836 | : _args(args_) |
| 1837 | { |
| 1838 | } |
| 1839 | Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs |
| 1840 | ( const Magick::PathQuadraticCurvetoAbs& original_ ) |
| 1841 | : VPathBase (original_), |
| 1842 | _args(original_._args) |
| 1843 | { |
| 1844 | } |
| 1845 | Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void ) |
| 1846 | { |
| 1847 | } |
| 1848 | void Magick::PathQuadraticCurvetoAbs::operator() |
| 1849 | ( MagickCore::DrawingWand * context_ ) const |
| 1850 | { |
| 1851 | for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin(); |
| 1852 | p != _args.end(); p++ ) |
| 1853 | { |
| 1854 | DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(), |
| 1855 | p->x(), p->y() ); |
| 1856 | } |
| 1857 | } |
| 1858 | Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const |
| 1859 | { |
| 1860 | return new PathQuadraticCurvetoAbs(*this); |
| 1861 | } |
| 1862 | Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel |
| 1863 | ( const Magick::PathQuadraticCurvetoArgs &args_ ) |
| 1864 | : _args(1,args_) |
| 1865 | { |
| 1866 | } |
| 1867 | Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel |
| 1868 | ( const PathQuadraticCurvetoArgsList &args_ ) |
| 1869 | : _args(args_) |
| 1870 | { |
| 1871 | } |
| 1872 | Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel |
| 1873 | ( const Magick::PathQuadraticCurvetoRel& original_ ) |
| 1874 | : VPathBase (original_), |
| 1875 | _args(original_._args) |
| 1876 | { |
| 1877 | } |
| 1878 | Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void ) |
| 1879 | { |
| 1880 | } |
| 1881 | void Magick::PathQuadraticCurvetoRel::operator() |
| 1882 | ( MagickCore::DrawingWand * context_ ) const |
| 1883 | { |
| 1884 | for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin(); |
| 1885 | p != _args.end(); p++ ) |
| 1886 | { |
| 1887 | DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(), |
| 1888 | p->x(), p->y() ); |
| 1889 | } |
| 1890 | } |
| 1891 | Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const |
| 1892 | { |
| 1893 | return new PathQuadraticCurvetoRel(*this); |
| 1894 | } |
| 1895 | Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs |
| 1896 | ( const Magick::Coordinate &coordinate_ ) |
| 1897 | : _coordinates(1,coordinate_) |
| 1898 | { |
| 1899 | } |
| 1900 | Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs |
| 1901 | ( const CoordinateList &coordinates_ ) |
| 1902 | : _coordinates(coordinates_) |
| 1903 | { |
| 1904 | } |
| 1905 | Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs |
| 1906 | ( const Magick::PathSmoothQuadraticCurvetoAbs& original_ ) |
| 1907 | : VPathBase (original_), |
| 1908 | _coordinates(original_._coordinates) |
| 1909 | { |
| 1910 | } |
| 1911 | Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void ) |
| 1912 | { |
| 1913 | } |
| 1914 | void Magick::PathSmoothQuadraticCurvetoAbs::operator() |
| 1915 | ( MagickCore::DrawingWand * context_ ) const |
| 1916 | { |
| 1917 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 1918 | p != _coordinates.end(); p++ ) |
| 1919 | { |
| 1920 | DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() ); |
| 1921 | } |
| 1922 | } |
| 1923 | Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const |
| 1924 | { |
| 1925 | return new PathSmoothQuadraticCurvetoAbs(*this); |
| 1926 | } |
| 1927 | Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel |
| 1928 | ( const Magick::Coordinate &coordinate_ ) |
| 1929 | : _coordinates(1,coordinate_) |
| 1930 | { |
| 1931 | } |
| 1932 | Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel |
| 1933 | ( const CoordinateList &coordinates_ ) |
| 1934 | : _coordinates(coordinates_) |
| 1935 | { |
| 1936 | } |
| 1937 | Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel |
| 1938 | ( const PathSmoothQuadraticCurvetoRel& original_ ) |
| 1939 | : VPathBase (original_), |
| 1940 | _coordinates(original_._coordinates) |
| 1941 | { |
| 1942 | } |
| 1943 | Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void ) |
| 1944 | { |
| 1945 | } |
| 1946 | void Magick::PathSmoothQuadraticCurvetoRel::operator() |
| 1947 | ( MagickCore::DrawingWand * context_ ) const |
| 1948 | { |
| 1949 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 1950 | p != _coordinates.end(); p++ ) |
| 1951 | { |
| 1952 | DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() ); |
| 1953 | } |
| 1954 | } |
| 1955 | Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const |
| 1956 | { |
| 1957 | return new PathSmoothQuadraticCurvetoRel(*this); |
| 1958 | } |
| 1959 | |
| 1960 | // |
| 1961 | // Path Lineto |
| 1962 | // |
| 1963 | Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_ ) |
| 1964 | : _coordinates(1,coordinate_) |
| 1965 | { |
| 1966 | } |
| 1967 | Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ ) |
| 1968 | : _coordinates(coordinates_) |
| 1969 | { |
| 1970 | } |
| 1971 | Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ ) |
| 1972 | : VPathBase (original_), |
| 1973 | _coordinates(original_._coordinates) |
| 1974 | { |
| 1975 | } |
| 1976 | Magick::PathLinetoAbs::~PathLinetoAbs ( void ) |
| 1977 | { |
| 1978 | } |
| 1979 | void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ ) const |
| 1980 | { |
| 1981 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 1982 | p != _coordinates.end(); p++ ) |
| 1983 | { |
| 1984 | DrawPathLineToAbsolute( context_, p->x(), p->y() ); |
| 1985 | } |
| 1986 | } |
| 1987 | Magick::VPathBase* Magick::PathLinetoAbs::copy() const |
| 1988 | { |
| 1989 | return new PathLinetoAbs(*this); |
| 1990 | } |
| 1991 | Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_ ) |
| 1992 | : _coordinates(1,coordinate_) |
| 1993 | { |
| 1994 | } |
| 1995 | Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ ) |
| 1996 | : _coordinates(coordinates_) |
| 1997 | { |
| 1998 | } |
| 1999 | Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ ) |
| 2000 | : VPathBase (original_), |
| 2001 | _coordinates(original_._coordinates) |
| 2002 | { |
| 2003 | } |
| 2004 | Magick::PathLinetoRel::~PathLinetoRel ( void ) |
| 2005 | { |
| 2006 | } |
| 2007 | void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ ) const |
| 2008 | { |
| 2009 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 2010 | p != _coordinates.end(); p++ ) |
| 2011 | { |
| 2012 | DrawPathLineToRelative( context_, p->x(), p->y() ); |
| 2013 | } |
| 2014 | } |
| 2015 | Magick::VPathBase* Magick::PathLinetoRel::copy() const |
| 2016 | { |
| 2017 | return new PathLinetoRel(*this); |
| 2018 | } |
| 2019 | |
| 2020 | // |
| 2021 | // Path Horizontal Lineto |
| 2022 | // |
| 2023 | |
| 2024 | Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void ) |
| 2025 | { |
| 2026 | } |
| 2027 | void Magick::PathLinetoHorizontalAbs::operator() |
| 2028 | ( MagickCore::DrawingWand * context_ ) const |
| 2029 | { |
| 2030 | DrawPathLineToHorizontalAbsolute( context_, _x ); |
| 2031 | } |
| 2032 | Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const |
| 2033 | { |
| 2034 | return new PathLinetoHorizontalAbs(*this); |
| 2035 | } |
| 2036 | Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void ) |
| 2037 | { |
| 2038 | } |
| 2039 | void Magick::PathLinetoHorizontalRel::operator() |
| 2040 | ( MagickCore::DrawingWand * context_ ) const |
| 2041 | { |
| 2042 | DrawPathLineToHorizontalRelative( context_, _x ); |
| 2043 | } |
| 2044 | Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const |
| 2045 | { |
| 2046 | return new PathLinetoHorizontalRel(*this); |
| 2047 | } |
| 2048 | |
| 2049 | // |
| 2050 | // Path Vertical Lineto |
| 2051 | // |
| 2052 | Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void ) |
| 2053 | { |
| 2054 | } |
| 2055 | void Magick::PathLinetoVerticalAbs::operator() |
| 2056 | ( MagickCore::DrawingWand * context_ ) const |
| 2057 | { |
| 2058 | DrawPathLineToVerticalAbsolute( context_, _y ); |
| 2059 | } |
| 2060 | Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const |
| 2061 | { |
| 2062 | return new PathLinetoVerticalAbs(*this); |
| 2063 | } |
| 2064 | Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void ) |
| 2065 | { |
| 2066 | } |
| 2067 | void Magick::PathLinetoVerticalRel::operator() |
| 2068 | ( MagickCore::DrawingWand * context_ ) const |
| 2069 | { |
| 2070 | DrawPathLineToVerticalRelative( context_, _y ); |
| 2071 | } |
| 2072 | Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const |
| 2073 | { |
| 2074 | return new PathLinetoVerticalRel(*this); |
| 2075 | } |
| 2076 | |
| 2077 | // |
| 2078 | // Path Moveto |
| 2079 | // |
| 2080 | |
| 2081 | Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ ) |
| 2082 | : _coordinates(1,coordinate_) |
| 2083 | { |
| 2084 | } |
| 2085 | Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ ) |
| 2086 | : _coordinates(coordinates_) |
| 2087 | { |
| 2088 | } |
| 2089 | Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ ) |
| 2090 | : VPathBase (original_), |
| 2091 | _coordinates(original_._coordinates) |
| 2092 | { |
| 2093 | } |
| 2094 | Magick::PathMovetoAbs::~PathMovetoAbs ( void ) |
| 2095 | { |
| 2096 | } |
| 2097 | void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ ) const |
| 2098 | { |
| 2099 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 2100 | p != _coordinates.end(); p++ ) |
| 2101 | { |
| 2102 | DrawPathMoveToAbsolute( context_, p->x(), p->y() ); |
| 2103 | } |
| 2104 | } |
| 2105 | Magick::VPathBase* Magick::PathMovetoAbs::copy() const |
| 2106 | { |
| 2107 | return new PathMovetoAbs(*this); |
| 2108 | } |
| 2109 | Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ ) |
| 2110 | : _coordinates(1,coordinate_) |
| 2111 | { |
| 2112 | } |
| 2113 | Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ ) |
| 2114 | : _coordinates(coordinates_) |
| 2115 | { |
| 2116 | } |
| 2117 | Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ ) |
| 2118 | : VPathBase (original_), |
| 2119 | _coordinates(original_._coordinates) |
| 2120 | { |
| 2121 | } |
| 2122 | Magick::PathMovetoRel::~PathMovetoRel ( void ) |
| 2123 | { |
| 2124 | } |
| 2125 | void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ ) const |
| 2126 | { |
| 2127 | for( CoordinateList::const_iterator p = _coordinates.begin(); |
| 2128 | p != _coordinates.end(); p++ ) |
| 2129 | { |
| 2130 | DrawPathMoveToRelative( context_, p->x(), p->y() ); |
| 2131 | } |
| 2132 | } |
| 2133 | Magick::VPathBase* Magick::PathMovetoRel::copy() const |
| 2134 | { |
| 2135 | return new PathMovetoRel(*this); |
| 2136 | } |
| 2137 | |
| 2138 | #if defined(EXPLICIT_TEMPLATE_INSTANTIATION) |
| 2139 | // template class std::list<Magick::Coordinate>; |
| 2140 | // template class std::list<const Magick::Drawable>; |
| 2141 | // template class std::list<const Magick::PathArcArgs>; |
| 2142 | // template class std::list<const Magick::PathCurvetoArgs>; |
| 2143 | // template class std::list<const Magick::PathQuadraticCurvetoArgs>; |
| 2144 | // template class std::list<const Magick::VPath>; |
| 2145 | #endif |