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