blob: 17b80f72a2dc4de5068717de571062465eb50b3a [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
cristy529fcc22009-11-14 18:15:08 +0000583// Implements the inverse discrete Fourier transform (IFT) of the image
584// either as a magnitude / phase or real / imaginary image pair.
585Magick::inverseFourierTransformImage::inverseFourierTransformImage( const Magick::Image &phaseImage_ )
586 : _phaseImage( phaseImage_ )
587{
588}
589void Magick::inverseFourierTransformImage::operator()( Magick::Image &image_ ) const
590{
591 image_.inverseFourierTransform( _phaseImage );
592}
593
cristy3ed852e2009-09-05 21:47:34 +0000594// Set image validity. Valid images become empty (inValid) if argument
595// is false.
596Magick::isValidImage::isValidImage( const bool isValid_ )
597 : _isValid( isValid_ )
598{
599}
600void Magick::isValidImage::operator()( Magick::Image &image_ ) const
601{
602 image_.isValid( _isValid );
603}
604
605// Label image
606Magick::labelImage::labelImage( const std::string &label_ )
607 : _label( label_ )
608{
609}
610void Magick::labelImage::operator()( Magick::Image &image_ ) const
611{
612 image_.label( _label );
613}
614
615// Level image
616Magick::levelImage::levelImage( const double black_point,
617 const double white_point,
618 const double mid_point )
619 : _black_point(black_point),
620 _white_point(white_point),
621 _mid_point(mid_point)
622{
623}
624void Magick::levelImage::operator()( Magick::Image &image_ ) const
625{
626 image_.level( _black_point, _white_point, _mid_point );
627}
628
629// Level image channel
630Magick::levelChannelImage::levelChannelImage( const Magick::ChannelType channel, const double black_point,
631 const double white_point,
632 const double mid_point )
633 : _channel(channel),
634 _black_point(black_point),
635 _white_point(white_point),
636 _mid_point(mid_point)
637{
638}
639
640void Magick::levelChannelImage::operator()( Magick::Image &image_ ) const
641{
642 image_.levelChannel( _channel, _black_point, _white_point, _mid_point );
643}
644
645// Magnify image by integral size
646Magick::magnifyImage::magnifyImage( void )
647{
648}
649void Magick::magnifyImage::operator()( Magick::Image &image_ ) const
650{
651 image_.magnify( );
652}
653
654// Remap image colors with closest color from reference image
655Magick::mapImage::mapImage( const Magick::Image &mapImage_ ,
656 const bool dither_ )
657 : _mapImage( mapImage_ ),
658 _dither( dither_ )
659{
660}
661void Magick::mapImage::operator()( Magick::Image &image_ ) const
662{
663 image_.map( _mapImage, _dither );
664}
665
666// Floodfill designated area with a matte value
667Magick::matteFloodfillImage::matteFloodfillImage( const Color &target_ ,
668 const unsigned int matte_,
669 const int x_, const int y_,
670 const PaintMethod method_ )
671 : _target( target_ ),
672 _matte( matte_ ),
673 _x( x_ ),
674 _y( y_ ),
675 _method( method_ )
676{
677}
678void Magick::matteFloodfillImage::operator()( Magick::Image &image_ ) const
679{
680 image_.matteFloodfill( _target, _matte, _x, _y, _method );
681}
682
683// Filter image by replacing each pixel component with the median
684// color in a circular neighborhood
685Magick::medianFilterImage::medianFilterImage( const double radius_ )
686 : _radius( radius_ )
687{
688}
689void Magick::medianFilterImage::operator()( Magick::Image &image_ ) const
690{
691 image_.medianFilter( _radius );
692}
693
694// Reduce image by integral size
695Magick::minifyImage::minifyImage( void )
696{
697}
698void Magick::minifyImage::operator()( Magick::Image &image_ ) const
699{
700 image_.minify( );
701}
702
703// Modulate percent hue, saturation, and brightness of an image
704Magick::modulateImage::modulateImage( const double brightness_,
705 const double saturation_,
706 const double hue_ )
707 : _brightness( brightness_ ),
708 _saturation( saturation_ ),
709 _hue( hue_ )
710{
711}
712void Magick::modulateImage::operator()( Magick::Image &image_ ) const
713{
714 image_.modulate( _brightness, _saturation, _hue );
715}
716
717// Negate colors in image. Set grayscale to only negate grayscale
718// values in image.
719Magick::negateImage::negateImage( const bool grayscale_ )
720 : _grayscale( grayscale_ )
721{
722}
723void Magick::negateImage::operator()( Magick::Image &image_ ) const
724{
725 image_.negate( _grayscale );
726}
727
728// Normalize image (increase contrast by normalizing the pixel values
729// to span the full range of color values)
730Magick::normalizeImage::normalizeImage( void )
731{
732}
733void Magick::normalizeImage::operator()( Magick::Image &image_ ) const
734{
735 image_.normalize( );
736}
737
738// Oilpaint image (image looks like oil painting)
739Magick::oilPaintImage::oilPaintImage( const double radius_ )
740 : _radius( radius_ )
741{
742}
743void Magick::oilPaintImage::operator()( Magick::Image &image_ ) const
744{
745 image_.oilPaint( _radius );
746}
747
748// Set or attenuate the image opacity channel. If the image pixels are
749// opaque then they are set to the specified opacity value, otherwise
750// they are blended with the supplied opacity value. The value of
751// opacity_ ranges from 0 (completely opaque) to QuantumRange. The defines
752// OpaqueOpacity and TransparentOpacity are available to specify
753// completely opaque or completely transparent, respectively.
754Magick::opacityImage::opacityImage( const unsigned int opacity_ )
755 : _opacity( opacity_ )
756{
757}
758void Magick::opacityImage::operator()( Magick::Image &image_ ) const
759{
760 image_.opacity( _opacity );
761}
762
763// Change color of opaque pixel to specified pen color.
764Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_,
765 const Magick::Color &penColor_ )
766 : _opaqueColor( opaqueColor_ ),
767 _penColor( penColor_ )
768{
769}
770void Magick::opaqueImage::operator()( Magick::Image &image_ ) const
771{
772 image_.opaque( _opaqueColor, _penColor );
773}
774
775// Quantize image (reduce number of colors)
776Magick::quantizeImage::quantizeImage( const bool measureError_ )
777 : _measureError( measureError_ )
778{
779}
780void Magick::quantizeImage::operator()( Image &image_ ) const
781{
782 image_.quantize( _measureError );
783}
784
785// Raise image (lighten or darken the edges of an image to give a 3-D
786// raised or lowered effect)
787Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ ,
788 const bool raisedFlag_ )
789 : _geometry( geometry_ ),
790 _raisedFlag( raisedFlag_ )
791{
792}
793void Magick::raiseImage::operator()( Magick::Image &image_ ) const
794{
795 image_.raise( _geometry, _raisedFlag );
796}
797
cristyb32b90a2009-09-07 21:45:48 +0000798// Apply a color matrix to the image channels. The user supplied
799// matrix may be of order 1 to 5 (1x1 through 5x5).
800Magick::recolorImage::recolorImage( const unsigned int order_,
801 const double *color_matrix_ )
802 : _order( order_ ),
803 _color_matrix( color_matrix_ )
804{
805}
806void Magick::recolorImage::operator()( Image &image_ ) const
807{
808 image_.recolor( _order, _color_matrix );
809}
810
cristy3ed852e2009-09-05 21:47:34 +0000811// Reduce noise in image using a noise peak elimination filter
812Magick::reduceNoiseImage::reduceNoiseImage( void )
813 : _order(3)
814{
815}
816Magick::reduceNoiseImage::reduceNoiseImage ( const unsigned int order_ )
817 : _order(order_)
818{
819}
820void Magick::reduceNoiseImage::operator()( Image &image_ ) const
821{
822 image_.reduceNoise( _order );
823}
824
825// Roll image (rolls image vertically and horizontally) by specified
826// number of columnms and rows)
827Magick::rollImage::rollImage( const Magick::Geometry &roll_ )
828 : _columns( roll_.width() ),
829 _rows( roll_.height() )
830{
831}
832Magick::rollImage::rollImage( const int columns_,
833 const int rows_ )
834 : _columns( columns_ ),
835 _rows( rows_ )
836{
837}
838void Magick::rollImage::operator()( Magick::Image &image_ ) const
839{
840 image_.roll( _columns, _rows );
841}
842
843// Rotate image counter-clockwise by specified number of degrees.
844Magick::rotateImage::rotateImage( const double degrees_ )
845 : _degrees( degrees_ )
846{
847}
848void Magick::rotateImage::operator()( Magick::Image &image_ ) const
849{
850 image_.rotate( _degrees );
851}
852
853// Resize image by using pixel sampling algorithm
854Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ )
855 : _geometry( geometry_ )
856{
857}
858void Magick::sampleImage::operator()( Magick::Image &image_ ) const
859{
860 image_.sample( _geometry );
861}
862
863// Resize image by using simple ratio algorithm
864Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ )
865 : _geometry( geometry_ )
866{
867}
868void Magick::scaleImage::operator()( Magick::Image &image_ ) const
869{
870 image_.scale( _geometry );
871}
872
873// Segment (coalesce similar image components) by analyzing the
874// histograms of the color components and identifying units that are
875// homogeneous with the fuzzy c-means technique. Also uses
876// QuantizeColorSpace and Verbose image attributes
877Magick::segmentImage::segmentImage( const double clusterThreshold_ ,
878 const double smoothingThreshold_ )
879 : _clusterThreshold( clusterThreshold_ ),
880 _smoothingThreshold( smoothingThreshold_ )
881{
882}
883void Magick::segmentImage::operator()( Magick::Image &image_ ) const
884{
885 image_.segment( _clusterThreshold, _smoothingThreshold );
886}
887
888// Shade image using distant light source
cristya0242ab2009-10-15 19:17:14 +0000889Magick::shadeImage::shadeImage( const double azimuth_,
890 const double elevation_,
891 const bool colorShading_)
892 : _azimuth( azimuth_ ),
893 _elevation( elevation_ ),
894 _colorShading (colorShading_)
cristy3ed852e2009-09-05 21:47:34 +0000895{
896}
897void Magick::shadeImage::operator()( Magick::Image &image_ ) const
898{
cristyc8dd3c82009-10-15 19:40:55 +0000899 image_.shade( _azimuth, _elevation, _colorShading );
cristy3ed852e2009-09-05 21:47:34 +0000900}
901
902// Sharpen pixels in image
903Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ )
904 : _radius( radius_ ),
905 _sigma( sigma_ )
906{
907}
908void Magick::sharpenImage::operator()( Magick::Image &image_ ) const
909{
910 image_.sharpen( _radius, _sigma );
911}
912
913// Shave pixels from image edges.
914Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ )
915 : _geometry( geometry_ )
916{
917}
918void Magick::shaveImage::operator()( Magick::Image &image_ ) const
919{
920 image_.shave( _geometry );
921}
922
923// Shear image (create parallelogram by sliding image by X or Y axis)
924Magick::shearImage::shearImage( const double xShearAngle_,
925 const double yShearAngle_ )
926 : _xShearAngle( xShearAngle_ ),
927 _yShearAngle( yShearAngle_ )
928{
929}
930void Magick::shearImage::operator()( Magick::Image &image_ ) const
931{
932 image_.shear( _xShearAngle, _yShearAngle );
933}
934
935// Solarize image (similar to effect seen when exposing a photographic
936// film to light during the development process)
937Magick::solarizeImage::solarizeImage( const double factor_ )
938 : _factor( factor_ )
939{
940}
941void Magick::solarizeImage::operator()( Magick::Image &image_ ) const
942{
943 image_.solarize( _factor );
944}
945
946// Spread pixels randomly within image by specified ammount
947Magick::spreadImage::spreadImage( const unsigned int amount_ )
948 : _amount( amount_ )
949{
950}
951void Magick::spreadImage::operator()( Magick::Image &image_ ) const
952{
953 image_.spread( _amount );
954}
955
956// Add a digital watermark to the image (based on second image)
957Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ )
958 : _waterMark( waterMark_ )
959{
960}
961void Magick::steganoImage::operator()( Magick::Image &image_ ) const
962{
963 image_.stegano( _waterMark );
964}
965
966// Create an image which appears in stereo when viewed with red-blue
967// glasses (Red image on left, blue on right)
968Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ )
969 : _rightImage( rightImage_ )
970{
971}
972void Magick::stereoImage::operator()( Magick::Image &image_ ) const
973{
974 image_.stereo( _rightImage );
975}
976
977// Color to use when drawing object outlines
978Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ )
979 : _strokeColor( strokeColor_ )
980{
981}
982void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const
983{
984 image_.strokeColor( _strokeColor );
985}
986
987// Swirl image (image pixels are rotated by degrees)
988Magick::swirlImage::swirlImage( const double degrees_ )
989 : _degrees( degrees_ )
990{
991}
992void Magick::swirlImage::operator()( Magick::Image &image_ ) const
993{
994 image_.swirl( _degrees );
995}
996
997// Channel a texture on image background
998Magick::textureImage::textureImage( const Magick::Image &texture_ )
999 : _texture( texture_ )
1000{
1001}
1002void Magick::textureImage::operator()( Magick::Image &image_ ) const
1003{
1004 image_.texture( _texture );
1005}
1006
1007// Threshold image
1008Magick::thresholdImage::thresholdImage( const double threshold_ )
1009 : _threshold( threshold_ )
1010{
1011}
1012void Magick::thresholdImage::operator()( Magick::Image &image_ ) const
1013{
1014 image_.threshold( _threshold );
1015}
1016
1017// Transform image based on image and crop geometries
1018Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_ )
1019 : _imageGeometry( imageGeometry_ ),
1020 _cropGeometry( )
1021{
1022}
1023Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_,
1024 const Geometry &cropGeometry_ )
1025 : _imageGeometry( imageGeometry_ ),
1026 _cropGeometry( cropGeometry_ )
1027{
1028}
1029void Magick::transformImage::operator()( Magick::Image &image_ ) const
1030{
1031 if ( _cropGeometry.isValid() )
1032 image_.transform( _imageGeometry, _cropGeometry );
1033 else
1034 image_.transform( _imageGeometry );
1035}
1036
1037// Set image color to transparent
1038Magick::transparentImage::transparentImage( const Magick::Color& color_ )
1039 : _color( color_ )
1040{
1041}
1042void Magick::transparentImage::operator()( Magick::Image &image_ ) const
1043{
1044 image_.transparent( _color );
1045}
1046
1047// Trim edges that are the background color from the image
1048Magick::trimImage::trimImage( void )
1049{
1050}
1051void Magick::trimImage::operator()( Magick::Image &image_ ) const
1052{
1053 image_.trim( );
1054}
1055
1056// Map image pixels to a sine wave
1057Magick::waveImage::waveImage( const double amplitude_,
1058 const double wavelength_ )
1059 : _amplitude( amplitude_ ),
1060 _wavelength( wavelength_ )
1061{
1062}
1063void Magick::waveImage::operator()( Magick::Image &image_ ) const
1064{
1065 image_.wave( _amplitude, _wavelength );
1066}
1067
1068// resize image to specified size.
1069Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ )
1070 : _geometry( geometry_ )
1071{
1072}
1073void Magick::resizeImage::operator()( Magick::Image &image_ ) const
1074{
1075 image_.resize( _geometry );
1076}
1077
1078// Zoom image to specified size.
1079Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ )
1080 : _geometry( geometry_ )
1081{
1082}
1083void Magick::zoomImage::operator()( Magick::Image &image_ ) const
1084{
1085 image_.zoom( _geometry );
1086}
1087
1088//
1089// Function object image attribute accessors
1090//
1091
1092// Anti-alias Postscript and TrueType fonts (default true)
1093Magick::antiAliasImage::antiAliasImage( const bool flag_ )
1094 : _flag( flag_ )
1095{
1096}
1097void Magick::antiAliasImage::operator()( Magick::Image &image_ ) const
1098{
1099 image_.antiAlias( _flag );
1100}
1101
1102// Join images into a single multi-image file
1103Magick::adjoinImage::adjoinImage( const bool flag_ )
1104 : _flag( flag_ )
1105{
1106}
1107void Magick::adjoinImage::operator()( Magick::Image &image_ ) const
1108{
1109 image_.adjoin( _flag );
1110}
1111
1112// Time in 1/100ths of a second which must expire before displaying
1113// the next image in an animated sequence.
1114Magick::animationDelayImage::animationDelayImage( const unsigned int delay_ )
1115 : _delay( delay_ )
1116{
1117}
1118void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const
1119{
1120 image_.animationDelay( _delay );
1121}
1122
1123// Number of iterations to loop an animation (e.g. Netscape loop
1124// extension) for.
1125Magick::animationIterationsImage::animationIterationsImage( const unsigned int iterations_ )
1126 : _iterations( iterations_ )
1127{
1128}
1129void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const
1130{
1131 image_.animationIterations( _iterations );
1132}
1133
1134// Image background color
1135Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ )
1136 : _color( color_ )
1137{
1138}
1139void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const
1140{
1141 image_.backgroundColor( _color );
1142}
1143
1144// Name of texture image to tile onto the image background
1145Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ )
1146 : _backgroundTexture( backgroundTexture_ )
1147{
1148}
1149void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const
1150{
1151 image_.backgroundTexture( _backgroundTexture );
1152}
1153
1154// Image border color
1155Magick::borderColorImage::borderColorImage( const Magick::Color &color_ )
1156 : _color( color_ )
1157{
1158}
1159void Magick::borderColorImage::operator()( Magick::Image &image_ ) const
1160{
1161 image_.borderColor( _color );
1162}
1163
1164// Text bounding-box base color (default none)
1165Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ )
1166 : _boxColor( boxColor_ ) { }
1167
1168void Magick::boxColorImage::operator()( Magick::Image &image_ ) const
1169{
1170 image_.boxColor( _boxColor );
1171}
1172
1173// Chromaticity blue primary point (e.g. x=0.15, y=0.06)
1174Magick::chromaBluePrimaryImage::chromaBluePrimaryImage( const double x_,
1175 const double y_ )
1176 : _x( x_ ),
1177 _y( y_ )
1178{
1179}
1180void Magick::chromaBluePrimaryImage::operator()( Magick::Image &image_ ) const
1181{
1182 image_.chromaBluePrimary( _x, _y );
1183}
1184
1185// Chromaticity green primary point (e.g. x=0.3, y=0.6)
1186Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage( const double x_,
1187 const double y_ )
1188 : _x( x_ ),
1189 _y( y_ )
1190{
1191}
1192void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const
1193{
1194 image_.chromaGreenPrimary( _x, _y );
1195}
1196
1197// Chromaticity red primary point (e.g. x=0.64, y=0.33)
1198Magick::chromaRedPrimaryImage::chromaRedPrimaryImage( const double x_,
1199 const double y_ )
1200 : _x( x_ ),
1201 _y( y_ )
1202{
1203}
1204void Magick::chromaRedPrimaryImage::operator()( Magick::Image &image_ ) const
1205{
1206 image_.chromaRedPrimary( _x, _y );
1207}
1208
1209// Chromaticity white point (e.g. x=0.3127, y=0.329)
1210Magick::chromaWhitePointImage::chromaWhitePointImage( const double x_,
1211 const double y_ )
1212 : _x( x_ ),
1213 _y( y_ )
1214{
1215}
1216void Magick::chromaWhitePointImage::operator()( Magick::Image &image_ ) const
1217{
1218 image_.chromaWhitePoint( _x, _y );
1219}
1220
1221// Colors within this distance are considered equal
1222Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ )
1223 : _fuzz( fuzz_ )
1224{
1225}
1226void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const
1227{
1228 image_.colorFuzz( _fuzz );
1229}
1230
1231// Color at colormap position index_
1232Magick::colorMapImage::colorMapImage( const unsigned int index_,
1233 const Color &color_ )
1234 : _index( index_ ),
1235 _color( color_ )
1236{
1237}
1238void Magick::colorMapImage::operator()( Magick::Image &image_ ) const
1239{
1240 image_.colorMap( _index, _color );
1241}
1242
1243// Composition operator to be used when composition is implicitly used
1244// (such as for image flattening).
1245Magick::composeImage::composeImage( const CompositeOperator compose_ )
1246 : _compose( compose_ )
1247{
1248}
1249void Magick::composeImage::operator()( Magick::Image &image_ ) const
1250{
1251 image_.compose( _compose );
1252}
1253
1254// Compression type
1255Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ )
1256 : _compressType( compressType_ )
1257{
1258}
1259void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const
1260{
1261 image_.compressType( _compressType );
1262}
1263
1264// Vertical and horizontal resolution in pixels of the image
1265Magick::densityImage::densityImage( const Geometry &geomery_ )
1266 : _geomery( geomery_ )
1267{
1268}
1269void Magick::densityImage::operator()( Magick::Image &image_ ) const
1270{
1271 image_.density( _geomery );
1272}
1273
1274// Image depth (bits allocated to red/green/blue components)
1275Magick::depthImage::depthImage( const unsigned int depth_ )
1276 : _depth( depth_ )
1277{
1278}
1279void Magick::depthImage::operator()( Magick::Image &image_ ) const
1280{
1281 image_.depth( _depth );
1282}
1283
1284// Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image
1285// formats which support endian-specific options.
1286Magick::endianImage::endianImage( const Magick::EndianType endian_ )
1287 : _endian( endian_ )
1288{
1289}
1290void Magick::endianImage::operator()( Magick::Image &image_ ) const
1291{
1292 image_.endian( _endian );
1293}
1294
1295// Image file name
1296Magick::fileNameImage::fileNameImage( const std::string &fileName_ )
1297 : _fileName( fileName_ )
1298{
1299}
1300void Magick::fileNameImage::operator()( Magick::Image &image_ ) const
1301{
1302 image_.fileName( _fileName );
1303}
1304
1305// Filter to use when resizing image
1306Magick::filterTypeImage::filterTypeImage( const FilterTypes filterType_ )
1307 : _filterType( filterType_ )
1308{
1309}
1310void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const
1311{
1312 image_.filterType( _filterType );
1313}
1314
1315// Text rendering font
1316Magick::fontImage::fontImage( const std::string &font_ )
1317 : _font( font_ )
1318{
1319}
1320void Magick::fontImage::operator()( Magick::Image &image_ ) const
1321{
1322 image_.font( _font );
1323}
1324
1325// Font point size
1326Magick::fontPointsizeImage::fontPointsizeImage( const unsigned int pointsize_ )
1327 : _pointsize( pointsize_ )
1328{
1329}
1330void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const
1331{
1332 image_.fontPointsize( _pointsize );
1333}
1334
1335// GIF disposal method
1336Magick::gifDisposeMethodImage::gifDisposeMethodImage( const unsigned int disposeMethod_ )
1337 : _disposeMethod( disposeMethod_ )
1338{
1339}
1340void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const
1341{
1342 image_.gifDisposeMethod( _disposeMethod );
1343}
1344
1345// Type of interlacing to use
1346Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ )
1347 : _interlace( interlace_ )
1348{
1349}
1350void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const
1351{
1352 image_.interlaceType( _interlace );
1353}
1354
1355// Linewidth for drawing vector objects (default one)
1356Magick::lineWidthImage::lineWidthImage( const double lineWidth_ )
1357 : _lineWidth( lineWidth_ )
1358{
1359}
1360void Magick::lineWidthImage::operator()( Magick::Image &image_ ) const
1361{
1362 image_.lineWidth( _lineWidth );
1363}
1364
1365// File type magick identifier (.e.g "GIF")
1366Magick::magickImage::magickImage( const std::string &magick_ )
1367 : _magick( magick_ )
1368{
1369}
1370void Magick::magickImage::operator()( Magick::Image &image_ ) const
1371{
1372 image_.magick( _magick );
1373}
1374
1375// Image supports transparent color
1376Magick::matteImage::matteImage( const bool matteFlag_ )
1377 : _matteFlag( matteFlag_ )
1378{
1379}
1380void Magick::matteImage::operator()( Magick::Image &image_ ) const
1381{
1382 image_.matte( _matteFlag );
1383}
1384
1385// Transparent color
1386Magick::matteColorImage::matteColorImage( const Color &matteColor_ )
1387 : _matteColor( matteColor_ )
1388{
1389}
1390void Magick::matteColorImage::operator()( Magick::Image &image_ ) const
1391{
1392 image_.matteColor( _matteColor );
1393}
1394
1395// Indicate that image is black and white
1396Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ )
1397 : _monochromeFlag( monochromeFlag_ )
1398{
1399}
1400void Magick::monochromeImage::operator()( Magick::Image &image_ ) const
1401{
1402 image_.monochrome( _monochromeFlag );
1403}
1404
1405// Pen color
1406Magick::penColorImage::penColorImage( const Color &penColor_ )
1407 : _penColor( penColor_ )
1408{
1409}
1410void Magick::penColorImage::operator()( Magick::Image &image_ ) const
1411{
1412 image_.penColor( _penColor );
1413}
1414
1415// Pen texture image.
1416Magick::penTextureImage::penTextureImage( const Image &penTexture_ )
1417 : _penTexture( penTexture_ )
1418{
1419}
1420void Magick::penTextureImage::operator()( Magick::Image &image_ ) const
1421{
1422 image_.penTexture( _penTexture );
1423}
1424
1425// Set pixel color at location x & y.
1426Magick::pixelColorImage::pixelColorImage( const unsigned int x_,
1427 const unsigned int y_,
1428 const Color &color_)
1429 : _x( x_ ),
1430 _y( y_ ),
1431 _color( color_ ) { }
1432
1433void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const
1434{
1435 image_.pixelColor( _x, _y, _color );
1436}
1437
1438// Postscript page size.
1439Magick::pageImage::pageImage( const Geometry &pageSize_ )
1440 : _pageSize( pageSize_ )
1441{
1442}
1443void Magick::pageImage::operator()( Magick::Image &image_ ) const
1444{
1445 image_.page( _pageSize );
1446}
1447
1448// JPEG/MIFF/PNG compression level (default 75).
1449Magick::qualityImage::qualityImage( const unsigned int quality_ )
1450 : _quality( quality_ )
1451{
1452}
1453void Magick::qualityImage::operator()( Magick::Image &image_ ) const
1454{
1455 image_.quality( _quality );
1456}
1457
1458// Maximum number of colors to quantize to
1459Magick::quantizeColorsImage::quantizeColorsImage( const unsigned int colors_ )
1460 : _colors( colors_ )
1461{
1462}
1463void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const
1464{
1465 image_.quantizeColors( _colors );
1466}
1467
1468// Colorspace to quantize in.
1469Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ )
1470 : _colorSpace( colorSpace_ )
1471{
1472}
1473void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const
1474{
1475 image_.quantizeColorSpace( _colorSpace );
1476}
1477
1478// Dither image during quantization (default true).
1479Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ )
1480 : _ditherFlag( ditherFlag_ )
1481{
1482}
1483void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const
1484{
1485 image_.quantizeDither( _ditherFlag );
1486}
1487
1488// Quantization tree-depth
1489Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const unsigned int treeDepth_ )
1490 : _treeDepth( treeDepth_ ) { }
1491
1492void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const
1493{
1494 image_.quantizeTreeDepth( _treeDepth );
1495}
1496
1497// The type of rendering intent
1498Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ )
1499 : _renderingIntent( renderingIntent_ )
1500{
1501}
1502void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const
1503{
1504 image_.renderingIntent( _renderingIntent );
1505}
1506
1507// Units of image resolution
1508Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ )
1509 : _resolutionUnits( resolutionUnits_ )
1510{
1511}
1512void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const
1513{
1514 image_.resolutionUnits( _resolutionUnits );
1515}
1516
1517// Image scene number
1518Magick::sceneImage::sceneImage( const unsigned int scene_ )
1519 : _scene( scene_ )
1520{
1521}
1522void Magick::sceneImage::operator()( Magick::Image &image_ ) const
1523{
1524 image_.scene( _scene );
1525}
1526
1527// Width and height of a raw image
1528Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ )
1529 : _geometry( geometry_ )
1530{
1531}
1532void Magick::sizeImage::operator()( Magick::Image &image_ ) const
1533{
1534 image_.size( _geometry );
1535}
1536
cristy8198a752009-09-28 23:59:24 +00001537// Splice the background color into the image.
1538Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ )
1539 : _geometry( geometry_ )
1540{
1541}
1542void Magick::spliceImage::operator()( Magick::Image &image_ ) const
1543{
1544 image_.splice( _geometry );
1545}
1546
cristy3ed852e2009-09-05 21:47:34 +00001547// Subimage of an image sequence
1548Magick::subImageImage::subImageImage( const unsigned int subImage_ )
1549 : _subImage( subImage_ )
1550{
1551}
1552void Magick::subImageImage::operator()( Magick::Image &image_ ) const
1553{
1554 image_.subImage( _subImage );
1555}
1556
1557// Number of images relative to the base image
1558Magick::subRangeImage::subRangeImage( const unsigned int subRange_ )
1559 : _subRange( subRange_ )
1560{
1561}
1562void Magick::subRangeImage::operator()( Magick::Image &image_ ) const
1563{
1564 image_.subRange( _subRange );
1565}
1566
1567// Tile name
1568Magick::tileNameImage::tileNameImage( const std::string &tileName_ )
1569 : _tileName( tileName_ )
1570{
1571}
1572void Magick::tileNameImage::operator()( Magick::Image &image_ ) const
1573{
1574 image_.tileName( _tileName );
1575}
1576
1577// Image storage type
1578Magick::typeImage::typeImage( const Magick::ImageType type_ )
1579 : _type( type_ )
1580{
1581}
1582void Magick::typeImage::operator()( Magick::Image &image_ ) const
1583{
1584 image_.type( _type );
1585}
1586
1587// Print detailed information about the image
1588Magick::verboseImage::verboseImage( const bool verbose_ )
1589 : _verbose( verbose_ )
1590{
1591}
1592void Magick::verboseImage::operator()( Magick::Image &image_ ) const
1593{
1594 image_.verbose( _verbose );
1595}
1596
1597// FlashPix viewing parameters
1598Magick::viewImage::viewImage( const std::string &view_ )
1599 : _view( view_ ) { }
1600
1601void Magick::viewImage::operator()( Magick::Image &image_ ) const
1602{
1603 image_.view( _view );
1604}
1605
1606// X11 display to display to, obtain fonts from, or to capture image
1607// from
1608Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ )
1609 : _display( display_ )
1610{
1611}
1612void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const
1613{
1614 image_.x11Display( _display );
1615}