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