1 // This may look like C code, but it is really -*- C++ -*-
2 //
3 // Copyright Bob Friesenhahn, 1999, 2002
4 // Copyright Dirk Lemstra 2013-2016
5 //
6 // Implementation of STL classes and functions
7 //
8
9 #define MAGICKCORE_IMPLEMENTATION 1
10 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
11
12 #include <Magick++/Functions.h>
13 #include <Magick++/Image.h>
14 #include <Magick++/STL.h>
15
16 // Adaptive-blur image with specified blur factor
adaptiveBlurImage(const double radius_,const double sigma_)17 Magick::adaptiveBlurImage::adaptiveBlurImage( const double radius_,
18 const double sigma_ )
19 : _radius( radius_ ),
20 _sigma( sigma_ )
21 {
22 }
operator ()(Magick::Image & image_) const23 void Magick::adaptiveBlurImage::operator()( Magick::Image &image_ ) const
24 {
25 image_.adaptiveBlur( _radius, _sigma );
26 }
27
28 // Local adaptive threshold image
adaptiveThresholdImage(const size_t width_,const size_t height_,const ssize_t offset_)29 Magick::adaptiveThresholdImage::adaptiveThresholdImage( const size_t width_,
30 const size_t height_,
31 const ssize_t offset_ )
32 : _width(width_),
33 _height(height_),
34 _offset(offset_)
35 {
36 }
operator ()(Magick::Image & image_) const37 void Magick::adaptiveThresholdImage::operator()( Magick::Image &image_ ) const
38 {
39 image_.adaptiveThreshold( _width, _height, _offset );
40 }
41
42 // Add noise to image with specified noise type
addNoiseImage(Magick::NoiseType noiseType_)43 Magick::addNoiseImage::addNoiseImage( Magick::NoiseType noiseType_ )
44 : _noiseType( noiseType_ )
45 {
46 }
operator ()(Magick::Image & image_) const47 void Magick::addNoiseImage::operator()( Magick::Image &image_ ) const
48 {
49 image_.addNoise( _noiseType );
50 }
51
52 // Transform image by specified affine (or free transform) matrix.
affineTransformImage(const DrawableAffine & affine_)53 Magick::affineTransformImage::affineTransformImage( const DrawableAffine &affine_ )
54 : _affine( affine_ )
55 {
56 }
operator ()(Magick::Image & image_) const57 void 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
annotateImage(const std::string & text_,const Magick::Geometry & geometry_)65 Magick::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
annotateImage(const std::string & text_,const Magick::Geometry & geometry_,const Magick::GravityType gravity_)74 Magick::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.
annotateImage(const std::string & text_,const Magick::Geometry & geometry_,const Magick::GravityType gravity_,const double degrees_)85 Magick::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.
annotateImage(const std::string & text_,const Magick::GravityType gravity_)97 Magick::annotateImage::annotateImage ( const std::string &text_,
98 const Magick::GravityType gravity_ )
99 : _text( text_ ),
100 _geometry( ),
101 _gravity( gravity_ ),
102 _degrees( 0 )
103 {
104 }
operator ()(Magick::Image & image_) const105 void Magick::annotateImage::operator()( Magick::Image &image_ ) const
106 {
107 image_.annotate( _text, _geometry, _gravity, _degrees );
108 }
109
110 // Blur image with specified blur factor
blurImage(const double radius_,const double sigma_)111 Magick::blurImage::blurImage( const double radius_, const double sigma_ )
112 : _radius( radius_ ),
113 _sigma( sigma_ )
114 {
115 }
operator ()(Magick::Image & image_) const116 void Magick::blurImage::operator()( Magick::Image &image_ ) const
117 {
118 image_.blur( _radius, _sigma );
119 }
120
121 // Border image (add border to image)
borderImage(const Magick::Geometry & geometry_)122 Magick::borderImage::borderImage( const Magick::Geometry &geometry_ )
123 : _geometry( geometry_ )
124 {
125 }
operator ()(Magick::Image & image_) const126 void Magick::borderImage::operator()( Magick::Image &image_ ) const
127 {
128 image_.border( _geometry );
129 }
130
131 // Extract channel from image
channelImage(const Magick::ChannelType channel_)132 Magick::channelImage::channelImage( const Magick::ChannelType channel_ )
133 : _channel( channel_ )
134 {
135 }
operator ()(Magick::Image & image_) const136 void Magick::channelImage::operator()( Magick::Image &image_ ) const
137 {
138 image_.channel( _channel );
139 }
140
141 // Charcoal effect image (looks like charcoal sketch)
charcoalImage(const double radius_,const double sigma_)142 Magick::charcoalImage::charcoalImage( const double radius_, const double sigma_ )
143 : _radius( radius_ ),
144 _sigma( sigma_ )
145 {
146 }
operator ()(Magick::Image & image_) const147 void 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)
chopImage(const Magick::Geometry & geometry_)153 Magick::chopImage::chopImage( const Magick::Geometry &geometry_ )
154 : _geometry( geometry_ )
155 {
156 }
operator ()(Magick::Image & image_) const157 void 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.
cdlImage(const std::string & cdl_)165 Magick::cdlImage::cdlImage( const std::string &cdl_ )
166 : _cdl ( cdl_ )
167 {
168 }
operator ()(Image & image_) const169 void 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
colorizeImage(const unsigned int alphaRed_,const unsigned int alphaGreen_,const unsigned int alphaBlue_,const Magick::Color & penColor_)175 Magick::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 }
colorizeImage(const unsigned int alpha_,const Magick::Color & penColor_)185 Magick::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 }
operator ()(Magick::Image & image_) const193 void 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).
colorMatrixImage(const size_t order_,const double * color_matrix_)200 Magick::colorMatrixImage::colorMatrixImage( const size_t order_,
201 const double *color_matrix_ )
202 : _order( order_ ),
203 _color_matrix( color_matrix_ )
204 {
205 }
operator ()(Image & image_) const206 void Magick::colorMatrixImage::operator()( Image &image_ ) const
207 {
208 image_.colorMatrix( _order, _color_matrix );
209 }
210
211 // Convert the image colorspace representation
colorSpaceImage(Magick::ColorspaceType colorSpace_)212 Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ )
213 : _colorSpace( colorSpace_ )
214 {
215 }
operator ()(Magick::Image & image_) const216 void Magick::colorSpaceImage::operator()( Magick::Image &image_ ) const
217 {
218 image_.colorSpace( _colorSpace );
219 }
220
221 // Comment image (add comment string to image)
commentImage(const std::string & comment_)222 Magick::commentImage::commentImage( const std::string &comment_ )
223 : _comment( comment_ )
224 {
225 }
operator ()(Magick::Image & image_) const226 void 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
compositeImage(const Magick::Image & compositeImage_,ssize_t xOffset_,ssize_t yOffset_,Magick::CompositeOperator compose_)233 Magick::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 }
compositeImage(const Magick::Image & compositeImage_,const Magick::Geometry & offset_,Magick::CompositeOperator compose_)243 Magick::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 }
operator ()(Image & image_) const252 void Magick::compositeImage::operator()( Image &image_ ) const
253 {
254 image_.composite( _compositeImage, _xOffset, _yOffset, _compose );
255 }
256
257 // Contrast image (enhance intensity differences in image)
contrastImage(const size_t sharpen_)258 Magick::contrastImage::contrastImage( const size_t sharpen_ )
259 : _sharpen( sharpen_ )
260 {
261 }
operator ()(Magick::Image & image_) const262 void Magick::contrastImage::operator()( Magick::Image &image_ ) const
263 {
264 image_.contrast( _sharpen );
265 }
266
267 // Crop image (subregion of original image)
cropImage(const Magick::Geometry & geometry_)268 Magick::cropImage::cropImage( const Magick::Geometry &geometry_ )
269 : _geometry( geometry_ )
270 {
271 }
operator ()(Magick::Image & image_) const272 void Magick::cropImage::operator()( Magick::Image &image_ ) const
273 {
274 image_.crop( _geometry );
275 }
276
277 // Cycle image colormap
cycleColormapImage(const ssize_t amount_)278 Magick::cycleColormapImage::cycleColormapImage( const ssize_t amount_ )
279 : _amount( amount_ )
280 {
281 }
operator ()(Magick::Image & image_) const282 void Magick::cycleColormapImage::operator()( Magick::Image &image_ ) const
283 {
284 image_.cycleColormap( _amount );
285 }
286
287 // Despeckle image (reduce speckle noise)
despeckleImage(void)288 Magick::despeckleImage::despeckleImage( void )
289 {
290 }
operator ()(Magick::Image & image_) const291 void 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.
distortImage(const Magick::DistortMethod method_,const size_t number_arguments_,const double * arguments_,const bool bestfit_)300 Magick::distortImage::distortImage( const Magick::DistortMethod 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 }
distortImage(const Magick::DistortMethod method_,const size_t number_arguments_,const double * arguments_)310 Magick::distortImage::distortImage( const Magick::DistortMethod 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 }
operator ()(Magick::Image & image_) const319 void Magick::distortImage::operator()( Magick::Image &image_ ) const
320 {
321 image_.distort( _method, _number_arguments, _arguments, _bestfit );
322 }
323
324 // Draw on image
drawImage(const Magick::Drawable & drawable_)325 Magick::drawImage::drawImage( const Magick::Drawable &drawable_ )
326 : _drawableList()
327 {
328 _drawableList.push_back( drawable_ );
329 }
drawImage(const std::vector<Magick::Drawable> & drawable_)330 Magick::drawImage::drawImage( const std::vector<Magick::Drawable> &drawable_ )
331 : _drawableList( drawable_ )
332 {
333 }
operator ()(Magick::Image & image_) const334 void Magick::drawImage::operator()( Magick::Image &image_ ) const
335 {
336 image_.draw( _drawableList );
337 }
338
339 // Edge image (hilight edges in image)
edgeImage(const double radius_)340 Magick::edgeImage::edgeImage( const double radius_ )
341 : _radius( radius_ )
342 {
343 }
operator ()(Magick::Image & image_) const344 void Magick::edgeImage::operator()( Magick::Image &image_ ) const
345 {
346 image_.edge( _radius );
347 }
348
349 // Emboss image (hilight edges with 3D effect)
embossImage(void)350 Magick::embossImage::embossImage( void )
351 : _radius( 1 ),
352 _sigma( 0.5 )
353 {
354 }
embossImage(const double radius_,const double sigma_)355 Magick::embossImage::embossImage( const double radius_, const double sigma_ )
356 : _radius( radius_ ),
357 _sigma( sigma_ )
358 {
359 }
operator ()(Magick::Image & image_) const360 void Magick::embossImage::operator()( Magick::Image &image_ ) const
361 {
362 image_.emboss( _radius, _sigma );
363 }
364
365 // Enhance image (minimize noise)
enhanceImage(void)366 Magick::enhanceImage::enhanceImage( void )
367 {
368 }
operator ()(Magick::Image & image_) const369 void Magick::enhanceImage::operator()( Magick::Image &image_ ) const
370 {
371 image_.enhance( );
372 }
373
374 // Equalize image (histogram equalization)
equalizeImage(void)375 Magick::equalizeImage::equalizeImage( void )
376 {
377 }
operator ()(Magick::Image & image_) const378 void Magick::equalizeImage::operator()( Magick::Image &image_ ) const
379 {
380 image_.equalize( );
381 }
382
383 // Color to use when filling drawn objects
fillColorImage(const Magick::Color & fillColor_)384 Magick::fillColorImage::fillColorImage( const Magick::Color &fillColor_ )
385 : _fillColor( fillColor_ )
386 {
387 }
operator ()(Magick::Image & image_) const388 void Magick::fillColorImage::operator()( Magick::Image &image_ ) const
389 {
390 image_.fillColor( _fillColor );
391 }
392
393 // Flip image (reflect each scanline in the vertical direction)
flipImage(void)394 Magick::flipImage::flipImage( void )
395 {
396 }
operator ()(Magick::Image & image_) const397 void Magick::flipImage::operator()( Magick::Image &image_ ) const
398 {
399 image_.flip( );
400 }
401
floodFillAlphaImage(const ssize_t x_,const ssize_t y_,const unsigned int alpha_,const Color & target_,const bool invert_)402 Magick::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
operator ()(Magick::Image & image_) const413 void Magick::floodFillAlphaImage::operator()(Magick::Image &image_) const
414 {
415 image_.floodFillAlpha(_x,_y,_alpha,_target,_invert);
416 }
417
floodFillColorImage(const ssize_t x_,const ssize_t y_,const Magick::Color & fillColor_,const bool invert_)418 Magick::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
floodFillColorImage(const Magick::Geometry & point_,const Magick::Color & fillColor_,const bool invert_)428 Magick::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
floodFillColorImage(const ssize_t x_,const ssize_t y_,const Magick::Color & fillColor_,const Magick::Color & borderColor_,const bool invert_)439 Magick::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
floodFillColorImage(const Geometry & point_,const Color & fillColor_,const Color & borderColor_,const bool invert_)450 Magick::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 }
operator ()(Magick::Image & image_) const459 void 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
floodFillTextureImage(const ssize_t x_,const ssize_t y_,const Magick::Image & texture_,const bool invert_)467 Magick::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
floodFillTextureImage(const Magick::Geometry & point_,const Magick::Image & texture_,const bool invert_)477 Magick::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
floodFillTextureImage(const ssize_t x_,const ssize_t y_,const Magick::Image & texture_,const Magick::Color & borderColor_,const bool invert_)488 Magick::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
floodFillTextureImage(const Magick::Geometry & point_,const Magick::Image & texture_,const Magick::Color & borderColor_,const bool invert_)499 Magick::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
operator ()(Magick::Image & image_) const510 void 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)
flopImage(void)519 Magick::flopImage::flopImage( void )
520 {
521 }
operator ()(Magick::Image & image_) const522 void Magick::flopImage::operator()( Magick::Image &image_ ) const
523 {
524 image_.flop( );
525 }
526
527 // Frame image
frameImage(const Magick::Geometry & geometry_)528 Magick::frameImage::frameImage( const Magick::Geometry &geometry_ )
529 : _width( geometry_.width() ),
530 _height( geometry_.height() ),
531 _outerBevel( geometry_.xOff() ),
532 _innerBevel( geometry_.yOff() )
533 {
534 }
frameImage(const size_t width_,const size_t height_,const ssize_t innerBevel_,const ssize_t outerBevel_)535 Magick::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 }
operator ()(Magick::Image & image_) const543 void Magick::frameImage::operator()( Magick::Image &image_ ) const
544 {
545 image_.frame( _width, _height, _innerBevel, _outerBevel );
546 }
547
548 // Gamma correct image
gammaImage(const double gamma_)549 Magick::gammaImage::gammaImage( const double gamma_ )
550 : _gammaRed( gamma_ ),
551 _gammaGreen( gamma_ ),
552 _gammaBlue( gamma_ )
553 {
554 }
gammaImage(const double gammaRed_,const double gammaGreen_,const double gammaBlue_)555 Magick::gammaImage::gammaImage ( const double gammaRed_,
556 const double gammaGreen_,
557 const double gammaBlue_ )
558 : _gammaRed( gammaRed_ ),
559 _gammaGreen( gammaGreen_ ),
560 _gammaBlue( gammaBlue_ )
561 {
562 }
operator ()(Magick::Image & image_) const563 void 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_'.
gaussianBlurImage(const double width_,const double sigma_)572 Magick::gaussianBlurImage::gaussianBlurImage( const double width_,
573 const double sigma_ )
574 : _width( width_ ),
575 _sigma( sigma_ )
576 {
577 }
operator ()(Magick::Image & image_) const578 void 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.
haldClutImage(const Image & haldClutImage_)584 Magick::haldClutImage::haldClutImage( const Image &haldClutImage_ )
585 : _haldClutImage ( haldClutImage_ )
586 {
587 }
operator ()(Image & image_) const588 void Magick::haldClutImage::operator()( Image &image_ ) const
589 {
590 image_.haldClut( _haldClutImage );
591 }
592
593 // Implode image (special effect)
implodeImage(const double factor_)594 Magick::implodeImage::implodeImage( const double factor_ )
595 : _factor( factor_ )
596 {
597 }
operator ()(Magick::Image & image_) const598 void 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.
inverseFourierTransformImage(const Magick::Image & phaseImage_)605 Magick::inverseFourierTransformImage::inverseFourierTransformImage( const Magick::Image &phaseImage_ )
606 : _phaseImage( phaseImage_ )
607 {
608 }
operator ()(Magick::Image & image_) const609 void 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.
isValidImage(const bool isValid_)616 Magick::isValidImage::isValidImage( const bool isValid_ )
617 : _isValid( isValid_ )
618 {
619 }
operator ()(Magick::Image & image_) const620 void Magick::isValidImage::operator()( Magick::Image &image_ ) const
621 {
622 image_.isValid( _isValid );
623 }
624
625 // Label image
labelImage(const std::string & label_)626 Magick::labelImage::labelImage( const std::string &label_ )
627 : _label( label_ )
628 {
629 }
operator ()(Magick::Image & image_) const630 void Magick::labelImage::operator()( Magick::Image &image_ ) const
631 {
632 image_.label( _label );
633 }
634
635 // Level image
levelImage(const double black_point,const double white_point,const double mid_point)636 Magick::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 }
operator ()(Magick::Image & image_) const644 void 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
magnifyImage(void)650 Magick::magnifyImage::magnifyImage( void )
651 {
652 }
operator ()(Magick::Image & image_) const653 void Magick::magnifyImage::operator()( Magick::Image &image_ ) const
654 {
655 image_.magnify( );
656 }
657
658 // Remap image colors with closest color from reference image
mapImage(const Magick::Image & mapImage_,const bool dither_)659 Magick::mapImage::mapImage( const Magick::Image &mapImage_ ,
660 const bool dither_ )
661 : _mapImage( mapImage_ ),
662 _dither( dither_ )
663 {
664 }
operator ()(Magick::Image & image_) const665 void 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
medianConvolveImage(const double radius_)672 Magick::medianConvolveImage::medianConvolveImage( const double radius_ )
673 : _radius( radius_ )
674 {
675 }
operator ()(Magick::Image & image_) const676 void Magick::medianConvolveImage::operator()( Magick::Image &image_ ) const
677 {
678 image_.medianFilter( _radius );
679 }
680
681 // Reduce image by integral size
minifyImage(void)682 Magick::minifyImage::minifyImage( void )
683 {
684 }
operator ()(Magick::Image & image_) const685 void Magick::minifyImage::operator()( Magick::Image &image_ ) const
686 {
687 image_.minify( );
688 }
689
690 // Modulate percent hue, saturation, and brightness of an image
modulateImage(const double brightness_,const double saturation_,const double hue_)691 Magick::modulateImage::modulateImage( const double brightness_,
692 const double saturation_,
693 const double hue_ )
694 : _brightness( brightness_ ),
695 _saturation( saturation_ ),
696 _hue( hue_ )
697 {
698 }
operator ()(Magick::Image & image_) const699 void 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.
negateImage(const bool grayscale_)706 Magick::negateImage::negateImage( const bool grayscale_ )
707 : _grayscale( grayscale_ )
708 {
709 }
operator ()(Magick::Image & image_) const710 void 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)
normalizeImage(void)717 Magick::normalizeImage::normalizeImage( void )
718 {
719 }
operator ()(Magick::Image & image_) const720 void Magick::normalizeImage::operator()( Magick::Image &image_ ) const
721 {
722 image_.normalize( );
723 }
724
725 // Oilpaint image (image looks like oil painting)
oilPaintImage(const double radius_)726 Magick::oilPaintImage::oilPaintImage( const double radius_ )
727 : _radius( radius_ )
728 {
729 }
operator ()(Magick::Image & image_) const730 void 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.
alphaImage(const unsigned int alpha_)741 Magick::alphaImage::alphaImage( const unsigned int alpha_ )
742 : _alpha( alpha_ )
743 {
744 }
operator ()(Magick::Image & image_) const745 void Magick::alphaImage::operator()( Magick::Image &image_ ) const
746 {
747 image_.alpha( _alpha );
748 }
749
750 // Change color of opaque pixel to specified pen color.
opaqueImage(const Magick::Color & opaqueColor_,const Magick::Color & penColor_)751 Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_,
752 const Magick::Color &penColor_ )
753 : _opaqueColor( opaqueColor_ ),
754 _penColor( penColor_ )
755 {
756 }
operator ()(Magick::Image & image_) const757 void Magick::opaqueImage::operator()( Magick::Image &image_ ) const
758 {
759 image_.opaque( _opaqueColor, _penColor );
760 }
761
762 // Quantize image (reduce number of colors)
quantizeImage(const bool measureError_)763 Magick::quantizeImage::quantizeImage( const bool measureError_ )
764 : _measureError( measureError_ )
765 {
766 }
operator ()(Image & image_) const767 void 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)
raiseImage(const Magick::Geometry & geometry_,const bool raisedFlag_)774 Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ ,
775 const bool raisedFlag_ )
776 : _geometry( geometry_ ),
777 _raisedFlag( raisedFlag_ )
778 {
779 }
operator ()(Magick::Image & image_) const780 void Magick::raiseImage::operator()( Magick::Image &image_ ) const
781 {
782 image_.raise( _geometry, _raisedFlag );
783 }
784
ReadOptions(void)785 Magick::ReadOptions::ReadOptions(void)
786 : _imageInfo(static_cast<ImageInfo*>(AcquireMagickMemory(
787 sizeof(ImageInfo)))),
788 _quiet(false)
789 {
790 GetImageInfo(_imageInfo);
791 }
792
ReadOptions(const Magick::ReadOptions & options_)793 Magick::ReadOptions::ReadOptions(const Magick::ReadOptions& options_)
794 : _imageInfo(CloneImageInfo(options_._imageInfo)),
795 _quiet(false)
796 {
797 }
798
~ReadOptions()799 Magick::ReadOptions::~ReadOptions()
800 {
801 _imageInfo=DestroyImageInfo(_imageInfo);
802 }
803
density(const Magick::Geometry & density_)804 void 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
density(void) const812 Magick::Geometry Magick::ReadOptions::density(void) const
813 {
814 if (_imageInfo->density)
815 return(Geometry(_imageInfo->density));
816
817 return(Geometry());
818 }
819
depth(size_t depth_)820 void Magick::ReadOptions::depth(size_t depth_)
821 {
822 _imageInfo->depth=depth_;
823 }
824
depth(void) const825 size_t Magick::ReadOptions::depth(void) const
826 {
827 return(_imageInfo->depth);
828 }
829
size(const Geometry & geometry_)830 void 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
size(void) const838 Magick::Geometry Magick::ReadOptions::size(void) const
839 {
840 if (_imageInfo->size)
841 return(Geometry(_imageInfo->size));
842
843 return(Geometry());
844 }
845
quiet(const bool quiet_)846 void Magick::ReadOptions::quiet(const bool quiet_)
847 {
848 _quiet=quiet_;
849 }
850
quiet(void) const851 bool Magick::ReadOptions::quiet(void) const
852 {
853 return(_quiet);
854 }
855
imageInfo(void)856 MagickCore::ImageInfo *Magick::ReadOptions::imageInfo(void)
857 {
858 return(_imageInfo);
859 }
860
861 // Reduce noise in image using a noise peak elimination filter
reduceNoiseImage(void)862 Magick::reduceNoiseImage::reduceNoiseImage( void )
863 : _order(3)
864 {
865 }
reduceNoiseImage(const size_t order_)866 Magick::reduceNoiseImage::reduceNoiseImage ( const size_t order_ )
867 : _order(order_)
868 {
869 }
operator ()(Image & image_) const870 void 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)
rollImage(const Magick::Geometry & roll_)877 Magick::rollImage::rollImage( const Magick::Geometry &roll_ )
878 : _columns( roll_.width() ),
879 _rows( roll_.height() )
880 {
881 }
rollImage(const ssize_t columns_,const ssize_t rows_)882 Magick::rollImage::rollImage( const ssize_t columns_,
883 const ssize_t rows_ )
884 : _columns( columns_ ),
885 _rows( rows_ )
886 {
887 }
operator ()(Magick::Image & image_) const888 void 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.
rotateImage(const double degrees_)894 Magick::rotateImage::rotateImage( const double degrees_ )
895 : _degrees( degrees_ )
896 {
897 }
operator ()(Magick::Image & image_) const898 void Magick::rotateImage::operator()( Magick::Image &image_ ) const
899 {
900 image_.rotate( _degrees );
901 }
902
903 // Resize image by using pixel sampling algorithm
sampleImage(const Magick::Geometry & geometry_)904 Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ )
905 : _geometry( geometry_ )
906 {
907 }
operator ()(Magick::Image & image_) const908 void Magick::sampleImage::operator()( Magick::Image &image_ ) const
909 {
910 image_.sample( _geometry );
911 }
912
913 // Resize image by using simple ratio algorithm
scaleImage(const Magick::Geometry & geometry_)914 Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ )
915 : _geometry( geometry_ )
916 {
917 }
operator ()(Magick::Image & image_) const918 void 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
segmentImage(const double clusterThreshold_,const double smoothingThreshold_)927 Magick::segmentImage::segmentImage( const double clusterThreshold_ ,
928 const double smoothingThreshold_ )
929 : _clusterThreshold( clusterThreshold_ ),
930 _smoothingThreshold( smoothingThreshold_ )
931 {
932 }
operator ()(Magick::Image & image_) const933 void Magick::segmentImage::operator()( Magick::Image &image_ ) const
934 {
935 image_.segment( _clusterThreshold, _smoothingThreshold );
936 }
937
938 // Shade image using distant light source
shadeImage(const double azimuth_,const double elevation_,const bool colorShading_)939 Magick::shadeImage::shadeImage( const double azimuth_,
940 const double elevation_,
941 const bool colorShading_)
942 : _azimuth( azimuth_ ),
943 _elevation( elevation_ ),
944 _colorShading (colorShading_)
945 {
946 }
operator ()(Magick::Image & image_) const947 void Magick::shadeImage::operator()( Magick::Image &image_ ) const
948 {
949 image_.shade( _azimuth, _elevation, _colorShading );
950 }
951
952 // Simulate an image shadow
shadowImage(const double percent_opacity_,const double sigma_,const ssize_t x_,const ssize_t y_)953 Magick::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 }
operator ()(Magick::Image & image_) const962 void Magick::shadowImage::operator()( Magick::Image &image_ ) const
963 {
964 image_.shadow( _percent_opacity, _sigma, _x, _y );
965 }
966
967 // Sharpen pixels in image
sharpenImage(const double radius_,const double sigma_)968 Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ )
969 : _radius( radius_ ),
970 _sigma( sigma_ )
971 {
972 }
operator ()(Magick::Image & image_) const973 void Magick::sharpenImage::operator()( Magick::Image &image_ ) const
974 {
975 image_.sharpen( _radius, _sigma );
976 }
977
978 // Shave pixels from image edges.
shaveImage(const Magick::Geometry & geometry_)979 Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ )
980 : _geometry( geometry_ )
981 {
982 }
operator ()(Magick::Image & image_) const983 void 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)
shearImage(const double xShearAngle_,const double yShearAngle_)989 Magick::shearImage::shearImage( const double xShearAngle_,
990 const double yShearAngle_ )
991 : _xShearAngle( xShearAngle_ ),
992 _yShearAngle( yShearAngle_ )
993 {
994 }
operator ()(Magick::Image & image_) const995 void 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)
solarizeImage(const double factor_)1002 Magick::solarizeImage::solarizeImage( const double factor_ )
1003 : _factor( factor_ )
1004 {
1005 }
operator ()(Magick::Image & image_) const1006 void Magick::solarizeImage::operator()( Magick::Image &image_ ) const
1007 {
1008 image_.solarize( _factor );
1009 }
1010
1011 // Spread pixels randomly within image by specified ammount
spreadImage(const size_t amount_)1012 Magick::spreadImage::spreadImage( const size_t amount_ )
1013 : _amount( amount_ )
1014 {
1015 }
operator ()(Magick::Image & image_) const1016 void 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)
steganoImage(const Magick::Image & waterMark_)1022 Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ )
1023 : _waterMark( waterMark_ )
1024 {
1025 }
operator ()(Magick::Image & image_) const1026 void 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)
stereoImage(const Magick::Image & rightImage_)1033 Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ )
1034 : _rightImage( rightImage_ )
1035 {
1036 }
operator ()(Magick::Image & image_) const1037 void Magick::stereoImage::operator()( Magick::Image &image_ ) const
1038 {
1039 image_.stereo( _rightImage );
1040 }
1041
1042 // Color to use when drawing object outlines
strokeColorImage(const Magick::Color & strokeColor_)1043 Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ )
1044 : _strokeColor( strokeColor_ )
1045 {
1046 }
operator ()(Magick::Image & image_) const1047 void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const
1048 {
1049 image_.strokeColor( _strokeColor );
1050 }
1051
1052 // Swirl image (image pixels are rotated by degrees)
swirlImage(const double degrees_)1053 Magick::swirlImage::swirlImage( const double degrees_ )
1054 : _degrees( degrees_ )
1055 {
1056 }
operator ()(Magick::Image & image_) const1057 void Magick::swirlImage::operator()( Magick::Image &image_ ) const
1058 {
1059 image_.swirl( _degrees );
1060 }
1061
1062 // Channel a texture on image background
textureImage(const Magick::Image & texture_)1063 Magick::textureImage::textureImage( const Magick::Image &texture_ )
1064 : _texture( texture_ )
1065 {
1066 }
operator ()(Magick::Image & image_) const1067 void Magick::textureImage::operator()( Magick::Image &image_ ) const
1068 {
1069 image_.texture( _texture );
1070 }
1071
1072 // Threshold image
thresholdImage(const double threshold_)1073 Magick::thresholdImage::thresholdImage( const double threshold_ )
1074 : _threshold( threshold_ )
1075 {
1076 }
operator ()(Magick::Image & image_) const1077 void Magick::thresholdImage::operator()( Magick::Image &image_ ) const
1078 {
1079 image_.threshold( _threshold );
1080 }
1081
1082 // Set image color to transparent
transparentImage(const Magick::Color & color_)1083 Magick::transparentImage::transparentImage( const Magick::Color& color_ )
1084 : _color( color_ )
1085 {
1086 }
operator ()(Magick::Image & image_) const1087 void Magick::transparentImage::operator()( Magick::Image &image_ ) const
1088 {
1089 image_.transparent( _color );
1090 }
1091
1092 // Trim edges that are the background color from the image
trimImage(void)1093 Magick::trimImage::trimImage( void )
1094 {
1095 }
operator ()(Magick::Image & image_) const1096 void Magick::trimImage::operator()( Magick::Image &image_ ) const
1097 {
1098 image_.trim( );
1099 }
1100
1101 // Map image pixels to a sine wave
waveImage(const double amplitude_,const double wavelength_)1102 Magick::waveImage::waveImage( const double amplitude_,
1103 const double wavelength_ )
1104 : _amplitude( amplitude_ ),
1105 _wavelength( wavelength_ )
1106 {
1107 }
operator ()(Magick::Image & image_) const1108 void Magick::waveImage::operator()( Magick::Image &image_ ) const
1109 {
1110 image_.wave( _amplitude, _wavelength );
1111 }
1112
1113 // resize image to specified size.
resizeImage(const Magick::Geometry & geometry_)1114 Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ )
1115 : _geometry( geometry_ )
1116 {
1117 }
operator ()(Magick::Image & image_) const1118 void Magick::resizeImage::operator()( Magick::Image &image_ ) const
1119 {
1120 image_.resize( _geometry );
1121 }
1122
1123 // Zoom image to specified size.
zoomImage(const Magick::Geometry & geometry_)1124 Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ )
1125 : _geometry( geometry_ )
1126 {
1127 }
operator ()(Magick::Image & image_) const1128 void Magick::zoomImage::operator()( Magick::Image &image_ ) const
1129 {
1130 image_.zoom( _geometry );
1131 }
1132
1133 //
1134 // Function object image attribute accessors
1135 //
1136
1137 // Join images into a single multi-image file
adjoinImage(const bool flag_)1138 Magick::adjoinImage::adjoinImage( const bool flag_ )
1139 : _flag( flag_ )
1140 {
1141 }
operator ()(Magick::Image & image_) const1142 void Magick::adjoinImage::operator()( Magick::Image &image_ ) const
1143 {
1144 image_.adjoin( _flag );
1145 }
1146
1147 // Time in 1/100ths of a second which must expire before displaying
1148 // the next image in an animated sequence.
animationDelayImage(const size_t delay_)1149 Magick::animationDelayImage::animationDelayImage( const size_t delay_ )
1150 : _delay( delay_ )
1151 {
1152 }
operator ()(Magick::Image & image_) const1153 void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const
1154 {
1155 image_.animationDelay( _delay );
1156 }
1157
1158 // Number of iterations to loop an animation (e.g. Netscape loop
1159 // extension) for.
animationIterationsImage(const size_t iterations_)1160 Magick::animationIterationsImage::animationIterationsImage( const size_t iterations_ )
1161 : _iterations( iterations_ )
1162 {
1163 }
operator ()(Magick::Image & image_) const1164 void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const
1165 {
1166 image_.animationIterations( _iterations );
1167 }
1168
1169 // Image background color
backgroundColorImage(const Magick::Color & color_)1170 Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ )
1171 : _color( color_ )
1172 {
1173 }
operator ()(Magick::Image & image_) const1174 void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const
1175 {
1176 image_.backgroundColor( _color );
1177 }
1178
1179 // Name of texture image to tile onto the image background
backgroundTextureImage(const std::string & backgroundTexture_)1180 Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ )
1181 : _backgroundTexture( backgroundTexture_ )
1182 {
1183 }
operator ()(Magick::Image & image_) const1184 void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const
1185 {
1186 image_.backgroundTexture( _backgroundTexture );
1187 }
1188
1189 // Image border color
borderColorImage(const Magick::Color & color_)1190 Magick::borderColorImage::borderColorImage( const Magick::Color &color_ )
1191 : _color( color_ )
1192 {
1193 }
operator ()(Magick::Image & image_) const1194 void Magick::borderColorImage::operator()( Magick::Image &image_ ) const
1195 {
1196 image_.borderColor( _color );
1197 }
1198
1199 // Text bounding-box base color (default none)
boxColorImage(const Magick::Color & boxColor_)1200 Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ )
1201 : _boxColor( boxColor_ ) { }
1202
operator ()(Magick::Image & image_) const1203 void Magick::boxColorImage::operator()( Magick::Image &image_ ) const
1204 {
1205 image_.boxColor( _boxColor );
1206 }
1207
chromaBluePrimaryImage(const double x_,const double y_,const double z_)1208 Magick::chromaBluePrimaryImage::chromaBluePrimaryImage(const double x_,
1209 const double y_,const double z_)
1210 : _x(x_),
1211 _y(y_),
1212 _z(z_)
1213 {
1214 }
1215
operator ()(Magick::Image & image_) const1216 void Magick::chromaBluePrimaryImage::operator()(Magick::Image &image_) const
1217 {
1218 image_.chromaBluePrimary(_x,_y,_z);
1219 }
1220
chromaGreenPrimaryImage(const double x_,const double y_,const double z_)1221 Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage(const double x_,
1222 const double y_,const double z_)
1223 : _x(x_),
1224 _y(y_),
1225 _z(z_)
1226 {
1227 }
1228
operator ()(Magick::Image & image_) const1229 void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const
1230 {
1231 image_.chromaGreenPrimary(_x,_y,_z);
1232 }
1233
chromaRedPrimaryImage(const double x_,const double y_,const double z_)1234 Magick::chromaRedPrimaryImage::chromaRedPrimaryImage(const double x_,
1235 const double y_,const double z_)
1236 : _x(x_),
1237 _y(y_),
1238 _z(z_)
1239 {
1240 }
1241
operator ()(Magick::Image & image_) const1242 void Magick::chromaRedPrimaryImage::operator()(Magick::Image &image_) const
1243 {
1244 image_.chromaRedPrimary(_x,_y,_z);
1245 }
1246
chromaWhitePointImage(const double x_,const double y_,const double z_)1247 Magick::chromaWhitePointImage::chromaWhitePointImage(const double x_,
1248 const double y_,const double z_)
1249 : _x(x_),
1250 _y(y_),
1251 _z(z_)
1252 {
1253 }
1254
operator ()(Magick::Image & image_) const1255 void Magick::chromaWhitePointImage::operator()(Magick::Image &image_) const
1256 {
1257 image_.chromaWhitePoint(_x,_y,_z);
1258 }
1259
1260 // Colors within this distance are considered equal
colorFuzzImage(const double fuzz_)1261 Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ )
1262 : _fuzz( fuzz_ )
1263 {
1264 }
operator ()(Magick::Image & image_) const1265 void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const
1266 {
1267 image_.colorFuzz( _fuzz );
1268 }
1269
1270 // Color at colormap position index_
colorMapImage(const size_t index_,const Color & color_)1271 Magick::colorMapImage::colorMapImage( const size_t index_,
1272 const Color &color_ )
1273 : _index( index_ ),
1274 _color( color_ )
1275 {
1276 }
operator ()(Magick::Image & image_) const1277 void Magick::colorMapImage::operator()( Magick::Image &image_ ) const
1278 {
1279 image_.colorMap( _index, _color );
1280 }
1281
1282 // Composition operator to be used when composition is implicitly used
1283 // (such as for image flattening).
composeImage(const CompositeOperator compose_)1284 Magick::composeImage::composeImage( const CompositeOperator compose_ )
1285 : _compose( compose_ )
1286 {
1287 }
operator ()(Magick::Image & image_) const1288 void Magick::composeImage::operator()( Magick::Image &image_ ) const
1289 {
1290 image_.compose( _compose );
1291 }
1292
1293 // Compression type
compressTypeImage(const CompressionType compressType_)1294 Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ )
1295 : _compressType( compressType_ )
1296 {
1297 }
operator ()(Magick::Image & image_) const1298 void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const
1299 {
1300 image_.compressType( _compressType );
1301 }
1302
1303 // Vertical and horizontal resolution in pixels of the image
densityImage(const Point & point_)1304 Magick::densityImage::densityImage( const Point &point_ )
1305 : _point( point_ )
1306 {
1307 }
operator ()(Magick::Image & image_) const1308 void Magick::densityImage::operator()( Magick::Image &image_ ) const
1309 {
1310 image_.density( _point );
1311 }
1312
1313 // Image depth (bits allocated to red/green/blue components)
depthImage(const size_t depth_)1314 Magick::depthImage::depthImage( const size_t depth_ )
1315 : _depth( depth_ )
1316 {
1317 }
operator ()(Magick::Image & image_) const1318 void Magick::depthImage::operator()( Magick::Image &image_ ) const
1319 {
1320 image_.depth( _depth );
1321 }
1322
1323 // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image
1324 // formats which support endian-specific options.
endianImage(const Magick::EndianType endian_)1325 Magick::endianImage::endianImage( const Magick::EndianType endian_ )
1326 : _endian( endian_ )
1327 {
1328 }
operator ()(Magick::Image & image_) const1329 void Magick::endianImage::operator()( Magick::Image &image_ ) const
1330 {
1331 image_.endian( _endian );
1332 }
1333
1334 // Image file name
fileNameImage(const std::string & fileName_)1335 Magick::fileNameImage::fileNameImage( const std::string &fileName_ )
1336 : _fileName( fileName_ )
1337 {
1338 }
operator ()(Magick::Image & image_) const1339 void Magick::fileNameImage::operator()( Magick::Image &image_ ) const
1340 {
1341 image_.fileName( _fileName );
1342 }
1343
1344 // Filter to use when resizing image
filterTypeImage(const FilterType filterType_)1345 Magick::filterTypeImage::filterTypeImage( const FilterType filterType_ )
1346 : _filterType( filterType_ )
1347 {
1348 }
operator ()(Magick::Image & image_) const1349 void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const
1350 {
1351 image_.filterType( _filterType );
1352 }
1353
1354 // Text rendering font
fontImage(const std::string & font_)1355 Magick::fontImage::fontImage( const std::string &font_ )
1356 : _font( font_ )
1357 {
1358 }
operator ()(Magick::Image & image_) const1359 void Magick::fontImage::operator()( Magick::Image &image_ ) const
1360 {
1361 image_.font( _font );
1362 }
1363
1364 // Font point size
fontPointsizeImage(const size_t pointsize_)1365 Magick::fontPointsizeImage::fontPointsizeImage( const size_t pointsize_ )
1366 : _pointsize( pointsize_ )
1367 {
1368 }
operator ()(Magick::Image & image_) const1369 void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const
1370 {
1371 image_.fontPointsize( _pointsize );
1372 }
1373
1374 // GIF disposal method
gifDisposeMethodImage(const DisposeType disposeMethod_)1375 Magick::gifDisposeMethodImage::gifDisposeMethodImage( const DisposeType disposeMethod_ )
1376 : _disposeMethod( disposeMethod_ )
1377 {
1378 }
operator ()(Magick::Image & image_) const1379 void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const
1380 {
1381 image_.gifDisposeMethod( _disposeMethod );
1382 }
1383
1384 // Type of interlacing to use
interlaceTypeImage(const InterlaceType interlace_)1385 Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ )
1386 : _interlace( interlace_ )
1387 {
1388 }
operator ()(Magick::Image & image_) const1389 void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const
1390 {
1391 image_.interlaceType( _interlace );
1392 }
1393
1394 // File type magick identifier (.e.g "GIF")
magickImage(const std::string & magick_)1395 Magick::magickImage::magickImage( const std::string &magick_ )
1396 : _magick( magick_ )
1397 {
1398 }
operator ()(Magick::Image & image_) const1399 void Magick::magickImage::operator()( Magick::Image &image_ ) const
1400 {
1401 image_.magick( _magick );
1402 }
1403
1404 // Image supports transparent color
alphaFlagImage(const bool alphaFlag_)1405 Magick::alphaFlagImage::alphaFlagImage( const bool alphaFlag_ )
1406 : _alphaFlag( alphaFlag_ )
1407 {
1408 }
operator ()(Magick::Image & image_) const1409 void Magick::alphaFlagImage::operator()( Magick::Image &image_ ) const
1410 {
1411 image_.alpha( _alphaFlag );
1412 }
1413
1414 // Transparent color
alphaColorImage(const Color & alphaColor_)1415 Magick::alphaColorImage::alphaColorImage( const Color &alphaColor_ )
1416 : _alphaColor( alphaColor_ )
1417 {
1418 }
operator ()(Magick::Image & image_) const1419 void Magick::alphaColorImage::operator()( Magick::Image &image_ ) const
1420 {
1421 image_.alphaColor( _alphaColor );
1422 }
1423
1424 // Indicate that image is black and white
monochromeImage(const bool monochromeFlag_)1425 Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ )
1426 : _monochromeFlag( monochromeFlag_ )
1427 {
1428 }
operator ()(Magick::Image & image_) const1429 void Magick::monochromeImage::operator()( Magick::Image &image_ ) const
1430 {
1431 image_.monochrome( _monochromeFlag );
1432 }
1433
1434 // Set pixel color at location x & y.
pixelColorImage(const ssize_t x_,const ssize_t y_,const Color & color_)1435 Magick::pixelColorImage::pixelColorImage( const ssize_t x_,
1436 const ssize_t y_,
1437 const Color &color_)
1438 : _x( x_ ),
1439 _y( y_ ),
1440 _color( color_ ) { }
1441
operator ()(Magick::Image & image_) const1442 void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const
1443 {
1444 image_.pixelColor( _x, _y, _color );
1445 }
1446
1447 // Postscript page size.
pageImage(const Geometry & pageSize_)1448 Magick::pageImage::pageImage( const Geometry &pageSize_ )
1449 : _pageSize( pageSize_ )
1450 {
1451 }
operator ()(Magick::Image & image_) const1452 void Magick::pageImage::operator()( Magick::Image &image_ ) const
1453 {
1454 image_.page( _pageSize );
1455 }
1456
1457 // JPEG/MIFF/PNG compression level (default 75).
qualityImage(const size_t quality_)1458 Magick::qualityImage::qualityImage( const size_t quality_ )
1459 : _quality( quality_ )
1460 {
1461 }
operator ()(Magick::Image & image_) const1462 void Magick::qualityImage::operator()( Magick::Image &image_ ) const
1463 {
1464 image_.quality( _quality );
1465 }
1466
1467 // Maximum number of colors to quantize to
quantizeColorsImage(const size_t colors_)1468 Magick::quantizeColorsImage::quantizeColorsImage( const size_t colors_ )
1469 : _colors( colors_ )
1470 {
1471 }
operator ()(Magick::Image & image_) const1472 void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const
1473 {
1474 image_.quantizeColors( _colors );
1475 }
1476
1477 // Colorspace to quantize in.
quantizeColorSpaceImage(const ColorspaceType colorSpace_)1478 Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ )
1479 : _colorSpace( colorSpace_ )
1480 {
1481 }
operator ()(Magick::Image & image_) const1482 void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const
1483 {
1484 image_.quantizeColorSpace( _colorSpace );
1485 }
1486
1487 // Dither image during quantization (default true).
quantizeDitherImage(const bool ditherFlag_)1488 Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ )
1489 : _ditherFlag( ditherFlag_ )
1490 {
1491 }
operator ()(Magick::Image & image_) const1492 void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const
1493 {
1494 image_.quantizeDither( _ditherFlag );
1495 }
1496
1497 // Quantization tree-depth
quantizeTreeDepthImage(const size_t treeDepth_)1498 Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const size_t treeDepth_ )
1499 : _treeDepth( treeDepth_ ) { }
1500
operator ()(Magick::Image & image_) const1501 void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const
1502 {
1503 image_.quantizeTreeDepth( _treeDepth );
1504 }
1505
1506 // The type of rendering intent
renderingIntentImage(const Magick::RenderingIntent renderingIntent_)1507 Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ )
1508 : _renderingIntent( renderingIntent_ )
1509 {
1510 }
operator ()(Magick::Image & image_) const1511 void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const
1512 {
1513 image_.renderingIntent( _renderingIntent );
1514 }
1515
1516 // Units of image resolution
resolutionUnitsImage(const Magick::ResolutionType resolutionUnits_)1517 Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ )
1518 : _resolutionUnits( resolutionUnits_ )
1519 {
1520 }
operator ()(Magick::Image & image_) const1521 void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const
1522 {
1523 image_.resolutionUnits( _resolutionUnits );
1524 }
1525
1526 // Image scene number
sceneImage(const size_t scene_)1527 Magick::sceneImage::sceneImage( const size_t scene_ )
1528 : _scene( scene_ )
1529 {
1530 }
operator ()(Magick::Image & image_) const1531 void Magick::sceneImage::operator()( Magick::Image &image_ ) const
1532 {
1533 image_.scene( _scene );
1534 }
1535
1536 // Width and height of a raw image
sizeImage(const Magick::Geometry & geometry_)1537 Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ )
1538 : _geometry( geometry_ )
1539 {
1540 }
operator ()(Magick::Image & image_) const1541 void Magick::sizeImage::operator()( Magick::Image &image_ ) const
1542 {
1543 image_.size( _geometry );
1544 }
1545
1546 // Splice the background color into the image.
spliceImage(const Magick::Geometry & geometry_)1547 Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ )
1548 : _geometry( geometry_ )
1549 {
1550 }
operator ()(Magick::Image & image_) const1551 void Magick::spliceImage::operator()( Magick::Image &image_ ) const
1552 {
1553 image_.splice( _geometry );
1554 }
1555
1556 // stripImage strips an image of all profiles and comments.
stripImage(void)1557 Magick::stripImage::stripImage( void )
1558 {
1559 }
operator ()(Magick::Image & image_) const1560 void Magick::stripImage::operator()( Magick::Image &image_ ) const
1561 {
1562 image_.strip( );
1563 }
1564
1565 // Subimage of an image sequence
subImageImage(const size_t subImage_)1566 Magick::subImageImage::subImageImage( const size_t subImage_ )
1567 : _subImage( subImage_ )
1568 {
1569 }
operator ()(Magick::Image & image_) const1570 void Magick::subImageImage::operator()( Magick::Image &image_ ) const
1571 {
1572 image_.subImage( _subImage );
1573 }
1574
1575 // Number of images relative to the base image
subRangeImage(const size_t subRange_)1576 Magick::subRangeImage::subRangeImage( const size_t subRange_ )
1577 : _subRange( subRange_ )
1578 {
1579 }
operator ()(Magick::Image & image_) const1580 void Magick::subRangeImage::operator()( Magick::Image &image_ ) const
1581 {
1582 image_.subRange( _subRange );
1583 }
1584
1585 // Anti-alias Postscript and TrueType fonts (default true)
textAntiAliasImage(const bool flag_)1586 Magick::textAntiAliasImage::textAntiAliasImage( const bool flag_ )
1587 : _flag( flag_ )
1588 {
1589 }
operator ()(Magick::Image & image_) const1590 void Magick::textAntiAliasImage::operator()( Magick::Image &image_ ) const
1591 {
1592 image_.textAntiAlias( _flag );
1593 }
1594
1595 // Image storage type
typeImage(const Magick::ImageType type_)1596 Magick::typeImage::typeImage( const Magick::ImageType type_ )
1597 : _type( type_ )
1598 {
1599 }
operator ()(Magick::Image & image_) const1600 void Magick::typeImage::operator()( Magick::Image &image_ ) const
1601 {
1602 image_.type( _type );
1603 }
1604
1605 // Print detailed information about the image
verboseImage(const bool verbose_)1606 Magick::verboseImage::verboseImage( const bool verbose_ )
1607 : _verbose( verbose_ )
1608 {
1609 }
operator ()(Magick::Image & image_) const1610 void Magick::verboseImage::operator()( Magick::Image &image_ ) const
1611 {
1612 image_.verbose( _verbose );
1613 }
1614
1615 // X11 display to display to, obtain fonts from, or to capture image
1616 // from
x11DisplayImage(const std::string & display_)1617 Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ )
1618 : _display( display_ )
1619 {
1620 }
operator ()(Magick::Image & image_) const1621 void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const
1622 {
1623 image_.x11Display( _display );
1624 }
1625