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