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