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