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