blob: 78c73c5bcc99d68d46139e6c42c08b72a756f266 [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
878Magick::shadeImage::shadeImage( const double clusterThreshold_,
879 const double smoothingThreshold_ )
880 : _clusterThreshold( clusterThreshold_ ),
881 _smoothingThreshold( smoothingThreshold_ )
882{
883}
884void Magick::shadeImage::operator()( Magick::Image &image_ ) const
885{
886 image_.shade( _clusterThreshold, _smoothingThreshold );
887}
888
889// Sharpen pixels in image
890Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ )
891 : _radius( radius_ ),
892 _sigma( sigma_ )
893{
894}
895void Magick::sharpenImage::operator()( Magick::Image &image_ ) const
896{
897 image_.sharpen( _radius, _sigma );
898}
899
900// Shave pixels from image edges.
901Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ )
902 : _geometry( geometry_ )
903{
904}
905void Magick::shaveImage::operator()( Magick::Image &image_ ) const
906{
907 image_.shave( _geometry );
908}
909
910// Shear image (create parallelogram by sliding image by X or Y axis)
911Magick::shearImage::shearImage( const double xShearAngle_,
912 const double yShearAngle_ )
913 : _xShearAngle( xShearAngle_ ),
914 _yShearAngle( yShearAngle_ )
915{
916}
917void Magick::shearImage::operator()( Magick::Image &image_ ) const
918{
919 image_.shear( _xShearAngle, _yShearAngle );
920}
921
922// Solarize image (similar to effect seen when exposing a photographic
923// film to light during the development process)
924Magick::solarizeImage::solarizeImage( const double factor_ )
925 : _factor( factor_ )
926{
927}
928void Magick::solarizeImage::operator()( Magick::Image &image_ ) const
929{
930 image_.solarize( _factor );
931}
932
933// Spread pixels randomly within image by specified ammount
934Magick::spreadImage::spreadImage( const unsigned int amount_ )
935 : _amount( amount_ )
936{
937}
938void Magick::spreadImage::operator()( Magick::Image &image_ ) const
939{
940 image_.spread( _amount );
941}
942
943// Add a digital watermark to the image (based on second image)
944Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ )
945 : _waterMark( waterMark_ )
946{
947}
948void Magick::steganoImage::operator()( Magick::Image &image_ ) const
949{
950 image_.stegano( _waterMark );
951}
952
953// Create an image which appears in stereo when viewed with red-blue
954// glasses (Red image on left, blue on right)
955Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ )
956 : _rightImage( rightImage_ )
957{
958}
959void Magick::stereoImage::operator()( Magick::Image &image_ ) const
960{
961 image_.stereo( _rightImage );
962}
963
964// Color to use when drawing object outlines
965Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ )
966 : _strokeColor( strokeColor_ )
967{
968}
969void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const
970{
971 image_.strokeColor( _strokeColor );
972}
973
974// Swirl image (image pixels are rotated by degrees)
975Magick::swirlImage::swirlImage( const double degrees_ )
976 : _degrees( degrees_ )
977{
978}
979void Magick::swirlImage::operator()( Magick::Image &image_ ) const
980{
981 image_.swirl( _degrees );
982}
983
984// Channel a texture on image background
985Magick::textureImage::textureImage( const Magick::Image &texture_ )
986 : _texture( texture_ )
987{
988}
989void Magick::textureImage::operator()( Magick::Image &image_ ) const
990{
991 image_.texture( _texture );
992}
993
994// Threshold image
995Magick::thresholdImage::thresholdImage( const double threshold_ )
996 : _threshold( threshold_ )
997{
998}
999void Magick::thresholdImage::operator()( Magick::Image &image_ ) const
1000{
1001 image_.threshold( _threshold );
1002}
1003
1004// Transform image based on image and crop geometries
1005Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_ )
1006 : _imageGeometry( imageGeometry_ ),
1007 _cropGeometry( )
1008{
1009}
1010Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_,
1011 const Geometry &cropGeometry_ )
1012 : _imageGeometry( imageGeometry_ ),
1013 _cropGeometry( cropGeometry_ )
1014{
1015}
1016void Magick::transformImage::operator()( Magick::Image &image_ ) const
1017{
1018 if ( _cropGeometry.isValid() )
1019 image_.transform( _imageGeometry, _cropGeometry );
1020 else
1021 image_.transform( _imageGeometry );
1022}
1023
1024// Set image color to transparent
1025Magick::transparentImage::transparentImage( const Magick::Color& color_ )
1026 : _color( color_ )
1027{
1028}
1029void Magick::transparentImage::operator()( Magick::Image &image_ ) const
1030{
1031 image_.transparent( _color );
1032}
1033
1034// Trim edges that are the background color from the image
1035Magick::trimImage::trimImage( void )
1036{
1037}
1038void Magick::trimImage::operator()( Magick::Image &image_ ) const
1039{
1040 image_.trim( );
1041}
1042
1043// Map image pixels to a sine wave
1044Magick::waveImage::waveImage( const double amplitude_,
1045 const double wavelength_ )
1046 : _amplitude( amplitude_ ),
1047 _wavelength( wavelength_ )
1048{
1049}
1050void Magick::waveImage::operator()( Magick::Image &image_ ) const
1051{
1052 image_.wave( _amplitude, _wavelength );
1053}
1054
1055// resize image to specified size.
1056Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ )
1057 : _geometry( geometry_ )
1058{
1059}
1060void Magick::resizeImage::operator()( Magick::Image &image_ ) const
1061{
1062 image_.resize( _geometry );
1063}
1064
1065// Zoom image to specified size.
1066Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ )
1067 : _geometry( geometry_ )
1068{
1069}
1070void Magick::zoomImage::operator()( Magick::Image &image_ ) const
1071{
1072 image_.zoom( _geometry );
1073}
1074
1075//
1076// Function object image attribute accessors
1077//
1078
1079// Anti-alias Postscript and TrueType fonts (default true)
1080Magick::antiAliasImage::antiAliasImage( const bool flag_ )
1081 : _flag( flag_ )
1082{
1083}
1084void Magick::antiAliasImage::operator()( Magick::Image &image_ ) const
1085{
1086 image_.antiAlias( _flag );
1087}
1088
1089// Join images into a single multi-image file
1090Magick::adjoinImage::adjoinImage( const bool flag_ )
1091 : _flag( flag_ )
1092{
1093}
1094void Magick::adjoinImage::operator()( Magick::Image &image_ ) const
1095{
1096 image_.adjoin( _flag );
1097}
1098
1099// Time in 1/100ths of a second which must expire before displaying
1100// the next image in an animated sequence.
1101Magick::animationDelayImage::animationDelayImage( const unsigned int delay_ )
1102 : _delay( delay_ )
1103{
1104}
1105void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const
1106{
1107 image_.animationDelay( _delay );
1108}
1109
1110// Number of iterations to loop an animation (e.g. Netscape loop
1111// extension) for.
1112Magick::animationIterationsImage::animationIterationsImage( const unsigned int iterations_ )
1113 : _iterations( iterations_ )
1114{
1115}
1116void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const
1117{
1118 image_.animationIterations( _iterations );
1119}
1120
1121// Image background color
1122Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ )
1123 : _color( color_ )
1124{
1125}
1126void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const
1127{
1128 image_.backgroundColor( _color );
1129}
1130
1131// Name of texture image to tile onto the image background
1132Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ )
1133 : _backgroundTexture( backgroundTexture_ )
1134{
1135}
1136void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const
1137{
1138 image_.backgroundTexture( _backgroundTexture );
1139}
1140
1141// Image border color
1142Magick::borderColorImage::borderColorImage( const Magick::Color &color_ )
1143 : _color( color_ )
1144{
1145}
1146void Magick::borderColorImage::operator()( Magick::Image &image_ ) const
1147{
1148 image_.borderColor( _color );
1149}
1150
1151// Text bounding-box base color (default none)
1152Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ )
1153 : _boxColor( boxColor_ ) { }
1154
1155void Magick::boxColorImage::operator()( Magick::Image &image_ ) const
1156{
1157 image_.boxColor( _boxColor );
1158}
1159
1160// Chromaticity blue primary point (e.g. x=0.15, y=0.06)
1161Magick::chromaBluePrimaryImage::chromaBluePrimaryImage( const double x_,
1162 const double y_ )
1163 : _x( x_ ),
1164 _y( y_ )
1165{
1166}
1167void Magick::chromaBluePrimaryImage::operator()( Magick::Image &image_ ) const
1168{
1169 image_.chromaBluePrimary( _x, _y );
1170}
1171
1172// Chromaticity green primary point (e.g. x=0.3, y=0.6)
1173Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage( const double x_,
1174 const double y_ )
1175 : _x( x_ ),
1176 _y( y_ )
1177{
1178}
1179void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const
1180{
1181 image_.chromaGreenPrimary( _x, _y );
1182}
1183
1184// Chromaticity red primary point (e.g. x=0.64, y=0.33)
1185Magick::chromaRedPrimaryImage::chromaRedPrimaryImage( const double x_,
1186 const double y_ )
1187 : _x( x_ ),
1188 _y( y_ )
1189{
1190}
1191void Magick::chromaRedPrimaryImage::operator()( Magick::Image &image_ ) const
1192{
1193 image_.chromaRedPrimary( _x, _y );
1194}
1195
1196// Chromaticity white point (e.g. x=0.3127, y=0.329)
1197Magick::chromaWhitePointImage::chromaWhitePointImage( const double x_,
1198 const double y_ )
1199 : _x( x_ ),
1200 _y( y_ )
1201{
1202}
1203void Magick::chromaWhitePointImage::operator()( Magick::Image &image_ ) const
1204{
1205 image_.chromaWhitePoint( _x, _y );
1206}
1207
1208// Colors within this distance are considered equal
1209Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ )
1210 : _fuzz( fuzz_ )
1211{
1212}
1213void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const
1214{
1215 image_.colorFuzz( _fuzz );
1216}
1217
1218// Color at colormap position index_
1219Magick::colorMapImage::colorMapImage( const unsigned int index_,
1220 const Color &color_ )
1221 : _index( index_ ),
1222 _color( color_ )
1223{
1224}
1225void Magick::colorMapImage::operator()( Magick::Image &image_ ) const
1226{
1227 image_.colorMap( _index, _color );
1228}
1229
1230// Composition operator to be used when composition is implicitly used
1231// (such as for image flattening).
1232Magick::composeImage::composeImage( const CompositeOperator compose_ )
1233 : _compose( compose_ )
1234{
1235}
1236void Magick::composeImage::operator()( Magick::Image &image_ ) const
1237{
1238 image_.compose( _compose );
1239}
1240
1241// Compression type
1242Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ )
1243 : _compressType( compressType_ )
1244{
1245}
1246void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const
1247{
1248 image_.compressType( _compressType );
1249}
1250
1251// Vertical and horizontal resolution in pixels of the image
1252Magick::densityImage::densityImage( const Geometry &geomery_ )
1253 : _geomery( geomery_ )
1254{
1255}
1256void Magick::densityImage::operator()( Magick::Image &image_ ) const
1257{
1258 image_.density( _geomery );
1259}
1260
1261// Image depth (bits allocated to red/green/blue components)
1262Magick::depthImage::depthImage( const unsigned int depth_ )
1263 : _depth( depth_ )
1264{
1265}
1266void Magick::depthImage::operator()( Magick::Image &image_ ) const
1267{
1268 image_.depth( _depth );
1269}
1270
1271// Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image
1272// formats which support endian-specific options.
1273Magick::endianImage::endianImage( const Magick::EndianType endian_ )
1274 : _endian( endian_ )
1275{
1276}
1277void Magick::endianImage::operator()( Magick::Image &image_ ) const
1278{
1279 image_.endian( _endian );
1280}
1281
1282// Image file name
1283Magick::fileNameImage::fileNameImage( const std::string &fileName_ )
1284 : _fileName( fileName_ )
1285{
1286}
1287void Magick::fileNameImage::operator()( Magick::Image &image_ ) const
1288{
1289 image_.fileName( _fileName );
1290}
1291
1292// Filter to use when resizing image
1293Magick::filterTypeImage::filterTypeImage( const FilterTypes filterType_ )
1294 : _filterType( filterType_ )
1295{
1296}
1297void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const
1298{
1299 image_.filterType( _filterType );
1300}
1301
1302// Text rendering font
1303Magick::fontImage::fontImage( const std::string &font_ )
1304 : _font( font_ )
1305{
1306}
1307void Magick::fontImage::operator()( Magick::Image &image_ ) const
1308{
1309 image_.font( _font );
1310}
1311
1312// Font point size
1313Magick::fontPointsizeImage::fontPointsizeImage( const unsigned int pointsize_ )
1314 : _pointsize( pointsize_ )
1315{
1316}
1317void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const
1318{
1319 image_.fontPointsize( _pointsize );
1320}
1321
1322// GIF disposal method
1323Magick::gifDisposeMethodImage::gifDisposeMethodImage( const unsigned int disposeMethod_ )
1324 : _disposeMethod( disposeMethod_ )
1325{
1326}
1327void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const
1328{
1329 image_.gifDisposeMethod( _disposeMethod );
1330}
1331
1332// Type of interlacing to use
1333Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ )
1334 : _interlace( interlace_ )
1335{
1336}
1337void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const
1338{
1339 image_.interlaceType( _interlace );
1340}
1341
1342// Linewidth for drawing vector objects (default one)
1343Magick::lineWidthImage::lineWidthImage( const double lineWidth_ )
1344 : _lineWidth( lineWidth_ )
1345{
1346}
1347void Magick::lineWidthImage::operator()( Magick::Image &image_ ) const
1348{
1349 image_.lineWidth( _lineWidth );
1350}
1351
1352// File type magick identifier (.e.g "GIF")
1353Magick::magickImage::magickImage( const std::string &magick_ )
1354 : _magick( magick_ )
1355{
1356}
1357void Magick::magickImage::operator()( Magick::Image &image_ ) const
1358{
1359 image_.magick( _magick );
1360}
1361
1362// Image supports transparent color
1363Magick::matteImage::matteImage( const bool matteFlag_ )
1364 : _matteFlag( matteFlag_ )
1365{
1366}
1367void Magick::matteImage::operator()( Magick::Image &image_ ) const
1368{
1369 image_.matte( _matteFlag );
1370}
1371
1372// Transparent color
1373Magick::matteColorImage::matteColorImage( const Color &matteColor_ )
1374 : _matteColor( matteColor_ )
1375{
1376}
1377void Magick::matteColorImage::operator()( Magick::Image &image_ ) const
1378{
1379 image_.matteColor( _matteColor );
1380}
1381
1382// Indicate that image is black and white
1383Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ )
1384 : _monochromeFlag( monochromeFlag_ )
1385{
1386}
1387void Magick::monochromeImage::operator()( Magick::Image &image_ ) const
1388{
1389 image_.monochrome( _monochromeFlag );
1390}
1391
1392// Pen color
1393Magick::penColorImage::penColorImage( const Color &penColor_ )
1394 : _penColor( penColor_ )
1395{
1396}
1397void Magick::penColorImage::operator()( Magick::Image &image_ ) const
1398{
1399 image_.penColor( _penColor );
1400}
1401
1402// Pen texture image.
1403Magick::penTextureImage::penTextureImage( const Image &penTexture_ )
1404 : _penTexture( penTexture_ )
1405{
1406}
1407void Magick::penTextureImage::operator()( Magick::Image &image_ ) const
1408{
1409 image_.penTexture( _penTexture );
1410}
1411
1412// Set pixel color at location x & y.
1413Magick::pixelColorImage::pixelColorImage( const unsigned int x_,
1414 const unsigned int y_,
1415 const Color &color_)
1416 : _x( x_ ),
1417 _y( y_ ),
1418 _color( color_ ) { }
1419
1420void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const
1421{
1422 image_.pixelColor( _x, _y, _color );
1423}
1424
1425// Postscript page size.
1426Magick::pageImage::pageImage( const Geometry &pageSize_ )
1427 : _pageSize( pageSize_ )
1428{
1429}
1430void Magick::pageImage::operator()( Magick::Image &image_ ) const
1431{
1432 image_.page( _pageSize );
1433}
1434
1435// JPEG/MIFF/PNG compression level (default 75).
1436Magick::qualityImage::qualityImage( const unsigned int quality_ )
1437 : _quality( quality_ )
1438{
1439}
1440void Magick::qualityImage::operator()( Magick::Image &image_ ) const
1441{
1442 image_.quality( _quality );
1443}
1444
1445// Maximum number of colors to quantize to
1446Magick::quantizeColorsImage::quantizeColorsImage( const unsigned int colors_ )
1447 : _colors( colors_ )
1448{
1449}
1450void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const
1451{
1452 image_.quantizeColors( _colors );
1453}
1454
1455// Colorspace to quantize in.
1456Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ )
1457 : _colorSpace( colorSpace_ )
1458{
1459}
1460void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const
1461{
1462 image_.quantizeColorSpace( _colorSpace );
1463}
1464
1465// Dither image during quantization (default true).
1466Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ )
1467 : _ditherFlag( ditherFlag_ )
1468{
1469}
1470void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const
1471{
1472 image_.quantizeDither( _ditherFlag );
1473}
1474
1475// Quantization tree-depth
1476Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const unsigned int treeDepth_ )
1477 : _treeDepth( treeDepth_ ) { }
1478
1479void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const
1480{
1481 image_.quantizeTreeDepth( _treeDepth );
1482}
1483
1484// The type of rendering intent
1485Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ )
1486 : _renderingIntent( renderingIntent_ )
1487{
1488}
1489void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const
1490{
1491 image_.renderingIntent( _renderingIntent );
1492}
1493
1494// Units of image resolution
1495Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ )
1496 : _resolutionUnits( resolutionUnits_ )
1497{
1498}
1499void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const
1500{
1501 image_.resolutionUnits( _resolutionUnits );
1502}
1503
1504// Image scene number
1505Magick::sceneImage::sceneImage( const unsigned int scene_ )
1506 : _scene( scene_ )
1507{
1508}
1509void Magick::sceneImage::operator()( Magick::Image &image_ ) const
1510{
1511 image_.scene( _scene );
1512}
1513
1514// Width and height of a raw image
1515Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ )
1516 : _geometry( geometry_ )
1517{
1518}
1519void Magick::sizeImage::operator()( Magick::Image &image_ ) const
1520{
1521 image_.size( _geometry );
1522}
1523
cristy8198a752009-09-28 23:59:24 +00001524// Splice the background color into the image.
1525Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ )
1526 : _geometry( geometry_ )
1527{
1528}
1529void Magick::spliceImage::operator()( Magick::Image &image_ ) const
1530{
1531 image_.splice( _geometry );
1532}
1533
cristy3ed852e2009-09-05 21:47:34 +00001534// Subimage of an image sequence
1535Magick::subImageImage::subImageImage( const unsigned int subImage_ )
1536 : _subImage( subImage_ )
1537{
1538}
1539void Magick::subImageImage::operator()( Magick::Image &image_ ) const
1540{
1541 image_.subImage( _subImage );
1542}
1543
1544// Number of images relative to the base image
1545Magick::subRangeImage::subRangeImage( const unsigned int subRange_ )
1546 : _subRange( subRange_ )
1547{
1548}
1549void Magick::subRangeImage::operator()( Magick::Image &image_ ) const
1550{
1551 image_.subRange( _subRange );
1552}
1553
1554// Tile name
1555Magick::tileNameImage::tileNameImage( const std::string &tileName_ )
1556 : _tileName( tileName_ )
1557{
1558}
1559void Magick::tileNameImage::operator()( Magick::Image &image_ ) const
1560{
1561 image_.tileName( _tileName );
1562}
1563
1564// Image storage type
1565Magick::typeImage::typeImage( const Magick::ImageType type_ )
1566 : _type( type_ )
1567{
1568}
1569void Magick::typeImage::operator()( Magick::Image &image_ ) const
1570{
1571 image_.type( _type );
1572}
1573
1574// Print detailed information about the image
1575Magick::verboseImage::verboseImage( const bool verbose_ )
1576 : _verbose( verbose_ )
1577{
1578}
1579void Magick::verboseImage::operator()( Magick::Image &image_ ) const
1580{
1581 image_.verbose( _verbose );
1582}
1583
1584// FlashPix viewing parameters
1585Magick::viewImage::viewImage( const std::string &view_ )
1586 : _view( view_ ) { }
1587
1588void Magick::viewImage::operator()( Magick::Image &image_ ) const
1589{
1590 image_.view( _view );
1591}
1592
1593// X11 display to display to, obtain fonts from, or to capture image
1594// from
1595Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ )
1596 : _display( display_ )
1597{
1598}
1599void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const
1600{
1601 image_.x11Display( _display );
1602}