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