Powered by Pair ImageMagick logo
Image Magick
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

ImageMagick-6.1.1/Magick++/lib/STL.cpp

Go to the documentation of this file.
00001 // This may look like C code, but it is really -*- C++ -*- 00002 // 00003 // Copyright Bob Friesenhahn, 1999, 2002 00004 // 00005 // Implementation of STL classes and functions 00006 // 00007 00008 #define MAGICK_IMPLEMENTATION 1 00009 00010 #include <Magick++/Image.h> 00011 #include <Magick++/STL.h> 00012 00013 // Local adaptive threshold image 00014 Magick::adaptiveThresholdImage::adaptiveThresholdImage( const unsigned int width_, 00015 const unsigned int height_, 00016 const unsigned int offset_ ) 00017 : _width(width_), 00018 _height(height_), 00019 _offset(offset_) 00020 { 00021 } 00022 void Magick::adaptiveThresholdImage::operator()( Magick::Image &image_ ) const 00023 { 00024 image_.adaptiveThreshold( _width, _height, _offset ); 00025 } 00026 00027 // Add noise to image with specified noise type 00028 Magick::addNoiseImage::addNoiseImage( Magick::NoiseType noiseType_ ) 00029 : _noiseType( noiseType_ ) 00030 { 00031 } 00032 void Magick::addNoiseImage::operator()( Magick::Image &image_ ) const 00033 { 00034 image_.addNoise( _noiseType ); 00035 } 00036 00037 // Transform image by specified affine (or free transform) matrix. 00038 Magick::affineTransformImage::affineTransformImage( const DrawableAffine &affine_ ) 00039 : _affine( affine_ ) 00040 { 00041 } 00042 void Magick::affineTransformImage::operator()( Magick::Image &image_ ) const 00043 { 00044 image_.affineTransform( _affine ); 00045 } 00046 00047 // Annotate image (draw text on image) 00048 00049 // Annotate using specified text, and placement location 00050 Magick::annotateImage::annotateImage ( const std::string &text_, 00051 const Magick::Geometry &geometry_ ) 00052 : _text( text_ ), 00053 _geometry( geometry_ ), 00054 _gravity( Magick::NorthWestGravity ), 00055 _degrees( 0 ) 00056 { 00057 } 00058 // Annotate using specified text, bounding area, and placement gravity 00059 Magick::annotateImage::annotateImage ( const std::string &text_, 00060 const Magick::Geometry &geometry_, 00061 const Magick::GravityType gravity_ ) 00062 : _text( text_ ), 00063 _geometry( geometry_ ), 00064 _gravity( gravity_ ), 00065 _degrees( 0 ) 00066 { 00067 } 00068 // Annotate with text using specified text, bounding area, placement 00069 // gravity, and rotation. 00070 Magick::annotateImage::annotateImage ( const std::string &text_, 00071 const Magick::Geometry &geometry_, 00072 const Magick::GravityType gravity_, 00073 const double degrees_ ) 00074 : _text( text_ ), 00075 _geometry( geometry_ ), 00076 _gravity( gravity_ ), 00077 _degrees( degrees_ ) 00078 { 00079 } 00080 // Annotate with text (bounding area is entire image) and placement 00081 // gravity. 00082 Magick::annotateImage::annotateImage ( const std::string &text_, 00083 const Magick::GravityType gravity_ ) 00084 : _text( text_ ), 00085 _geometry( ), 00086 _gravity( gravity_ ), 00087 _degrees( 0 ) 00088 { 00089 } 00090 void Magick::annotateImage::operator()( Magick::Image &image_ ) const 00091 { 00092 image_.annotate( _text, _geometry, _gravity, _degrees ); 00093 } 00094 00095 // Blur image with specified blur factor 00096 Magick::blurImage::blurImage( const double radius_, const double sigma_ ) 00097 : _radius( radius_ ), 00098 _sigma( sigma_ ) 00099 { 00100 } 00101 void Magick::blurImage::operator()( Magick::Image &image_ ) const 00102 { 00103 image_.blur( _radius, _sigma ); 00104 } 00105 00106 // Border image (add border to image) 00107 Magick::borderImage::borderImage( const Magick::Geometry &geometry_ ) 00108 : _geometry( geometry_ ) 00109 { 00110 } 00111 void Magick::borderImage::operator()( Magick::Image &image_ ) const 00112 { 00113 image_.border( _geometry ); 00114 } 00115 00116 // Charcoal effect image (looks like charcoal sketch) 00117 Magick::charcoalImage::charcoalImage( const double radius_, const double sigma_ ) 00118 : _radius( radius_ ), 00119 _sigma( sigma_ ) 00120 { 00121 } 00122 void Magick::charcoalImage::operator()( Magick::Image &image_ ) const 00123 { 00124 image_.charcoal( _radius, _sigma ); 00125 } 00126 00127 // Chop image (remove vertical or horizontal subregion of image) 00128 Magick::chopImage::chopImage( const Magick::Geometry &geometry_ ) 00129 : _geometry( geometry_ ) 00130 { 00131 } 00132 void Magick::chopImage::operator()( Magick::Image &image_ ) const 00133 { 00134 image_.chop( _geometry ); 00135 } 00136 00137 // Colorize image using pen color at specified percent opacity 00138 Magick::colorizeImage::colorizeImage( const unsigned int opacityRed_, 00139 const unsigned int opacityGreen_, 00140 const unsigned int opacityBlue_, 00141 const Magick::Color &penColor_ ) 00142 : _opacityRed ( opacityRed_ ), 00143 _opacityGreen ( opacityGreen_ ), 00144 _opacityBlue ( opacityBlue_ ), 00145 _penColor( penColor_ ) 00146 { 00147 } 00148 Magick::colorizeImage::colorizeImage( const unsigned int opacity_, 00149 const Magick::Color &penColor_ ) 00150 : _opacityRed ( opacity_ ), 00151 _opacityGreen ( opacity_ ), 00152 _opacityBlue ( opacity_ ), 00153 _penColor( penColor_ ) 00154 { 00155 } 00156 void Magick::colorizeImage::operator()( Magick::Image &image_ ) const 00157 { 00158 image_.colorize( _opacityRed, _opacityGreen, _opacityBlue, _penColor ); 00159 } 00160 00161 // Convert the image colorspace representation 00162 Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ ) 00163 : _colorSpace( colorSpace_ ) 00164 { 00165 } 00166 void Magick::colorSpaceImage::operator()( Magick::Image &image_ ) const 00167 { 00168 image_.colorSpace( _colorSpace ); 00169 } 00170 00171 // Comment image (add comment string to image) 00172 Magick::commentImage::commentImage( const std::string &comment_ ) 00173 : _comment( comment_ ) 00174 { 00175 } 00176 void Magick::commentImage::operator()( Magick::Image &image_ ) const 00177 { 00178 image_.comment( _comment ); 00179 } 00180 00181 // Compose an image onto another at specified offset and using 00182 // specified algorithm 00183 Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, 00184 int xOffset_, 00185 int yOffset_, 00186 Magick::CompositeOperator compose_ ) 00187 : _compositeImage( compositeImage_ ), 00188 _xOffset ( xOffset_ ), 00189 _yOffset ( yOffset_ ), 00190 _compose ( compose_ ) 00191 { 00192 } 00193 Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, 00194 const Magick::Geometry &offset_, 00195 Magick::CompositeOperator compose_ ) 00196 : _compositeImage( compositeImage_ ), 00197 _xOffset ( offset_.xOff() ), 00198 _yOffset ( offset_.yOff() ), 00199 _compose ( compose_ ) 00200 { 00201 } 00202 void Magick::compositeImage::operator()( Image &image_ ) const 00203 { 00204 image_.composite( _compositeImage, _xOffset, _yOffset, _compose ); 00205 } 00206 00207 // Contrast image (enhance intensity differences in image) 00208 Magick::contrastImage::contrastImage( const unsigned int sharpen_ ) 00209 : _sharpen( sharpen_ ) 00210 { 00211 } 00212 void Magick::contrastImage::operator()( Magick::Image &image_ ) const 00213 { 00214 image_.contrast( _sharpen ); 00215 } 00216 00217 // Crop image (subregion of original image) 00218 Magick::cropImage::cropImage( const Magick::Geometry &geometry_ ) 00219 : _geometry( geometry_ ) 00220 { 00221 } 00222 void Magick::cropImage::operator()( Magick::Image &image_ ) const 00223 { 00224 image_.crop( _geometry ); 00225 } 00226 00227 // Cycle image colormap 00228 Magick::cycleColormapImage::cycleColormapImage( const int amount_ ) 00229 : _amount( amount_ ) 00230 { 00231 } 00232 void Magick::cycleColormapImage::operator()( Magick::Image &image_ ) const 00233 { 00234 image_.cycleColormap( _amount ); 00235 } 00236 00237 // Despeckle image (reduce speckle noise) 00238 Magick::despeckleImage::despeckleImage( void ) 00239 { 00240 } 00241 void Magick::despeckleImage::operator()( Magick::Image &image_ ) const 00242 { 00243 image_.despeckle( ); 00244 } 00245 00246 // Draw on image 00247 Magick::drawImage::drawImage( const Magick::Drawable &drawable_ ) 00248 : _drawableList() 00249 { 00250 _drawableList.push_back( drawable_ ); 00251 } 00252 Magick::drawImage::drawImage( const std::list<Magick::Drawable> &drawable_ ) 00253 : _drawableList( drawable_ ) 00254 { 00255 } 00256 void Magick::drawImage::operator()( Magick::Image &image_ ) const 00257 { 00258 image_.draw( _drawableList ); 00259 } 00260 00261 // Edge image (hilight edges in image) 00262 Magick::edgeImage::edgeImage( const double radius_ ) 00263 : _radius( radius_ ) 00264 { 00265 } 00266 void Magick::edgeImage::operator()( Magick::Image &image_ ) const 00267 { 00268 image_.edge( _radius ); 00269 } 00270 00271 // Emboss image (hilight edges with 3D effect) 00272 Magick::embossImage::embossImage( void ) 00273 : _radius( 1 ), 00274 _sigma( 0.5 ) 00275 { 00276 } 00277 Magick::embossImage::embossImage( const double radius_, const double sigma_ ) 00278 : _radius( radius_ ), 00279 _sigma( sigma_ ) 00280 { 00281 } 00282 void Magick::embossImage::operator()( Magick::Image &image_ ) const 00283 { 00284 image_.emboss( _radius, _sigma ); 00285 } 00286 00287 // Enhance image (minimize noise) 00288 Magick::enhanceImage::enhanceImage( void ) 00289 { 00290 } 00291 void Magick::enhanceImage::operator()( Magick::Image &image_ ) const 00292 { 00293 image_.enhance( ); 00294 } 00295 00296 // Equalize image (histogram equalization) 00297 Magick::equalizeImage::equalizeImage( void ) 00298 { 00299 } 00300 void Magick::equalizeImage::operator()( Magick::Image &image_ ) const 00301 { 00302 image_.equalize( ); 00303 } 00304 00305 // Color to use when filling drawn objects 00306 Magick::fillColorImage::fillColorImage( const Magick::Color &fillColor_ ) 00307 : _fillColor( fillColor_ ) 00308 { 00309 } 00310 void Magick::fillColorImage::operator()( Magick::Image &image_ ) const 00311 { 00312 image_.fillColor( _fillColor ); 00313 } 00314 00315 // Flip image (reflect each scanline in the vertical direction) 00316 Magick::flipImage::flipImage( void ) 00317 { 00318 } 00319 void Magick::flipImage::operator()( Magick::Image &image_ ) const 00320 { 00321 image_.flip( ); 00322 } 00323 00324 // Flood-fill image with color 00325 // Flood-fill color across pixels starting at target-pixel and 00326 // stopping at pixels matching specified border color. Uses current 00327 // fuzz setting when determining color match. 00328 Magick::floodFillColorImage::floodFillColorImage( const unsigned int x_, 00329 const unsigned int y_, 00330 const Magick::Color &fillColor_ ) 00331 : _x(x_), 00332 _y(y_), 00333 _fillColor(fillColor_), 00334 _borderColor() 00335 { 00336 } 00337 Magick::floodFillColorImage::floodFillColorImage( const Magick::Geometry &point_, 00338 const Magick::Color &fillColor_ ) 00339 : _x(point_.xOff()), 00340 _y(point_.yOff()), 00341 _fillColor(fillColor_), 00342 _borderColor() 00343 { 00344 } 00345 // Flood-fill color across pixels starting at target-pixel and 00346 // stopping at pixels matching specified border color. Uses current 00347 // fuzz setting when determining color match. 00348 Magick::floodFillColorImage::floodFillColorImage( const unsigned int x_, 00349 const unsigned int y_, 00350 const Magick::Color &fillColor_, 00351 const Magick::Color &borderColor_ ) 00352 : _x(x_), 00353 _y(y_), 00354 _fillColor(fillColor_), 00355 _borderColor(borderColor_) 00356 { 00357 } 00358 Magick::floodFillColorImage::floodFillColorImage( const Geometry &point_, 00359 const Color &fillColor_, 00360 const Color &borderColor_ ) 00361 : _x(point_.xOff()), 00362 _y(point_.yOff()), 00363 _fillColor(fillColor_), 00364 _borderColor(borderColor_) 00365 { 00366 } 00367 void Magick::floodFillColorImage::operator()( Magick::Image &image_ ) const 00368 { 00369 if ( _borderColor.isValid() ) 00370 { 00371 image_.floodFillColor( _x, _y, _fillColor, _borderColor ); 00372 } 00373 else 00374 { 00375 image_.floodFillColor( _x, _y, _fillColor ); 00376 } 00377 } 00378 00379 // Flood-fill image with texture 00380 00381 // Flood-fill texture across pixels that match the color of the target 00382 // pixel and are neighbors of the target pixel. Uses current fuzz 00383 // setting when determining color match. 00384 Magick::floodFillTextureImage::floodFillTextureImage( const unsigned int x_, 00385 const unsigned int y_, 00386 const Magick::Image &texture_ ) 00387 : _x(x_), 00388 _y(y_), 00389 _texture(texture_), 00390 _borderColor() 00391 { 00392 } 00393 Magick::floodFillTextureImage::floodFillTextureImage( const Magick::Geometry &point_, 00394 const Magick::Image &texture_ ) 00395 : _x(point_.xOff()), 00396 _y(point_.yOff()), 00397 _texture(texture_), 00398 _borderColor() 00399 { 00400 } 00401 // Flood-fill texture across pixels starting at target-pixel and 00402 // stopping at pixels matching specified border color. Uses current 00403 // fuzz setting when determining color match. 00404 Magick::floodFillTextureImage::floodFillTextureImage( const unsigned int x_, 00405 const unsigned int y_, 00406 const Magick::Image &texture_, 00407 const Magick::Color &borderColor_ ) 00408 : _x(x_), 00409 _y(y_), 00410 _texture(texture_), 00411 _borderColor(borderColor_) 00412 { 00413 } 00414 Magick::floodFillTextureImage::floodFillTextureImage( const Magick::Geometry &point_, 00415 const Magick::Image &texture_, 00416 const Magick::Color &borderColor_ ) 00417 : _x(point_.xOff()), 00418 _y(point_.yOff()), 00419 _texture(texture_), 00420 _borderColor(borderColor_) 00421 { 00422 } 00423 void Magick::floodFillTextureImage::operator()( Magick::Image &image_ ) const 00424 { 00425 if ( _borderColor.isValid() ) 00426 { 00427 image_.floodFillTexture( _x, _y, _texture, _borderColor ); 00428 } 00429 else 00430 { 00431 image_.floodFillTexture( _x, _y, _texture ); 00432 } 00433 } 00434 00435 // Flop image (reflect each scanline in the horizontal direction) 00436 Magick::flopImage::flopImage( void ) 00437 { 00438 } 00439 void Magick::flopImage::operator()( Magick::Image &image_ ) const 00440 { 00441 image_.flop( ); 00442 } 00443 00444 // Frame image 00445 Magick::frameImage::frameImage( const Magick::Geometry &geometry_ ) 00446 : _width( geometry_.width() ), 00447 _height( geometry_.height() ), 00448 _outerBevel( geometry_.xOff() ), 00449 _innerBevel( geometry_.yOff() ) 00450 { 00451 } 00452 Magick::frameImage::frameImage( const unsigned int width_, const unsigned int height_, 00453 const int innerBevel_, const int outerBevel_ ) 00454 : _width( width_ ), 00455 _height( height_ ), 00456 _outerBevel( outerBevel_ ), 00457 _innerBevel( innerBevel_ ) 00458 { 00459 } 00460 void Magick::frameImage::operator()( Magick::Image &image_ ) const 00461 { 00462 image_.frame( _width, _height, _innerBevel, _outerBevel ); 00463 } 00464 00465 // Gamma correct image 00466 Magick::gammaImage::gammaImage( const double gamma_ ) 00467 : _gammaRed( gamma_ ), 00468 _gammaGreen( gamma_ ), 00469 _gammaBlue( gamma_ ) 00470 { 00471 } 00472 Magick::gammaImage::gammaImage ( const double gammaRed_, 00473 const double gammaGreen_, 00474 const double gammaBlue_ ) 00475 : _gammaRed( gammaRed_ ), 00476 _gammaGreen( gammaGreen_ ), 00477 _gammaBlue( gammaBlue_ ) 00478 { 00479 } 00480 void Magick::gammaImage::operator()( Magick::Image &image_ ) const 00481 { 00482 image_.gamma( _gammaRed, _gammaGreen, _gammaBlue ); 00483 } 00484 00485 // Gaussian blur image 00486 // The number of neighbor pixels to be included in the convolution 00487 // mask is specified by 'width_'. The standard deviation of the 00488 // gaussian bell curve is specified by 'sigma_'. 00489 Magick::gaussianBlurImage::gaussianBlurImage( const double width_, 00490 const double sigma_ ) 00491 : _width( width_ ), 00492 _sigma( sigma_ ) 00493 { 00494 } 00495 void Magick::gaussianBlurImage::operator()( Magick::Image &image_ ) const 00496 { 00497 image_.gaussianBlur( _width, _sigma ); 00498 } 00499 00500 // Implode image (special effect) 00501 Magick::implodeImage::implodeImage( const double factor_ ) 00502 : _factor( factor_ ) 00503 { 00504 } 00505 void Magick::implodeImage::operator()( Magick::Image &image_ ) const 00506 { 00507 image_.implode( _factor ); 00508 } 00509 00510 // Set image validity. Valid images become empty (inValid) if argument 00511 // is false. 00512 Magick::isValidImage::isValidImage( const bool isValid_ ) 00513 : _isValid( isValid_ ) 00514 { 00515 } 00516 void Magick::isValidImage::operator()( Magick::Image &image_ ) const 00517 { 00518 image_.isValid( _isValid ); 00519 } 00520 00521 // Label image 00522 Magick::labelImage::labelImage( const std::string &label_ ) 00523 : _label( label_ ) 00524 { 00525 } 00526 void Magick::labelImage::operator()( Magick::Image &image_ ) const 00527 { 00528 image_.label( _label ); 00529 } 00530 00531 // Extract channel from image 00532 Magick::channelImage::channelImage( const Magick::ChannelType channel_ ) 00533 : _channel( channel_ ) 00534 { 00535 } 00536 void Magick::channelImage::operator()( Magick::Image &image_ ) const 00537 { 00538 image_.channel( _channel ); 00539 } 00540 00541 // Magnify image by integral size 00542 Magick::magnifyImage::magnifyImage( void ) 00543 { 00544 } 00545 void Magick::magnifyImage::operator()( Magick::Image &image_ ) const 00546 { 00547 image_.magnify( ); 00548 } 00549 00550 // Remap image colors with closest color from reference image 00551 Magick::mapImage::mapImage( const Magick::Image &mapImage_ , 00552 const bool dither_ ) 00553 : _mapImage( mapImage_ ), 00554 _dither( dither_ ) 00555 { 00556 } 00557 void Magick::mapImage::operator()( Magick::Image &image_ ) const 00558 { 00559 image_.map( _mapImage, _dither ); 00560 } 00561 00562 // Floodfill designated area with a matte value 00563 Magick::matteFloodfillImage::matteFloodfillImage( const Color &target_ , 00564 const unsigned int matte_, 00565 const int x_, const int y_, 00566 const PaintMethod method_ ) 00567 : _target( target_ ), 00568 _matte( matte_ ), 00569 _x( x_ ), 00570 _y( y_ ), 00571 _method( method_ ) 00572 { 00573 } 00574 void Magick::matteFloodfillImage::operator()( Magick::Image &image_ ) const 00575 { 00576 image_.matteFloodfill( _target, _matte, _x, _y, _method ); 00577 } 00578 00579 // Filter image by replacing each pixel component with the median 00580 // color in a circular neighborhood 00581 Magick::medianFilterImage::medianFilterImage( const double radius_ ) 00582 : _radius( radius_ ) 00583 { 00584 } 00585 void Magick::medianFilterImage::operator()( Magick::Image &image_ ) const 00586 { 00587 image_.medianFilter( _radius ); 00588 } 00589 00590 // Reduce image by integral size 00591 Magick::minifyImage::minifyImage( void ) 00592 { 00593 } 00594 void Magick::minifyImage::operator()( Magick::Image &image_ ) const 00595 { 00596 image_.minify( ); 00597 } 00598 00599 // Modulate percent hue, saturation, and brightness of an image 00600 Magick::modulateImage::modulateImage( const double brightness_, 00601 const double saturation_, 00602 const double hue_ ) 00603 : _brightness( brightness_ ), 00604 _saturation( saturation_ ), 00605 _hue( hue_ ) 00606 { 00607 } 00608 void Magick::modulateImage::operator()( Magick::Image &image_ ) const 00609 { 00610 image_.modulate( _brightness, _saturation, _hue ); 00611 } 00612 00613 // Negate colors in image. Set grayscale to only negate grayscale 00614 // values in image. 00615 Magick::negateImage::negateImage( const bool grayscale_ ) 00616 : _grayscale( grayscale_ ) 00617 { 00618 } 00619 void Magick::negateImage::operator()( Magick::Image &image_ ) const 00620 { 00621 image_.negate( _grayscale ); 00622 } 00623 00624 // Normalize image (increase contrast by normalizing the pixel values 00625 // to span the full range of color values) 00626 Magick::normalizeImage::normalizeImage( void ) 00627 { 00628 } 00629 void Magick::normalizeImage::operator()( Magick::Image &image_ ) const 00630 { 00631 image_.normalize( ); 00632 } 00633 00634 // Oilpaint image (image looks like oil painting) 00635 Magick::oilPaintImage::oilPaintImage( const double radius_ ) 00636 : _radius( radius_ ) 00637 { 00638 } 00639 void Magick::oilPaintImage::operator()( Magick::Image &image_ ) const 00640 { 00641 image_.oilPaint( _radius ); 00642 } 00643 00644 // Set or attenuate the image opacity channel. If the image pixels are 00645 // opaque then they are set to the specified opacity value, otherwise 00646 // they are blended with the supplied opacity value. The value of 00647 // opacity_ ranges from 0 (completely opaque) to MaxRGB. The defines 00648 // OpaqueOpacity and TransparentOpacity are available to specify 00649 // completely opaque or completely transparent, respectively. 00650 Magick::opacityImage::opacityImage( const unsigned int opacity_ ) 00651 : _opacity( opacity_ ) 00652 { 00653 } 00654 void Magick::opacityImage::operator()( Magick::Image &image_ ) const 00655 { 00656 image_.opacity( _opacity ); 00657 } 00658 00659 // Change color of opaque pixel to specified pen color. 00660 Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_, 00661 const Magick::Color &penColor_ ) 00662 : _opaqueColor( opaqueColor_ ), 00663 _penColor( penColor_ ) 00664 { 00665 } 00666 void Magick::opaqueImage::operator()( Magick::Image &image_ ) const 00667 { 00668 image_.opaque( _opaqueColor, _penColor ); 00669 } 00670 00671 // Quantize image (reduce number of colors) 00672 Magick::quantizeImage::quantizeImage( const bool measureError_ ) 00673 : _measureError( measureError_ ) 00674 { 00675 } 00676 void Magick::quantizeImage::operator()( Image &image_ ) const 00677 { 00678 image_.quantize( _measureError ); 00679 } 00680 00681 // Raise image (lighten or darken the edges of an image to give a 3-D 00682 // raised or lowered effect) 00683 Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ , 00684 const bool raisedFlag_ ) 00685 : _geometry( geometry_ ), 00686 _raisedFlag( raisedFlag_ ) 00687 { 00688 } 00689 void Magick::raiseImage::operator()( Magick::Image &image_ ) const 00690 { 00691 image_.raise( _geometry, _raisedFlag ); 00692 } 00693 00694 // Reduce noise in image using a noise peak elimination filter 00695 Magick::reduceNoiseImage::reduceNoiseImage( void ) 00696 : _order(3) 00697 { 00698 } 00699 Magick::reduceNoiseImage::reduceNoiseImage ( const unsigned int order_ ) 00700 : _order(order_) 00701 { 00702 } 00703 void Magick::reduceNoiseImage::operator()( Image &image_ ) const 00704 { 00705 image_.reduceNoise( _order ); 00706 } 00707 00708 // Roll image (rolls image vertically and horizontally) by specified 00709 // number of columnms and rows) 00710 Magick::rollImage::rollImage( const Magick::Geometry &roll_ ) 00711 : _columns( roll_.width() ), 00712 _rows( roll_.height() ) 00713 { 00714 } 00715 Magick::rollImage::rollImage( const int columns_, 00716 const int rows_ ) 00717 : _columns( columns_ ), 00718 _rows( rows_ ) 00719 { 00720 } 00721 void Magick::rollImage::operator()( Magick::Image &image_ ) const 00722 { 00723 image_.roll( _columns, _rows ); 00724 } 00725 00726 // Rotate image counter-clockwise by specified number of degrees. 00727 Magick::rotateImage::rotateImage( const double degrees_ ) 00728 : _degrees( degrees_ ) 00729 { 00730 } 00731 void Magick::rotateImage::operator()( Magick::Image &image_ ) const 00732 { 00733 image_.rotate( _degrees ); 00734 } 00735 00736 // Resize image by using pixel sampling algorithm 00737 Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ ) 00738 : _geometry( geometry_ ) 00739 { 00740 } 00741 void Magick::sampleImage::operator()( Magick::Image &image_ ) const 00742 { 00743 image_.sample( _geometry ); 00744 } 00745 00746 // Resize image by using simple ratio algorithm 00747 Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ ) 00748 : _geometry( geometry_ ) 00749 { 00750 } 00751 void Magick::scaleImage::operator()( Magick::Image &image_ ) const 00752 { 00753 image_.scale( _geometry ); 00754 } 00755 00756 // Segment (coalesce similar image components) by analyzing the 00757 // histograms of the color components and identifying units that are 00758 // homogeneous with the fuzzy c-means technique. Also uses 00759 // QuantizeColorSpace and Verbose image attributes 00760 Magick::segmentImage::segmentImage( const double clusterThreshold_ , 00761 const double smoothingThreshold_ ) 00762 : _clusterThreshold( clusterThreshold_ ), 00763 _smoothingThreshold( smoothingThreshold_ ) 00764 { 00765 } 00766 void Magick::segmentImage::operator()( Magick::Image &image_ ) const 00767 { 00768 image_.segment( _clusterThreshold, _smoothingThreshold ); 00769 } 00770 00771 // Shade image using distant light source 00772 Magick::shadeImage::shadeImage( const double clusterThreshold_, 00773 const double smoothingThreshold_ ) 00774 : _clusterThreshold( clusterThreshold_ ), 00775 _smoothingThreshold( smoothingThreshold_ ) 00776 { 00777 } 00778 void Magick::shadeImage::operator()( Magick::Image &image_ ) const 00779 { 00780 image_.shade( _clusterThreshold, _smoothingThreshold ); 00781 } 00782 00783 // Sharpen pixels in image 00784 Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ ) 00785 : _radius( radius_ ), 00786 _sigma( sigma_ ) 00787 { 00788 } 00789 void Magick::sharpenImage::operator()( Magick::Image &image_ ) const 00790 { 00791 image_.sharpen( _radius, _sigma ); 00792 } 00793 00794 // Shave pixels from image edges. 00795 Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ ) 00796 : _geometry( geometry_ ) 00797 { 00798 } 00799 void Magick::shaveImage::operator()( Magick::Image &image_ ) const 00800 { 00801 image_.shave( _geometry ); 00802 } 00803 00804 // Shear image (create parallelogram by sliding image by X or Y axis) 00805 Magick::shearImage::shearImage( const double xShearAngle_, 00806 const double yShearAngle_ ) 00807 : _xShearAngle( xShearAngle_ ), 00808 _yShearAngle( yShearAngle_ ) 00809 { 00810 } 00811 void Magick::shearImage::operator()( Magick::Image &image_ ) const 00812 { 00813 image_.shear( _xShearAngle, _yShearAngle ); 00814 } 00815 00816 // Solarize image (similar to effect seen when exposing a photographic 00817 // film to light during the development process) 00818 Magick::solarizeImage::solarizeImage( const double factor_ ) 00819 : _factor( factor_ ) 00820 { 00821 } 00822 void Magick::solarizeImage::operator()( Magick::Image &image_ ) const 00823 { 00824 image_.solarize( _factor ); 00825 } 00826 00827 // Spread pixels randomly within image by specified ammount 00828 Magick::spreadImage::spreadImage( const unsigned int amount_ ) 00829 : _amount( amount_ ) 00830 { 00831 } 00832 void Magick::spreadImage::operator()( Magick::Image &image_ ) const 00833 { 00834 image_.spread( _amount ); 00835 } 00836 00837 // Add a digital watermark to the image (based on second image) 00838 Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ ) 00839 : _waterMark( waterMark_ ) 00840 { 00841 } 00842 void Magick::steganoImage::operator()( Magick::Image &image_ ) const 00843 { 00844 image_.stegano( _waterMark ); 00845 } 00846 00847 // Create an image which appears in stereo when viewed with red-blue 00848 // glasses (Red image on left, blue on right) 00849 Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ ) 00850 : _rightImage( rightImage_ ) 00851 { 00852 } 00853 void Magick::stereoImage::operator()( Magick::Image &image_ ) const 00854 { 00855 image_.stereo( _rightImage ); 00856 } 00857 00858 // Color to use when drawing object outlines 00859 Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ ) 00860 : _strokeColor( strokeColor_ ) 00861 { 00862 } 00863 void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const 00864 { 00865 image_.strokeColor( _strokeColor ); 00866 } 00867 00868 // Swirl image (image pixels are rotated by degrees) 00869 Magick::swirlImage::swirlImage( const double degrees_ ) 00870 : _degrees( degrees_ ) 00871 { 00872 } 00873 void Magick::swirlImage::operator()( Magick::Image &image_ ) const 00874 { 00875 image_.swirl( _degrees ); 00876 } 00877 00878 // Channel a texture on image background 00879 Magick::textureImage::textureImage( const Magick::Image &texture_ ) 00880 : _texture( texture_ ) 00881 { 00882 } 00883 void Magick::textureImage::operator()( Magick::Image &image_ ) const 00884 { 00885 image_.texture( _texture ); 00886 } 00887 00888 // Threshold image 00889 Magick::thresholdImage::thresholdImage( const double threshold_ ) 00890 : _threshold( threshold_ ) 00891 { 00892 } 00893 void Magick::thresholdImage::operator()( Magick::Image &image_ ) const 00894 { 00895 image_.threshold( _threshold ); 00896 } 00897 00898 // Transform image based on image and crop geometries 00899 Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_ ) 00900 : _imageGeometry( imageGeometry_ ), 00901 _cropGeometry( ) 00902 { 00903 } 00904 Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_, 00905 const Geometry &cropGeometry_ ) 00906 : _imageGeometry( imageGeometry_ ), 00907 _cropGeometry( cropGeometry_ ) 00908 { 00909 } 00910 void Magick::transformImage::operator()( Magick::Image &image_ ) const 00911 { 00912 if ( _cropGeometry.isValid() ) 00913 image_.transform( _imageGeometry, _cropGeometry ); 00914 else 00915 image_.transform( _imageGeometry ); 00916 } 00917 00918 // Set image color to transparent 00919 Magick::transparentImage::transparentImage( const Magick::Color& color_ ) 00920 : _color( color_ ) 00921 { 00922 } 00923 void Magick::transparentImage::operator()( Magick::Image &image_ ) const 00924 { 00925 image_.transparent( _color ); 00926 } 00927 00928 // Trim edges that are the background color from the image 00929 Magick::trimImage::trimImage( void ) 00930 { 00931 } 00932 void Magick::trimImage::operator()( Magick::Image &image_ ) const 00933 { 00934 image_.trim( ); 00935 } 00936 00937 // Map image pixels to a sine wave 00938 Magick::waveImage::waveImage( const double amplitude_, 00939 const double wavelength_ ) 00940 : _amplitude( amplitude_ ), 00941 _wavelength( wavelength_ ) 00942 { 00943 } 00944 void Magick::waveImage::operator()( Magick::Image &image_ ) const 00945 { 00946 image_.wave( _amplitude, _wavelength ); 00947 } 00948 00949 // Zoom image to specified size. 00950 Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ ) 00951 : _geometry( geometry_ ) 00952 { 00953 } 00954 void Magick::zoomImage::operator()( Magick::Image &image_ ) const 00955 { 00956 image_.zoom( _geometry ); 00957 } 00958 00959 // 00960 // Function object image attribute accessors 00961 // 00962 00963 // Anti-alias Postscript and TrueType fonts (default true) 00964 Magick::antiAliasImage::antiAliasImage( const bool flag_ ) 00965 : _flag( flag_ ) 00966 { 00967 } 00968 void Magick::antiAliasImage::operator()( Magick::Image &image_ ) const 00969 { 00970 image_.antiAlias( _flag ); 00971 } 00972 00973 // Join images into a single multi-image file 00974 Magick::adjoinImage::adjoinImage( const bool flag_ ) 00975 : _flag( flag_ ) 00976 { 00977 } 00978 void Magick::adjoinImage::operator()( Magick::Image &image_ ) const 00979 { 00980 image_.adjoin( _flag ); 00981 } 00982 00983 // Time in 1/100ths of a second which must expire before displaying 00984 // the next image in an animated sequence. 00985 Magick::animationDelayImage::animationDelayImage( const unsigned int delay_ ) 00986 : _delay( delay_ ) 00987 { 00988 } 00989 void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const 00990 { 00991 image_.animationDelay( _delay ); 00992 } 00993 00994 // Number of iterations to loop an animation (e.g. Netscape loop 00995 // extension) for. 00996 Magick::animationIterationsImage::animationIterationsImage( const unsigned int iterations_ ) 00997 : _iterations( iterations_ ) 00998 { 00999 } 01000 void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const 01001 { 01002 image_.animationIterations( _iterations ); 01003 } 01004 01005 // Image background color 01006 Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ ) 01007 : _color( color_ ) 01008 { 01009 } 01010 void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const 01011 { 01012 image_.backgroundColor( _color ); 01013 } 01014 01015 // Name of texture image to tile onto the image background 01016 Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ ) 01017 : _backgroundTexture( backgroundTexture_ ) 01018 { 01019 } 01020 void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const 01021 { 01022 image_.backgroundTexture( _backgroundTexture ); 01023 } 01024 01025 // Image border color 01026 Magick::borderColorImage::borderColorImage( const Magick::Color &color_ ) 01027 : _color( color_ ) 01028 { 01029 } 01030 void Magick::borderColorImage::operator()( Magick::Image &image_ ) const 01031 { 01032 image_.borderColor( _color ); 01033 } 01034 01035 // Text bounding-box base color (default none) 01036 Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ ) 01037 : _boxColor( boxColor_ ) { } 01038 01039 void Magick::boxColorImage::operator()( Magick::Image &image_ ) const 01040 { 01041 image_.boxColor( _boxColor ); 01042 } 01043 01044 // Chromaticity blue primary point (e.g. x=0.15, y=0.06) 01045 Magick::chromaBluePrimaryImage::chromaBluePrimaryImage( const double x_, 01046 const double y_ ) 01047 : _x( x_ ), 01048 _y( y_ ) 01049 { 01050 } 01051 void Magick::chromaBluePrimaryImage::operator()( Magick::Image &image_ ) const 01052 { 01053 image_.chromaBluePrimary( _x, _y ); 01054 } 01055 01056 // Chromaticity green primary point (e.g. x=0.3, y=0.6) 01057 Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage( const double x_, 01058 const double y_ ) 01059 : _x( x_ ), 01060 _y( y_ ) 01061 { 01062 } 01063 void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const 01064 { 01065 image_.chromaGreenPrimary( _x, _y ); 01066 } 01067 01068 // Chromaticity red primary point (e.g. x=0.64, y=0.33) 01069 Magick::chromaRedPrimaryImage::chromaRedPrimaryImage( const double x_, 01070 const double y_ ) 01071 : _x( x_ ), 01072 _y( y_ ) 01073 { 01074 } 01075 void Magick::chromaRedPrimaryImage::operator()( Magick::Image &image_ ) const 01076 { 01077 image_.chromaRedPrimary( _x, _y ); 01078 } 01079 01080 // Chromaticity white point (e.g. x=0.3127, y=0.329) 01081 Magick::chromaWhitePointImage::chromaWhitePointImage( const double x_, 01082 const double y_ ) 01083 : _x( x_ ), 01084 _y( y_ ) 01085 { 01086 } 01087 void Magick::chromaWhitePointImage::operator()( Magick::Image &image_ ) const 01088 { 01089 image_.chromaWhitePoint( _x, _y ); 01090 } 01091 01092 // Colors within this distance are considered equal 01093 Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ ) 01094 : _fuzz( fuzz_ ) 01095 { 01096 } 01097 void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const 01098 { 01099 image_.colorFuzz( _fuzz ); 01100 } 01101 01102 // Color at colormap position index_ 01103 Magick::colorMapImage::colorMapImage( const unsigned int index_, 01104 const Color &color_ ) 01105 : _index( index_ ), 01106 _color( color_ ) 01107 { 01108 } 01109 void Magick::colorMapImage::operator()( Magick::Image &image_ ) const 01110 { 01111 image_.colorMap( _index, _color ); 01112 } 01113 01114 // Composition operator to be used when composition is implicitly used 01115 // (such as for image flattening). 01116 Magick::composeImage::composeImage( const CompositeOperator compose_ ) 01117 : _compose( compose_ ) 01118 { 01119 } 01120 void Magick::composeImage::operator()( Magick::Image &image_ ) const 01121 { 01122 image_.compose( _compose ); 01123 } 01124 01125 // Compression type 01126 Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ ) 01127 : _compressType( compressType_ ) 01128 { 01129 } 01130 void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const 01131 { 01132 image_.compressType( _compressType ); 01133 } 01134 01135 // Vertical and horizontal resolution in pixels of the image 01136 Magick::densityImage::densityImage( const Geometry &geomery_ ) 01137 : _geomery( geomery_ ) 01138 { 01139 } 01140 void Magick::densityImage::operator()( Magick::Image &image_ ) const 01141 { 01142 image_.density( _geomery ); 01143 } 01144 01145 // Image depth (bits allocated to red/green/blue components) 01146 Magick::depthImage::depthImage( const unsigned int depth_ ) 01147 : _depth( depth_ ) 01148 { 01149 } 01150 void Magick::depthImage::operator()( Magick::Image &image_ ) const 01151 { 01152 image_.depth( _depth ); 01153 } 01154 01155 // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image 01156 // formats which support endian-specific options. 01157 Magick::endianImage::endianImage( const Magick::EndianType endian_ ) 01158 : _endian( endian_ ) 01159 { 01160 } 01161 void Magick::endianImage::operator()( Magick::Image &image_ ) const 01162 { 01163 image_.endian( _endian ); 01164 } 01165 01166 // Image file name 01167 Magick::fileNameImage::fileNameImage( const std::string &fileName_ ) 01168 : _fileName( fileName_ ) 01169 { 01170 } 01171 void Magick::fileNameImage::operator()( Magick::Image &image_ ) const 01172 { 01173 image_.fileName( _fileName ); 01174 } 01175 01176 // Filter to use when resizing image 01177 Magick::filterTypeImage::filterTypeImage( const FilterTypes filterType_ ) 01178 : _filterType( filterType_ ) 01179 { 01180 } 01181 void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const 01182 { 01183 image_.filterType( _f