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