1// This may look like C code, but it is really -*- C++ -*- 2// 3// Copyright Bob Friesenhahn, 1999, 2002 4// Copyright Dirk Lemstra 2013-2016 5// 6// Implementation of STL classes and functions 7// 8 9#define MAGICKCORE_IMPLEMENTATION 1 10#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 11 12#include <Magick++/Functions.h> 13#include <Magick++/Image.h> 14#include <Magick++/STL.h> 15 16// Adaptive-blur image with specified blur factor 17Magick::adaptiveBlurImage::adaptiveBlurImage( const double radius_, 18 const double sigma_ ) 19 : _radius( radius_ ), 20 _sigma( sigma_ ) 21{ 22} 23void Magick::adaptiveBlurImage::operator()( Magick::Image &image_ ) const 24{ 25 image_.adaptiveBlur( _radius, _sigma ); 26} 27 28// Local adaptive threshold image 29Magick::adaptiveThresholdImage::adaptiveThresholdImage( const size_t width_, 30 const size_t height_, 31 const ssize_t offset_ ) 32 : _width(width_), 33 _height(height_), 34 _offset(offset_) 35{ 36} 37void Magick::adaptiveThresholdImage::operator()( Magick::Image &image_ ) const 38{ 39 image_.adaptiveThreshold( _width, _height, _offset ); 40} 41 42// Add noise to image with specified noise type 43Magick::addNoiseImage::addNoiseImage( Magick::NoiseType noiseType_ ) 44 : _noiseType( noiseType_ ) 45{ 46} 47void Magick::addNoiseImage::operator()( Magick::Image &image_ ) const 48{ 49 image_.addNoise( _noiseType ); 50} 51 52// Transform image by specified affine (or free transform) matrix. 53Magick::affineTransformImage::affineTransformImage( const DrawableAffine &affine_ ) 54 : _affine( affine_ ) 55{ 56} 57void Magick::affineTransformImage::operator()( Magick::Image &image_ ) const 58{ 59 image_.affineTransform( _affine ); 60} 61 62// Annotate image (draw text on image) 63 64// Annotate using specified text, and placement location 65Magick::annotateImage::annotateImage ( const std::string &text_, 66 const Magick::Geometry &geometry_ ) 67 : _text( text_ ), 68 _geometry( geometry_ ), 69 _gravity( Magick::NorthWestGravity ), 70 _degrees( 0 ) 71{ 72} 73// Annotate using specified text, bounding area, and placement gravity 74Magick::annotateImage::annotateImage ( const std::string &text_, 75 const Magick::Geometry &geometry_, 76 const Magick::GravityType gravity_ ) 77 : _text( text_ ), 78 _geometry( geometry_ ), 79 _gravity( gravity_ ), 80 _degrees( 0 ) 81{ 82} 83// Annotate with text using specified text, bounding area, placement 84// gravity, and rotation. 85Magick::annotateImage::annotateImage ( const std::string &text_, 86 const Magick::Geometry &geometry_, 87 const Magick::GravityType gravity_, 88 const double degrees_ ) 89 : _text( text_ ), 90 _geometry( geometry_ ), 91 _gravity( gravity_ ), 92 _degrees( degrees_ ) 93{ 94} 95// Annotate with text (bounding area is entire image) and placement 96// gravity. 97Magick::annotateImage::annotateImage ( const std::string &text_, 98 const Magick::GravityType gravity_ ) 99 : _text( text_ ), 100 _geometry( ), 101 _gravity( gravity_ ), 102 _degrees( 0 ) 103{ 104} 105void Magick::annotateImage::operator()( Magick::Image &image_ ) const 106{ 107 image_.annotate( _text, _geometry, _gravity, _degrees ); 108} 109 110// Blur image with specified blur factor 111Magick::blurImage::blurImage( const double radius_, const double sigma_ ) 112 : _radius( radius_ ), 113 _sigma( sigma_ ) 114{ 115} 116void Magick::blurImage::operator()( Magick::Image &image_ ) const 117{ 118 image_.blur( _radius, _sigma ); 119} 120 121// Border image (add border to image) 122Magick::borderImage::borderImage( const Magick::Geometry &geometry_ ) 123 : _geometry( geometry_ ) 124{ 125} 126void Magick::borderImage::operator()( Magick::Image &image_ ) const 127{ 128 image_.border( _geometry ); 129} 130 131// Extract channel from image 132Magick::channelImage::channelImage( const Magick::ChannelType channel_ ) 133 : _channel( channel_ ) 134{ 135} 136void Magick::channelImage::operator()( Magick::Image &image_ ) const 137{ 138 image_.channel( _channel ); 139} 140 141// Charcoal effect image (looks like charcoal sketch) 142Magick::charcoalImage::charcoalImage( const double radius_, const double sigma_ ) 143 : _radius( radius_ ), 144 _sigma( sigma_ ) 145{ 146} 147void Magick::charcoalImage::operator()( Magick::Image &image_ ) const 148{ 149 image_.charcoal( _radius, _sigma ); 150} 151 152// Chop image (remove vertical or horizontal subregion of image) 153Magick::chopImage::chopImage( const Magick::Geometry &geometry_ ) 154 : _geometry( geometry_ ) 155{ 156} 157void Magick::chopImage::operator()( Magick::Image &image_ ) const 158{ 159 image_.chop( _geometry ); 160} 161 162// accepts a lightweight Color Correction Collection (CCC) file which solely 163// contains one or more color corrections and applies the correction to the 164// image. 165Magick::cdlImage::cdlImage( const std::string &cdl_ ) 166 : _cdl ( cdl_ ) 167{ 168} 169void Magick::cdlImage::operator()( Image &image_ ) const 170{ 171 image_.cdl( _cdl.c_str() ); 172} 173 174// Colorize image using pen color at specified percent alpha 175Magick::colorizeImage::colorizeImage( const unsigned int alphaRed_, 176 const unsigned int alphaGreen_, 177 const unsigned int alphaBlue_, 178 const Magick::Color &penColor_ ) 179 : _alphaRed ( alphaRed_ ), 180 _alphaGreen ( alphaGreen_ ), 181 _alphaBlue ( alphaBlue_ ), 182 _penColor( penColor_ ) 183{ 184} 185Magick::colorizeImage::colorizeImage( const unsigned int alpha_, 186 const Magick::Color &penColor_ ) 187 : _alphaRed ( alpha_ ), 188 _alphaGreen ( alpha_ ), 189 _alphaBlue ( alpha_ ), 190 _penColor( penColor_ ) 191{ 192} 193void Magick::colorizeImage::operator()( Magick::Image &image_ ) const 194{ 195 image_.colorize( _alphaRed, _alphaGreen, _alphaBlue, _penColor ); 196} 197 198// Apply a color matrix to the image channels. The user supplied 199// matrix may be of order 1 to 5 (1x1 through 5x5). 200Magick::colorMatrixImage::colorMatrixImage( const size_t order_, 201 const double *color_matrix_ ) 202 : _order( order_ ), 203 _color_matrix( color_matrix_ ) 204{ 205} 206void Magick::colorMatrixImage::operator()( Image &image_ ) const 207{ 208 image_.colorMatrix( _order, _color_matrix ); 209} 210 211// Convert the image colorspace representation 212Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ ) 213 : _colorSpace( colorSpace_ ) 214{ 215} 216void Magick::colorSpaceImage::operator()( Magick::Image &image_ ) const 217{ 218 image_.colorSpace( _colorSpace ); 219} 220 221// Comment image (add comment string to image) 222Magick::commentImage::commentImage( const std::string &comment_ ) 223 : _comment( comment_ ) 224{ 225} 226void Magick::commentImage::operator()( Magick::Image &image_ ) const 227{ 228 image_.comment( _comment ); 229} 230 231// Compose an image onto another at specified offset and using 232// specified algorithm 233Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, 234 ssize_t xOffset_, 235 ssize_t yOffset_, 236 Magick::CompositeOperator compose_ ) 237 : _compositeImage( compositeImage_ ), 238 _xOffset ( xOffset_ ), 239 _yOffset ( yOffset_ ), 240 _compose ( compose_ ) 241{ 242} 243Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, 244 const Magick::Geometry &offset_, 245 Magick::CompositeOperator compose_ ) 246 : _compositeImage( compositeImage_ ), 247 _xOffset ( offset_.xOff() ), 248 _yOffset ( offset_.yOff() ), 249 _compose ( compose_ ) 250{ 251} 252void Magick::compositeImage::operator()( Image &image_ ) const 253{ 254 image_.composite( _compositeImage, _xOffset, _yOffset, _compose ); 255} 256 257// Contrast image (enhance intensity differences in image) 258Magick::contrastImage::contrastImage( const size_t sharpen_ ) 259 : _sharpen( sharpen_ ) 260{ 261} 262void Magick::contrastImage::operator()( Magick::Image &image_ ) const 263{ 264 image_.contrast( _sharpen ); 265} 266 267// Crop image (subregion of original image) 268Magick::cropImage::cropImage( const Magick::Geometry &geometry_ ) 269 : _geometry( geometry_ ) 270{ 271} 272void Magick::cropImage::operator()( Magick::Image &image_ ) const 273{ 274 image_.crop( _geometry ); 275} 276 277// Cycle image colormap 278Magick::cycleColormapImage::cycleColormapImage( const ssize_t amount_ ) 279 : _amount( amount_ ) 280{ 281} 282void Magick::cycleColormapImage::operator()( Magick::Image &image_ ) const 283{ 284 image_.cycleColormap( _amount ); 285} 286 287// Despeckle image (reduce speckle noise) 288Magick::despeckleImage::despeckleImage( void ) 289{ 290} 291void Magick::despeckleImage::operator()( Magick::Image &image_ ) const 292{ 293 image_.despeckle( ); 294} 295 296// Distort image. distorts an image using various distortion methods, by 297// mapping color lookups of the source image to a new destination image 298// usally of the same size as the source image, unless 'bestfit' is set to 299// true. 300Magick::distortImage::distortImage( const Magick::DistortMethod method_, 301 const size_t number_arguments_, 302 const double *arguments_, 303 const bool bestfit_ ) 304 : _method ( method_ ), 305 _number_arguments ( number_arguments_ ), 306 _arguments ( arguments_ ), 307 _bestfit( bestfit_ ) 308{ 309} 310Magick::distortImage::distortImage( const Magick::DistortMethod method_, 311 const size_t number_arguments_, 312 const double *arguments_ ) 313 : _method ( method_ ), 314 _number_arguments ( number_arguments_ ), 315 _arguments ( arguments_ ), 316 _bestfit( false ) 317{ 318} 319void Magick::distortImage::operator()( Magick::Image &image_ ) const 320{ 321 image_.distort( _method, _number_arguments, _arguments, _bestfit ); 322} 323 324// Draw on image 325Magick::drawImage::drawImage( const Magick::Drawable &drawable_ ) 326 : _drawableList() 327{ 328 _drawableList.push_back( drawable_ ); 329} 330Magick::drawImage::drawImage( const std::vector<Magick::Drawable> &drawable_ ) 331 : _drawableList( drawable_ ) 332{ 333} 334void Magick::drawImage::operator()( Magick::Image &image_ ) const 335{ 336 image_.draw( _drawableList ); 337} 338 339// Edge image (hilight edges in image) 340Magick::edgeImage::edgeImage( const double radius_ ) 341 : _radius( radius_ ) 342{ 343} 344void Magick::edgeImage::operator()( Magick::Image &image_ ) const 345{ 346 image_.edge( _radius ); 347} 348 349// Emboss image (hilight edges with 3D effect) 350Magick::embossImage::embossImage( void ) 351 : _radius( 1 ), 352 _sigma( 0.5 ) 353{ 354} 355Magick::embossImage::embossImage( const double radius_, const double sigma_ ) 356 : _radius( radius_ ), 357 _sigma( sigma_ ) 358{ 359} 360void Magick::embossImage::operator()( Magick::Image &image_ ) const 361{ 362 image_.emboss( _radius, _sigma ); 363} 364 365// Enhance image (minimize noise) 366Magick::enhanceImage::enhanceImage( void ) 367{ 368} 369void Magick::enhanceImage::operator()( Magick::Image &image_ ) const 370{ 371 image_.enhance( ); 372} 373 374// Equalize image (histogram equalization) 375Magick::equalizeImage::equalizeImage( void ) 376{ 377} 378void Magick::equalizeImage::operator()( Magick::Image &image_ ) const 379{ 380 image_.equalize( ); 381} 382 383// Color to use when filling drawn objects 384Magick::fillColorImage::fillColorImage( const Magick::Color &fillColor_ ) 385 : _fillColor( fillColor_ ) 386{ 387} 388void Magick::fillColorImage::operator()( Magick::Image &image_ ) const 389{ 390 image_.fillColor( _fillColor ); 391} 392 393// Flip image (reflect each scanline in the vertical direction) 394Magick::flipImage::flipImage( void ) 395{ 396} 397void Magick::flipImage::operator()( Magick::Image &image_ ) const 398{ 399 image_.flip( ); 400} 401 402Magick::floodFillAlphaImage::floodFillAlphaImage(const ssize_t x_, 403 const ssize_t y_,const unsigned int alpha_,const Color &target_, 404 const bool invert_) 405 : _target(target_), 406 _alpha(alpha_), 407 _x(x_), 408 _y(y_), 409 _invert(invert_) 410{ 411} 412 413void Magick::floodFillAlphaImage::operator()(Magick::Image &image_) const 414{ 415 image_.floodFillAlpha(_x,_y,_alpha,_target,_invert); 416} 417 418Magick::floodFillColorImage::floodFillColorImage(const ssize_t x_, 419 const ssize_t y_,const Magick::Color &fillColor_,const bool invert_) 420 : _x(x_), 421 _y(y_), 422 _fillColor(fillColor_), 423 _borderColor(), 424 _invert(invert_) 425{ 426} 427 428Magick::floodFillColorImage::floodFillColorImage( 429 const Magick::Geometry &point_,const Magick::Color &fillColor_, 430 const bool invert_) 431 : _x(point_.xOff()), 432 _y(point_.yOff()), 433 _fillColor(fillColor_), 434 _borderColor(), 435 _invert(invert_) 436{ 437} 438 439Magick::floodFillColorImage::floodFillColorImage(const ssize_t x_, 440 const ssize_t y_,const Magick::Color &fillColor_, 441 const Magick::Color &borderColor_,const bool invert_) 442 : _x(x_), 443 _y(y_), 444 _fillColor(fillColor_), 445 _borderColor(borderColor_), 446 _invert(invert_) 447{ 448} 449 450Magick::floodFillColorImage::floodFillColorImage(const Geometry &point_, 451 const Color &fillColor_,const Color &borderColor_,const bool invert_) 452 : _x(point_.xOff()), 453 _y(point_.yOff()), 454 _fillColor(fillColor_), 455 _borderColor(borderColor_), 456 _invert(invert_) 457{ 458} 459void Magick::floodFillColorImage::operator()(Magick::Image &image_) const 460{ 461 if (_borderColor.isValid()) 462 image_.floodFillColor(_x,_y,_fillColor,_borderColor,_invert); 463 else 464 image_.floodFillColor(_x,_y,_fillColor,_invert); 465} 466 467Magick::floodFillTextureImage::floodFillTextureImage(const ssize_t x_, 468 const ssize_t y_,const Magick::Image &texture_,const bool invert_) 469 : _x(x_), 470 _y(y_), 471 _texture(texture_), 472 _borderColor(), 473 _invert(invert_) 474{ 475} 476 477Magick::floodFillTextureImage::floodFillTextureImage( 478 const Magick::Geometry &point_,const Magick::Image &texture_, 479 const bool invert_) 480 : _x(point_.xOff()), 481 _y(point_.yOff()), 482 _texture(texture_), 483 _borderColor(), 484 _invert(invert_) 485{ 486} 487 488Magick::floodFillTextureImage::floodFillTextureImage(const ssize_t x_, 489 const ssize_t y_,const Magick::Image &texture_, 490 const Magick::Color &borderColor_,const bool invert_) 491 : _x(x_), 492 _y(y_), 493 _texture(texture_), 494 _borderColor(borderColor_), 495 _invert(invert_) 496{ 497} 498 499Magick::floodFillTextureImage::floodFillTextureImage( 500 const Magick::Geometry &point_,const Magick::Image &texture_, 501 const Magick::Color &borderColor_,const bool invert_) 502 : _x(point_.xOff()), 503 _y(point_.yOff()), 504 _texture(texture_), 505 _borderColor(borderColor_), 506 _invert(invert_) 507{ 508} 509 510void Magick::floodFillTextureImage::operator()(Magick::Image &image_) const 511{ 512 if (_borderColor.isValid()) 513 image_.floodFillTexture(_x,_y,_texture,_borderColor,_invert); 514 else 515 image_.floodFillTexture(_x,_y,_texture,_invert); 516} 517 518// Flop image (reflect each scanline in the horizontal direction) 519Magick::flopImage::flopImage( void ) 520{ 521} 522void Magick::flopImage::operator()( Magick::Image &image_ ) const 523{ 524 image_.flop( ); 525} 526 527// Frame image 528Magick::frameImage::frameImage( const Magick::Geometry &geometry_ ) 529 : _width( geometry_.width() ), 530 _height( geometry_.height() ), 531 _outerBevel( geometry_.xOff() ), 532 _innerBevel( geometry_.yOff() ) 533{ 534} 535Magick::frameImage::frameImage( const size_t width_, const size_t height_, 536 const ssize_t innerBevel_, const ssize_t outerBevel_ ) 537 : _width( width_ ), 538 _height( height_ ), 539 _outerBevel( outerBevel_ ), 540 _innerBevel( innerBevel_ ) 541{ 542} 543void Magick::frameImage::operator()( Magick::Image &image_ ) const 544{ 545 image_.frame( _width, _height, _innerBevel, _outerBevel ); 546} 547 548// Gamma correct image 549Magick::gammaImage::gammaImage( const double gamma_ ) 550 : _gammaRed( gamma_ ), 551 _gammaGreen( gamma_ ), 552 _gammaBlue( gamma_ ) 553{ 554} 555Magick::gammaImage::gammaImage ( const double gammaRed_, 556 const double gammaGreen_, 557 const double gammaBlue_ ) 558 : _gammaRed( gammaRed_ ), 559 _gammaGreen( gammaGreen_ ), 560 _gammaBlue( gammaBlue_ ) 561{ 562} 563void Magick::gammaImage::operator()( Magick::Image &image_ ) const 564{ 565 image_.gamma( _gammaRed, _gammaGreen, _gammaBlue ); 566} 567 568// Gaussian blur image 569// The number of neighbor pixels to be included in the convolution 570// mask is specified by 'width_'. The standard deviation of the 571// gaussian bell curve is specified by 'sigma_'. 572Magick::gaussianBlurImage::gaussianBlurImage( const double width_, 573 const double sigma_ ) 574 : _width( width_ ), 575 _sigma( sigma_ ) 576{ 577} 578void Magick::gaussianBlurImage::operator()( Magick::Image &image_ ) const 579{ 580 image_.gaussianBlur( _width, _sigma ); 581} 582 583// Apply a color lookup table (Hald CLUT) to the image. 584Magick::haldClutImage::haldClutImage( const Image &haldClutImage_ ) 585 : _haldClutImage ( haldClutImage_ ) 586{ 587} 588void Magick::haldClutImage::operator()( Image &image_ ) const 589{ 590 image_.haldClut( _haldClutImage ); 591} 592 593// Implode image (special effect) 594Magick::implodeImage::implodeImage( const double factor_ ) 595 : _factor( factor_ ) 596{ 597} 598void Magick::implodeImage::operator()( Magick::Image &image_ ) const 599{ 600 image_.implode( _factor ); 601} 602 603// Implements the inverse discrete Fourier transform (IFT) of the image 604// either as a magnitude / phase or real / imaginary image pair. 605Magick::inverseFourierTransformImage::inverseFourierTransformImage( const Magick::Image &phaseImage_ ) 606 : _phaseImage( phaseImage_ ) 607{ 608} 609void Magick::inverseFourierTransformImage::operator()( Magick::Image &image_ ) const 610{ 611 image_.inverseFourierTransform( _phaseImage ); 612} 613 614// Set image validity. Valid images become empty (inValid) if argument 615// is false. 616Magick::isValidImage::isValidImage( const bool isValid_ ) 617 : _isValid( isValid_ ) 618{ 619} 620void Magick::isValidImage::operator()( Magick::Image &image_ ) const 621{ 622 image_.isValid( _isValid ); 623} 624 625// Label image 626Magick::labelImage::labelImage( const std::string &label_ ) 627 : _label( label_ ) 628{ 629} 630void Magick::labelImage::operator()( Magick::Image &image_ ) const 631{ 632 image_.label( _label ); 633} 634 635// Level image 636Magick::levelImage::levelImage( const double black_point, 637 const double white_point, 638 const double mid_point ) 639 : _black_point(black_point), 640 _white_point(white_point), 641 _mid_point(mid_point) 642{ 643} 644void Magick::levelImage::operator()( Magick::Image &image_ ) const 645{ 646 image_.level( _black_point, _white_point, _mid_point ); 647} 648 649// Magnify image by integral size 650Magick::magnifyImage::magnifyImage( void ) 651{ 652} 653void Magick::magnifyImage::operator()( Magick::Image &image_ ) const 654{ 655 image_.magnify( ); 656} 657 658// Remap image colors with closest color from reference image 659Magick::mapImage::mapImage( const Magick::Image &mapImage_ , 660 const bool dither_ ) 661 : _mapImage( mapImage_ ), 662 _dither( dither_ ) 663{ 664} 665void Magick::mapImage::operator()( Magick::Image &image_ ) const 666{ 667 image_.map( _mapImage, _dither ); 668} 669 670// Filter image by replacing each pixel component with the median 671// color in a circular neighborhood 672Magick::medianConvolveImage::medianConvolveImage( const double radius_ ) 673 : _radius( radius_ ) 674{ 675} 676void Magick::medianConvolveImage::operator()( Magick::Image &image_ ) const 677{ 678 image_.medianFilter( _radius ); 679} 680 681// Reduce image by integral size 682Magick::minifyImage::minifyImage( void ) 683{ 684} 685void Magick::minifyImage::operator()( Magick::Image &image_ ) const 686{ 687 image_.minify( ); 688} 689 690// Modulate percent hue, saturation, and brightness of an image 691Magick::modulateImage::modulateImage( const double brightness_, 692 const double saturation_, 693 const double hue_ ) 694 : _brightness( brightness_ ), 695 _saturation( saturation_ ), 696 _hue( hue_ ) 697{ 698} 699void Magick::modulateImage::operator()( Magick::Image &image_ ) const 700{ 701 image_.modulate( _brightness, _saturation, _hue ); 702} 703 704// Negate colors in image. Set grayscale to only negate grayscale 705// values in image. 706Magick::negateImage::negateImage( const bool grayscale_ ) 707 : _grayscale( grayscale_ ) 708{ 709} 710void Magick::negateImage::operator()( Magick::Image &image_ ) const 711{ 712 image_.negate( _grayscale ); 713} 714 715// Normalize image (increase contrast by normalizing the pixel values 716// to span the full range of color values) 717Magick::normalizeImage::normalizeImage( void ) 718{ 719} 720void Magick::normalizeImage::operator()( Magick::Image &image_ ) const 721{ 722 image_.normalize( ); 723} 724 725// Oilpaint image (image looks like oil painting) 726Magick::oilPaintImage::oilPaintImage( const double radius_ ) 727 : _radius( radius_ ) 728{ 729} 730void Magick::oilPaintImage::operator()( Magick::Image &image_ ) const 731{ 732 image_.oilPaint( _radius ); 733} 734 735// Set or attenuate the image alpha channel. If the image pixels are 736// opaque then they are set to the specified alpha value, otherwise 737// they are blended with the supplied alpha value. The value of 738// alpha_ ranges from 0 (completely opaque) to QuantumRange. The defines 739// OpaqueAlpha and TransparentAlpha are available to specify 740// completely opaque or completely transparent, respectively. 741Magick::alphaImage::alphaImage( const unsigned int alpha_ ) 742 : _alpha( alpha_ ) 743{ 744} 745void Magick::alphaImage::operator()( Magick::Image &image_ ) const 746{ 747 image_.alpha( _alpha ); 748} 749 750// Change color of opaque pixel to specified pen color. 751Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_, 752 const Magick::Color &penColor_ ) 753 : _opaqueColor( opaqueColor_ ), 754 _penColor( penColor_ ) 755{ 756} 757void Magick::opaqueImage::operator()( Magick::Image &image_ ) const 758{ 759 image_.opaque( _opaqueColor, _penColor ); 760} 761 762// Quantize image (reduce number of colors) 763Magick::quantizeImage::quantizeImage( const bool measureError_ ) 764 : _measureError( measureError_ ) 765{ 766} 767void Magick::quantizeImage::operator()( Image &image_ ) const 768{ 769 image_.quantize( _measureError ); 770} 771 772// Raise image (lighten or darken the edges of an image to give a 3-D 773// raised or lowered effect) 774Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ , 775 const bool raisedFlag_ ) 776 : _geometry( geometry_ ), 777 _raisedFlag( raisedFlag_ ) 778{ 779} 780void Magick::raiseImage::operator()( Magick::Image &image_ ) const 781{ 782 image_.raise( _geometry, _raisedFlag ); 783} 784 785Magick::ReadOptions::ReadOptions(void) 786 : _imageInfo(static_cast<ImageInfo*>(AcquireMagickMemory( 787 sizeof(ImageInfo)))), 788 _quiet(false) 789{ 790 GetImageInfo(_imageInfo); 791} 792 793Magick::ReadOptions::ReadOptions(const Magick::ReadOptions& options_) 794 : _imageInfo(CloneImageInfo(options_._imageInfo)), 795 _quiet(false) 796{ 797} 798 799Magick::ReadOptions::~ReadOptions() 800{ 801 _imageInfo=DestroyImageInfo(_imageInfo); 802} 803 804void Magick::ReadOptions::density(const Magick::Geometry &density_) 805{ 806 if (!density_.isValid()) 807 _imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density); 808 else 809 Magick::CloneString(&_imageInfo->density,density_); 810} 811 812Magick::Geometry Magick::ReadOptions::density(void) const 813{ 814 if (_imageInfo->density) 815 return(Geometry(_imageInfo->density)); 816 817 return(Geometry()); 818} 819 820void Magick::ReadOptions::depth(size_t depth_) 821{ 822 _imageInfo->depth=depth_; 823} 824 825size_t Magick::ReadOptions::depth(void) const 826{ 827 return(_imageInfo->depth); 828} 829 830void Magick::ReadOptions::size(const Geometry &geometry_) 831{ 832 _imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size); 833 834 if ( geometry_.isValid() ) 835 Magick::CloneString(&_imageInfo->size,geometry_); 836} 837 838Magick::Geometry Magick::ReadOptions::size(void) const 839{ 840 if (_imageInfo->size) 841 return(Geometry(_imageInfo->size)); 842 843 return(Geometry()); 844} 845 846void Magick::ReadOptions::quiet(const bool quiet_) 847{ 848 _quiet=quiet_; 849} 850 851bool Magick::ReadOptions::quiet(void) const 852{ 853 return(_quiet); 854} 855 856MagickCore::ImageInfo *Magick::ReadOptions::imageInfo(void) 857{ 858 return(_imageInfo); 859} 860 861// Reduce noise in image using a noise peak elimination filter 862Magick::reduceNoiseImage::reduceNoiseImage( void ) 863 : _order(3) 864{ 865} 866Magick::reduceNoiseImage::reduceNoiseImage ( const size_t order_ ) 867 : _order(order_) 868{ 869} 870void Magick::reduceNoiseImage::operator()( Image &image_ ) const 871{ 872 image_.reduceNoise( _order ); 873} 874 875// Roll image (rolls image vertically and horizontally) by specified 876// number of columnms and rows) 877Magick::rollImage::rollImage( const Magick::Geometry &roll_ ) 878 : _columns( roll_.width() ), 879 _rows( roll_.height() ) 880{ 881} 882Magick::rollImage::rollImage( const ssize_t columns_, 883 const ssize_t rows_ ) 884 : _columns( columns_ ), 885 _rows( rows_ ) 886{ 887} 888void Magick::rollImage::operator()( Magick::Image &image_ ) const 889{ 890 image_.roll( _columns, _rows ); 891} 892 893// Rotate image counter-clockwise by specified number of degrees. 894Magick::rotateImage::rotateImage( const double degrees_ ) 895 : _degrees( degrees_ ) 896{ 897} 898void Magick::rotateImage::operator()( Magick::Image &image_ ) const 899{ 900 image_.rotate( _degrees ); 901} 902 903// Resize image by using pixel sampling algorithm 904Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ ) 905 : _geometry( geometry_ ) 906{ 907} 908void Magick::sampleImage::operator()( Magick::Image &image_ ) const 909{ 910 image_.sample( _geometry ); 911} 912 913// Resize image by using simple ratio algorithm 914Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ ) 915 : _geometry( geometry_ ) 916{ 917} 918void Magick::scaleImage::operator()( Magick::Image &image_ ) const 919{ 920 image_.scale( _geometry ); 921} 922 923// Segment (coalesce similar image components) by analyzing the 924// histograms of the color components and identifying units that are 925// homogeneous with the fuzzy c-means technique. Also uses 926// QuantizeColorSpace and Verbose image attributes 927Magick::segmentImage::segmentImage( const double clusterThreshold_ , 928 const double smoothingThreshold_ ) 929 : _clusterThreshold( clusterThreshold_ ), 930 _smoothingThreshold( smoothingThreshold_ ) 931{ 932} 933void Magick::segmentImage::operator()( Magick::Image &image_ ) const 934{ 935 image_.segment( _clusterThreshold, _smoothingThreshold ); 936} 937 938// Shade image using distant light source 939Magick::shadeImage::shadeImage( const double azimuth_, 940 const double elevation_, 941 const bool colorShading_) 942 : _azimuth( azimuth_ ), 943 _elevation( elevation_ ), 944 _colorShading (colorShading_) 945{ 946} 947void Magick::shadeImage::operator()( Magick::Image &image_ ) const 948{ 949 image_.shade( _azimuth, _elevation, _colorShading ); 950} 951 952// Simulate an image shadow 953Magick::shadowImage::shadowImage( const double percent_opacity_, 954 const double sigma_, 955 const ssize_t x_, const ssize_t y_ ) 956 : _percent_opacity( percent_opacity_ ), 957 _sigma( sigma_ ), 958 _x ( x_ ), 959 _y ( y_ ) 960{ 961} 962void Magick::shadowImage::operator()( Magick::Image &image_ ) const 963{ 964 image_.shadow( _percent_opacity, _sigma, _x, _y ); 965} 966 967// Sharpen pixels in image 968Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ ) 969 : _radius( radius_ ), 970 _sigma( sigma_ ) 971{ 972} 973void Magick::sharpenImage::operator()( Magick::Image &image_ ) const 974{ 975 image_.sharpen( _radius, _sigma ); 976} 977 978// Shave pixels from image edges. 979Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ ) 980 : _geometry( geometry_ ) 981{ 982} 983void Magick::shaveImage::operator()( Magick::Image &image_ ) const 984{ 985 image_.shave( _geometry ); 986} 987 988// Shear image (create parallelogram by sliding image by X or Y axis) 989Magick::shearImage::shearImage( const double xShearAngle_, 990 const double yShearAngle_ ) 991 : _xShearAngle( xShearAngle_ ), 992 _yShearAngle( yShearAngle_ ) 993{ 994} 995void Magick::shearImage::operator()( Magick::Image &image_ ) const 996{ 997 image_.shear( _xShearAngle, _yShearAngle ); 998} 999 1000// Solarize image (similar to effect seen when exposing a photographic 1001// film to light during the development process) 1002Magick::solarizeImage::solarizeImage( const double factor_ ) 1003 : _factor( factor_ ) 1004{ 1005} 1006void Magick::solarizeImage::operator()( Magick::Image &image_ ) const 1007{ 1008 image_.solarize( _factor ); 1009} 1010 1011// Spread pixels randomly within image by specified ammount 1012Magick::spreadImage::spreadImage( const size_t amount_ ) 1013 : _amount( amount_ ) 1014{ 1015} 1016void Magick::spreadImage::operator()( Magick::Image &image_ ) const 1017{ 1018 image_.spread( _amount ); 1019} 1020 1021// Add a digital watermark to the image (based on second image) 1022Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ ) 1023 : _waterMark( waterMark_ ) 1024{ 1025} 1026void Magick::steganoImage::operator()( Magick::Image &image_ ) const 1027{ 1028 image_.stegano( _waterMark ); 1029} 1030 1031// Create an image which appears in stereo when viewed with red-blue 1032// glasses (Red image on left, blue on right) 1033Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ ) 1034 : _rightImage( rightImage_ ) 1035{ 1036} 1037void Magick::stereoImage::operator()( Magick::Image &image_ ) const 1038{ 1039 image_.stereo( _rightImage ); 1040} 1041 1042// Color to use when drawing object outlines 1043Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ ) 1044 : _strokeColor( strokeColor_ ) 1045{ 1046} 1047void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const 1048{ 1049 image_.strokeColor( _strokeColor ); 1050} 1051 1052// Swirl image (image pixels are rotated by degrees) 1053Magick::swirlImage::swirlImage( const double degrees_ ) 1054 : _degrees( degrees_ ) 1055{ 1056} 1057void Magick::swirlImage::operator()( Magick::Image &image_ ) const 1058{ 1059 image_.swirl( _degrees ); 1060} 1061 1062// Channel a texture on image background 1063Magick::textureImage::textureImage( const Magick::Image &texture_ ) 1064 : _texture( texture_ ) 1065{ 1066} 1067void Magick::textureImage::operator()( Magick::Image &image_ ) const 1068{ 1069 image_.texture( _texture ); 1070} 1071 1072// Threshold image 1073Magick::thresholdImage::thresholdImage( const double threshold_ ) 1074 : _threshold( threshold_ ) 1075{ 1076} 1077void Magick::thresholdImage::operator()( Magick::Image &image_ ) const 1078{ 1079 image_.threshold( _threshold ); 1080} 1081 1082// Set image color to transparent 1083Magick::transparentImage::transparentImage( const Magick::Color& color_ ) 1084 : _color( color_ ) 1085{ 1086} 1087void Magick::transparentImage::operator()( Magick::Image &image_ ) const 1088{ 1089 image_.transparent( _color ); 1090} 1091 1092// Trim edges that are the background color from the image 1093Magick::trimImage::trimImage( void ) 1094{ 1095} 1096void Magick::trimImage::operator()( Magick::Image &image_ ) const 1097{ 1098 image_.trim( ); 1099} 1100 1101// Map image pixels to a sine wave 1102Magick::waveImage::waveImage( const double amplitude_, 1103 const double wavelength_ ) 1104 : _amplitude( amplitude_ ), 1105 _wavelength( wavelength_ ) 1106{ 1107} 1108void Magick::waveImage::operator()( Magick::Image &image_ ) const 1109{ 1110 image_.wave( _amplitude, _wavelength ); 1111} 1112 1113// resize image to specified size. 1114Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ ) 1115 : _geometry( geometry_ ) 1116{ 1117} 1118void Magick::resizeImage::operator()( Magick::Image &image_ ) const 1119{ 1120 image_.resize( _geometry ); 1121} 1122 1123// Zoom image to specified size. 1124Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ ) 1125 : _geometry( geometry_ ) 1126{ 1127} 1128void Magick::zoomImage::operator()( Magick::Image &image_ ) const 1129{ 1130 image_.zoom( _geometry ); 1131} 1132 1133// 1134// Function object image attribute accessors 1135// 1136 1137// Join images into a single multi-image file 1138Magick::adjoinImage::adjoinImage( const bool flag_ ) 1139 : _flag( flag_ ) 1140{ 1141} 1142void Magick::adjoinImage::operator()( Magick::Image &image_ ) const 1143{ 1144 image_.adjoin( _flag ); 1145} 1146 1147// Time in 1/100ths of a second which must expire before displaying 1148// the next image in an animated sequence. 1149Magick::animationDelayImage::animationDelayImage( const size_t delay_ ) 1150 : _delay( delay_ ) 1151{ 1152} 1153void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const 1154{ 1155 image_.animationDelay( _delay ); 1156} 1157 1158// Number of iterations to loop an animation (e.g. Netscape loop 1159// extension) for. 1160Magick::animationIterationsImage::animationIterationsImage( const size_t iterations_ ) 1161 : _iterations( iterations_ ) 1162{ 1163} 1164void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const 1165{ 1166 image_.animationIterations( _iterations ); 1167} 1168 1169// Image background color 1170Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ ) 1171 : _color( color_ ) 1172{ 1173} 1174void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const 1175{ 1176 image_.backgroundColor( _color ); 1177} 1178 1179// Name of texture image to tile onto the image background 1180Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ ) 1181 : _backgroundTexture( backgroundTexture_ ) 1182{ 1183} 1184void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const 1185{ 1186 image_.backgroundTexture( _backgroundTexture ); 1187} 1188 1189// Image border color 1190Magick::borderColorImage::borderColorImage( const Magick::Color &color_ ) 1191 : _color( color_ ) 1192{ 1193} 1194void Magick::borderColorImage::operator()( Magick::Image &image_ ) const 1195{ 1196 image_.borderColor( _color ); 1197} 1198 1199// Text bounding-box base color (default none) 1200Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ ) 1201 : _boxColor( boxColor_ ) { } 1202 1203void Magick::boxColorImage::operator()( Magick::Image &image_ ) const 1204{ 1205 image_.boxColor( _boxColor ); 1206} 1207 1208Magick::chromaBluePrimaryImage::chromaBluePrimaryImage(const double x_, 1209 const double y_,const double z_) 1210 : _x(x_), 1211 _y(y_), 1212 _z(z_) 1213{ 1214} 1215 1216void Magick::chromaBluePrimaryImage::operator()(Magick::Image &image_) const 1217{ 1218 image_.chromaBluePrimary(_x,_y,_z); 1219} 1220 1221Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage(const double x_, 1222 const double y_,const double z_) 1223 : _x(x_), 1224 _y(y_), 1225 _z(z_) 1226{ 1227} 1228 1229void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const 1230{ 1231 image_.chromaGreenPrimary(_x,_y,_z); 1232} 1233 1234Magick::chromaRedPrimaryImage::chromaRedPrimaryImage(const double x_, 1235 const double y_,const double z_) 1236 : _x(x_), 1237 _y(y_), 1238 _z(z_) 1239{ 1240} 1241 1242void Magick::chromaRedPrimaryImage::operator()(Magick::Image &image_) const 1243{ 1244 image_.chromaRedPrimary(_x,_y,_z); 1245} 1246 1247Magick::chromaWhitePointImage::chromaWhitePointImage(const double x_, 1248 const double y_,const double z_) 1249 : _x(x_), 1250 _y(y_), 1251 _z(z_) 1252{ 1253} 1254 1255void Magick::chromaWhitePointImage::operator()(Magick::Image &image_) const 1256{ 1257 image_.chromaWhitePoint(_x,_y,_z); 1258} 1259 1260// Colors within this distance are considered equal 1261Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ ) 1262 : _fuzz( fuzz_ ) 1263{ 1264} 1265void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const 1266{ 1267 image_.colorFuzz( _fuzz ); 1268} 1269 1270// Color at colormap position index_ 1271Magick::colorMapImage::colorMapImage( const size_t index_, 1272 const Color &color_ ) 1273 : _index( index_ ), 1274 _color( color_ ) 1275{ 1276} 1277void Magick::colorMapImage::operator()( Magick::Image &image_ ) const 1278{ 1279 image_.colorMap( _index, _color ); 1280} 1281 1282// Composition operator to be used when composition is implicitly used 1283// (such as for image flattening). 1284Magick::composeImage::composeImage( const CompositeOperator compose_ ) 1285 : _compose( compose_ ) 1286{ 1287} 1288void Magick::composeImage::operator()( Magick::Image &image_ ) const 1289{ 1290 image_.compose( _compose ); 1291} 1292 1293// Compression type 1294Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ ) 1295 : _compressType( compressType_ ) 1296{ 1297} 1298void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const 1299{ 1300 image_.compressType( _compressType ); 1301} 1302 1303// Vertical and horizontal resolution in pixels of the image 1304Magick::densityImage::densityImage( const Point &point_ ) 1305 : _point( point_ ) 1306{ 1307} 1308void Magick::densityImage::operator()( Magick::Image &image_ ) const 1309{ 1310 image_.density( _point ); 1311} 1312 1313// Image depth (bits allocated to red/green/blue components) 1314Magick::depthImage::depthImage( const size_t depth_ ) 1315 : _depth( depth_ ) 1316{ 1317} 1318void Magick::depthImage::operator()( Magick::Image &image_ ) const 1319{ 1320 image_.depth( _depth ); 1321} 1322 1323// Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image 1324// formats which support endian-specific options. 1325Magick::endianImage::endianImage( const Magick::EndianType endian_ ) 1326 : _endian( endian_ ) 1327{ 1328} 1329void Magick::endianImage::operator()( Magick::Image &image_ ) const 1330{ 1331 image_.endian( _endian ); 1332} 1333 1334// Image file name 1335Magick::fileNameImage::fileNameImage( const std::string &fileName_ ) 1336 : _fileName( fileName_ ) 1337{ 1338} 1339void Magick::fileNameImage::operator()( Magick::Image &image_ ) const 1340{ 1341 image_.fileName( _fileName ); 1342} 1343 1344// Filter to use when resizing image 1345Magick::filterTypeImage::filterTypeImage( const FilterType filterType_ ) 1346 : _filterType( filterType_ ) 1347{ 1348} 1349void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const 1350{ 1351 image_.filterType( _filterType ); 1352} 1353 1354// Text rendering font 1355Magick::fontImage::fontImage( const std::string &font_ ) 1356 : _font( font_ ) 1357{ 1358} 1359void Magick::fontImage::operator()( Magick::Image &image_ ) const 1360{ 1361 image_.font( _font ); 1362} 1363 1364// Font point size 1365Magick::fontPointsizeImage::fontPointsizeImage( const size_t pointsize_ ) 1366 : _pointsize( pointsize_ ) 1367{ 1368} 1369void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const 1370{ 1371 image_.fontPointsize( _pointsize ); 1372} 1373 1374// GIF disposal method 1375Magick::gifDisposeMethodImage::gifDisposeMethodImage( const DisposeType disposeMethod_ ) 1376 : _disposeMethod( disposeMethod_ ) 1377{ 1378} 1379void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const 1380{ 1381 image_.gifDisposeMethod( _disposeMethod ); 1382} 1383 1384// Type of interlacing to use 1385Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ ) 1386 : _interlace( interlace_ ) 1387{ 1388} 1389void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const 1390{ 1391 image_.interlaceType( _interlace ); 1392} 1393 1394// File type magick identifier (.e.g "GIF") 1395Magick::magickImage::magickImage( const std::string &magick_ ) 1396 : _magick( magick_ ) 1397{ 1398} 1399void Magick::magickImage::operator()( Magick::Image &image_ ) const 1400{ 1401 image_.magick( _magick ); 1402} 1403 1404// Image supports transparent color 1405Magick::alphaFlagImage::alphaFlagImage( const bool alphaFlag_ ) 1406 : _alphaFlag( alphaFlag_ ) 1407{ 1408} 1409void Magick::alphaFlagImage::operator()( Magick::Image &image_ ) const 1410{ 1411 image_.alpha( _alphaFlag ); 1412} 1413 1414// Transparent color 1415Magick::alphaColorImage::alphaColorImage( const Color &alphaColor_ ) 1416 : _alphaColor( alphaColor_ ) 1417{ 1418} 1419void Magick::alphaColorImage::operator()( Magick::Image &image_ ) const 1420{ 1421 image_.alphaColor( _alphaColor ); 1422} 1423 1424// Indicate that image is black and white 1425Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ ) 1426 : _monochromeFlag( monochromeFlag_ ) 1427{ 1428} 1429void Magick::monochromeImage::operator()( Magick::Image &image_ ) const 1430{ 1431 image_.monochrome( _monochromeFlag ); 1432} 1433 1434// Set pixel color at location x & y. 1435Magick::pixelColorImage::pixelColorImage( const ssize_t x_, 1436 const ssize_t y_, 1437 const Color &color_) 1438 : _x( x_ ), 1439 _y( y_ ), 1440 _color( color_ ) { } 1441 1442void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const 1443{ 1444 image_.pixelColor( _x, _y, _color ); 1445} 1446 1447// Postscript page size. 1448Magick::pageImage::pageImage( const Geometry &pageSize_ ) 1449 : _pageSize( pageSize_ ) 1450{ 1451} 1452void Magick::pageImage::operator()( Magick::Image &image_ ) const 1453{ 1454 image_.page( _pageSize ); 1455} 1456 1457// JPEG/MIFF/PNG compression level (default 75). 1458Magick::qualityImage::qualityImage( const size_t quality_ ) 1459 : _quality( quality_ ) 1460{ 1461} 1462void Magick::qualityImage::operator()( Magick::Image &image_ ) const 1463{ 1464 image_.quality( _quality ); 1465} 1466 1467// Maximum number of colors to quantize to 1468Magick::quantizeColorsImage::quantizeColorsImage( const size_t colors_ ) 1469 : _colors( colors_ ) 1470{ 1471} 1472void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const 1473{ 1474 image_.quantizeColors( _colors ); 1475} 1476 1477// Colorspace to quantize in. 1478Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ ) 1479 : _colorSpace( colorSpace_ ) 1480{ 1481} 1482void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const 1483{ 1484 image_.quantizeColorSpace( _colorSpace ); 1485} 1486 1487// Dither image during quantization (default true). 1488Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ ) 1489 : _ditherFlag( ditherFlag_ ) 1490{ 1491} 1492void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const 1493{ 1494 image_.quantizeDither( _ditherFlag ); 1495} 1496 1497// Quantization tree-depth 1498Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const size_t treeDepth_ ) 1499 : _treeDepth( treeDepth_ ) { } 1500 1501void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const 1502{ 1503 image_.quantizeTreeDepth( _treeDepth ); 1504} 1505 1506// The type of rendering intent 1507Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ ) 1508 : _renderingIntent( renderingIntent_ ) 1509{ 1510} 1511void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const 1512{ 1513 image_.renderingIntent( _renderingIntent ); 1514} 1515 1516// Units of image resolution 1517Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ ) 1518 : _resolutionUnits( resolutionUnits_ ) 1519{ 1520} 1521void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const 1522{ 1523 image_.resolutionUnits( _resolutionUnits ); 1524} 1525 1526// Image scene number 1527Magick::sceneImage::sceneImage( const size_t scene_ ) 1528 : _scene( scene_ ) 1529{ 1530} 1531void Magick::sceneImage::operator()( Magick::Image &image_ ) const 1532{ 1533 image_.scene( _scene ); 1534} 1535 1536// Width and height of a raw image 1537Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ ) 1538 : _geometry( geometry_ ) 1539{ 1540} 1541void Magick::sizeImage::operator()( Magick::Image &image_ ) const 1542{ 1543 image_.size( _geometry ); 1544} 1545 1546// Splice the background color into the image. 1547Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ ) 1548 : _geometry( geometry_ ) 1549{ 1550} 1551void Magick::spliceImage::operator()( Magick::Image &image_ ) const 1552{ 1553 image_.splice( _geometry ); 1554} 1555 1556// stripImage strips an image of all profiles and comments. 1557Magick::stripImage::stripImage( void ) 1558{ 1559} 1560void Magick::stripImage::operator()( Magick::Image &image_ ) const 1561{ 1562 image_.strip( ); 1563} 1564 1565// Subimage of an image sequence 1566Magick::subImageImage::subImageImage( const size_t subImage_ ) 1567 : _subImage( subImage_ ) 1568{ 1569} 1570void Magick::subImageImage::operator()( Magick::Image &image_ ) const 1571{ 1572 image_.subImage( _subImage ); 1573} 1574 1575// Number of images relative to the base image 1576Magick::subRangeImage::subRangeImage( const size_t subRange_ ) 1577 : _subRange( subRange_ ) 1578{ 1579} 1580void Magick::subRangeImage::operator()( Magick::Image &image_ ) const 1581{ 1582 image_.subRange( _subRange ); 1583} 1584 1585// Anti-alias Postscript and TrueType fonts (default true) 1586Magick::textAntiAliasImage::textAntiAliasImage( const bool flag_ ) 1587 : _flag( flag_ ) 1588{ 1589} 1590void Magick::textAntiAliasImage::operator()( Magick::Image &image_ ) const 1591{ 1592 image_.textAntiAlias( _flag ); 1593} 1594 1595// Image storage type 1596Magick::typeImage::typeImage( const Magick::ImageType type_ ) 1597 : _type( type_ ) 1598{ 1599} 1600void Magick::typeImage::operator()( Magick::Image &image_ ) const 1601{ 1602 image_.type( _type ); 1603} 1604 1605// Print detailed information about the image 1606Magick::verboseImage::verboseImage( const bool verbose_ ) 1607 : _verbose( verbose_ ) 1608{ 1609} 1610void Magick::verboseImage::operator()( Magick::Image &image_ ) const 1611{ 1612 image_.verbose( _verbose ); 1613} 1614 1615// X11 display to display to, obtain fonts from, or to capture image 1616// from 1617Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ ) 1618 : _display( display_ ) 1619{ 1620} 1621void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const 1622{ 1623 image_.x11Display( _display ); 1624} 1625