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