1 // This may look like C code, but it is really -*- C++ -*-
3 // Copyright Bob Friesenhahn, 1999, 2002
5 // Implementation of STL classes and functions
8 #define MAGICKCORE_IMPLEMENTATION 1
9 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
11 #include <Magick++/Image.h>
12 #include <Magick++/STL.h>
14 // Adaptive-blur image with specified blur factor
15 Magick::adaptiveBlurImage::adaptiveBlurImage( const double radius_,
21 void Magick::adaptiveBlurImage::operator()( Magick::Image &image_ ) const
23 image_.adaptiveBlur( _radius, _sigma );
26 // Local adaptive threshold image
27 Magick::adaptiveThresholdImage::adaptiveThresholdImage( const size_t width_,
29 const ssize_t offset_ )
35 void Magick::adaptiveThresholdImage::operator()( Magick::Image &image_ ) const
37 image_.adaptiveThreshold( _width, _height, _offset );
40 // Add noise to image with specified noise type
41 Magick::addNoiseImage::addNoiseImage( Magick::NoiseType noiseType_ )
42 : _noiseType( noiseType_ )
45 void Magick::addNoiseImage::operator()( Magick::Image &image_ ) const
47 image_.addNoise( _noiseType );
50 // Transform image by specified affine (or free transform) matrix.
51 Magick::affineTransformImage::affineTransformImage( const DrawableAffine &affine_ )
55 void Magick::affineTransformImage::operator()( Magick::Image &image_ ) const
57 image_.affineTransform( _affine );
60 // Annotate image (draw text on image)
62 // Annotate using specified text, and placement location
63 Magick::annotateImage::annotateImage ( const std::string &text_,
64 const Magick::Geometry &geometry_ )
66 _geometry( geometry_ ),
67 _gravity( Magick::NorthWestGravity ),
71 // Annotate using specified text, bounding area, and placement gravity
72 Magick::annotateImage::annotateImage ( const std::string &text_,
73 const Magick::Geometry &geometry_,
74 const Magick::GravityType gravity_ )
76 _geometry( geometry_ ),
81 // Annotate with text using specified text, bounding area, placement
82 // gravity, and rotation.
83 Magick::annotateImage::annotateImage ( const std::string &text_,
84 const Magick::Geometry &geometry_,
85 const Magick::GravityType gravity_,
86 const double degrees_ )
88 _geometry( geometry_ ),
93 // Annotate with text (bounding area is entire image) and placement
95 Magick::annotateImage::annotateImage ( const std::string &text_,
96 const Magick::GravityType gravity_ )
103 void Magick::annotateImage::operator()( Magick::Image &image_ ) const
105 image_.annotate( _text, _geometry, _gravity, _degrees );
108 // Blur image with specified blur factor
109 Magick::blurImage::blurImage( const double radius_, const double sigma_ )
110 : _radius( radius_ ),
114 void Magick::blurImage::operator()( Magick::Image &image_ ) const
116 image_.blur( _radius, _sigma );
119 // Border image (add border to image)
120 Magick::borderImage::borderImage( const Magick::Geometry &geometry_ )
121 : _geometry( geometry_ )
124 void Magick::borderImage::operator()( Magick::Image &image_ ) const
126 image_.border( _geometry );
129 // Extract channel from image
130 Magick::channelImage::channelImage( const Magick::ChannelType channel_ )
131 : _channel( channel_ )
134 void Magick::channelImage::operator()( Magick::Image &image_ ) const
136 image_.channel( _channel );
139 // Charcoal effect image (looks like charcoal sketch)
140 Magick::charcoalImage::charcoalImage( const double radius_, const double sigma_ )
141 : _radius( radius_ ),
145 void Magick::charcoalImage::operator()( Magick::Image &image_ ) const
147 image_.charcoal( _radius, _sigma );
150 // Chop image (remove vertical or horizontal subregion of image)
151 Magick::chopImage::chopImage( const Magick::Geometry &geometry_ )
152 : _geometry( geometry_ )
155 void Magick::chopImage::operator()( Magick::Image &image_ ) const
157 image_.chop( _geometry );
160 // accepts a lightweight Color Correction Collection (CCC) file which solely
161 // contains one or more color corrections and applies the correction to the
163 Magick::cdlImage::cdlImage( const std::string &cdl_ )
167 void Magick::cdlImage::operator()( Image &image_ ) const
169 image_.cdl( _cdl.c_str() );
172 // Colorize image using pen color at specified percent alpha
173 Magick::colorizeImage::colorizeImage( const unsigned int alphaRed_,
174 const unsigned int alphaGreen_,
175 const unsigned int alphaBlue_,
176 const Magick::Color &penColor_ )
177 : _alphaRed ( alphaRed_ ),
178 _alphaGreen ( alphaGreen_ ),
179 _alphaBlue ( alphaBlue_ ),
180 _penColor( penColor_ )
183 Magick::colorizeImage::colorizeImage( const unsigned int alpha_,
184 const Magick::Color &penColor_ )
185 : _alphaRed ( alpha_ ),
186 _alphaGreen ( alpha_ ),
187 _alphaBlue ( alpha_ ),
188 _penColor( penColor_ )
191 void Magick::colorizeImage::operator()( Magick::Image &image_ ) const
193 image_.colorize( _alphaRed, _alphaGreen, _alphaBlue, _penColor );
196 // Apply a color matrix to the image channels. The user supplied
197 // matrix may be of order 1 to 5 (1x1 through 5x5).
198 Magick::colorMatrixImage::colorMatrixImage( const size_t order_,
199 const double *color_matrix_ )
201 _color_matrix( color_matrix_ )
204 void Magick::colorMatrixImage::operator()( Image &image_ ) const
206 image_.colorMatrix( _order, _color_matrix );
209 // Convert the image colorspace representation
210 Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ )
211 : _colorSpace( colorSpace_ )
214 void Magick::colorSpaceImage::operator()( Magick::Image &image_ ) const
216 image_.colorSpace( _colorSpace );
219 // Comment image (add comment string to image)
220 Magick::commentImage::commentImage( const std::string &comment_ )
221 : _comment( comment_ )
224 void Magick::commentImage::operator()( Magick::Image &image_ ) const
226 image_.comment( _comment );
229 // Compose an image onto another at specified offset and using
230 // specified algorithm
231 Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_,
234 Magick::CompositeOperator compose_ )
235 : _compositeImage( compositeImage_ ),
236 _xOffset ( xOffset_ ),
237 _yOffset ( yOffset_ ),
238 _compose ( compose_ )
241 Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_,
242 const Magick::Geometry &offset_,
243 Magick::CompositeOperator compose_ )
244 : _compositeImage( compositeImage_ ),
245 _xOffset ( offset_.xOff() ),
246 _yOffset ( offset_.yOff() ),
247 _compose ( compose_ )
250 void Magick::compositeImage::operator()( Image &image_ ) const
252 image_.composite( _compositeImage, _xOffset, _yOffset, _compose );
255 // Contrast image (enhance intensity differences in image)
256 Magick::contrastImage::contrastImage( const size_t sharpen_ )
257 : _sharpen( sharpen_ )
260 void Magick::contrastImage::operator()( Magick::Image &image_ ) const
262 image_.contrast( _sharpen );
265 // Crop image (subregion of original image)
266 Magick::cropImage::cropImage( const Magick::Geometry &geometry_ )
267 : _geometry( geometry_ )
270 void Magick::cropImage::operator()( Magick::Image &image_ ) const
272 image_.crop( _geometry );
275 // Cycle image colormap
276 Magick::cycleColormapImage::cycleColormapImage( const ssize_t amount_ )
280 void Magick::cycleColormapImage::operator()( Magick::Image &image_ ) const
282 image_.cycleColormap( _amount );
285 // Despeckle image (reduce speckle noise)
286 Magick::despeckleImage::despeckleImage( void )
289 void Magick::despeckleImage::operator()( Magick::Image &image_ ) const
294 // Distort image. distorts an image using various distortion methods, by
295 // mapping color lookups of the source image to a new destination image
296 // usally of the same size as the source image, unless 'bestfit' is set to
298 Magick::distortImage::distortImage( const Magick::DistortImageMethod method_,
299 const size_t number_arguments_,
300 const double *arguments_,
301 const bool bestfit_ )
302 : _method ( method_ ),
303 _number_arguments ( number_arguments_ ),
304 _arguments ( arguments_ ),
308 Magick::distortImage::distortImage( const Magick::DistortImageMethod method_,
309 const size_t number_arguments_,
310 const double *arguments_ )
311 : _method ( method_ ),
312 _number_arguments ( number_arguments_ ),
313 _arguments ( arguments_ ),
317 void Magick::distortImage::operator()( Magick::Image &image_ ) const
319 image_.distort( _method, _number_arguments, _arguments, _bestfit );
323 Magick::drawImage::drawImage( const Magick::Drawable &drawable_ )
326 _drawableList.push_back( drawable_ );
328 Magick::drawImage::drawImage( const std::list<Magick::Drawable> &drawable_ )
329 : _drawableList( drawable_ )
332 void Magick::drawImage::operator()( Magick::Image &image_ ) const
334 image_.draw( _drawableList );
337 // Edge image (hilight edges in image)
338 Magick::edgeImage::edgeImage( const double radius_ )
342 void Magick::edgeImage::operator()( Magick::Image &image_ ) const
344 image_.edge( _radius );
347 // Emboss image (hilight edges with 3D effect)
348 Magick::embossImage::embossImage( void )
353 Magick::embossImage::embossImage( const double radius_, const double sigma_ )
354 : _radius( radius_ ),
358 void Magick::embossImage::operator()( Magick::Image &image_ ) const
360 image_.emboss( _radius, _sigma );
363 // Enhance image (minimize noise)
364 Magick::enhanceImage::enhanceImage( void )
367 void Magick::enhanceImage::operator()( Magick::Image &image_ ) const
372 // Equalize image (histogram equalization)
373 Magick::equalizeImage::equalizeImage( void )
376 void Magick::equalizeImage::operator()( Magick::Image &image_ ) const
381 // Color to use when filling drawn objects
382 Magick::fillColorImage::fillColorImage( const Magick::Color &fillColor_ )
383 : _fillColor( fillColor_ )
386 void Magick::fillColorImage::operator()( Magick::Image &image_ ) const
388 image_.fillColor( _fillColor );
391 // Flip image (reflect each scanline in the vertical direction)
392 Magick::flipImage::flipImage( void )
395 void Magick::flipImage::operator()( Magick::Image &image_ ) const
400 // Flood-fill image with color
401 // Flood-fill color across pixels starting at target-pixel and
402 // stopping at pixels matching specified border color. Uses current
403 // fuzz setting when determining color match.
404 Magick::floodFillColorImage::floodFillColorImage( const ssize_t x_,
406 const Magick::Color &fillColor_ )
409 _fillColor(fillColor_),
413 Magick::floodFillColorImage::floodFillColorImage( const Magick::Geometry &point_,
414 const Magick::Color &fillColor_ )
417 _fillColor(fillColor_),
421 // Flood-fill color across pixels starting at target-pixel and
422 // stopping at pixels matching specified border color. Uses current
423 // fuzz setting when determining color match.
424 Magick::floodFillColorImage::floodFillColorImage( const ssize_t x_,
426 const Magick::Color &fillColor_,
427 const Magick::Color &borderColor_ )
430 _fillColor(fillColor_),
431 _borderColor(borderColor_)
434 Magick::floodFillColorImage::floodFillColorImage( const Geometry &point_,
435 const Color &fillColor_,
436 const Color &borderColor_ )
439 _fillColor(fillColor_),
440 _borderColor(borderColor_)
443 void Magick::floodFillColorImage::operator()( Magick::Image &image_ ) const
445 if ( _borderColor.isValid() )
447 image_.floodFillColor( _x, _y, _fillColor, _borderColor );
451 image_.floodFillColor( _x, _y, _fillColor );
455 // Flood-fill image with texture
457 // Flood-fill texture across pixels that match the color of the target
458 // pixel and are neighbors of the target pixel. Uses current fuzz
459 // setting when determining color match.
460 Magick::floodFillTextureImage::floodFillTextureImage( const ssize_t x_,
462 const Magick::Image &texture_ )
469 Magick::floodFillTextureImage::floodFillTextureImage( const Magick::Geometry &point_,
470 const Magick::Image &texture_ )
477 // Flood-fill texture across pixels starting at target-pixel and
478 // stopping at pixels matching specified border color. Uses current
479 // fuzz setting when determining color match.
480 Magick::floodFillTextureImage::floodFillTextureImage( const ssize_t x_,
482 const Magick::Image &texture_,
483 const Magick::Color &borderColor_ )
487 _borderColor(borderColor_)
490 Magick::floodFillTextureImage::floodFillTextureImage( const Magick::Geometry &point_,
491 const Magick::Image &texture_,
492 const Magick::Color &borderColor_ )
496 _borderColor(borderColor_)
499 void Magick::floodFillTextureImage::operator()( Magick::Image &image_ ) const
501 if ( _borderColor.isValid() )
503 image_.floodFillTexture( _x, _y, _texture, _borderColor );
507 image_.floodFillTexture( _x, _y, _texture );
511 // Flop image (reflect each scanline in the horizontal direction)
512 Magick::flopImage::flopImage( void )
515 void Magick::flopImage::operator()( Magick::Image &image_ ) const
521 Magick::frameImage::frameImage( const Magick::Geometry &geometry_ )
522 : _width( geometry_.width() ),
523 _height( geometry_.height() ),
524 _outerBevel( geometry_.xOff() ),
525 _innerBevel( geometry_.yOff() )
528 Magick::frameImage::frameImage( const size_t width_, const size_t height_,
529 const ssize_t innerBevel_, const ssize_t outerBevel_ )
532 _outerBevel( outerBevel_ ),
533 _innerBevel( innerBevel_ )
536 void Magick::frameImage::operator()( Magick::Image &image_ ) const
538 image_.frame( _width, _height, _innerBevel, _outerBevel );
541 // Gamma correct image
542 Magick::gammaImage::gammaImage( const double gamma_ )
543 : _gammaRed( gamma_ ),
544 _gammaGreen( gamma_ ),
548 Magick::gammaImage::gammaImage ( const double gammaRed_,
549 const double gammaGreen_,
550 const double gammaBlue_ )
551 : _gammaRed( gammaRed_ ),
552 _gammaGreen( gammaGreen_ ),
553 _gammaBlue( gammaBlue_ )
556 void Magick::gammaImage::operator()( Magick::Image &image_ ) const
558 image_.gamma( _gammaRed, _gammaGreen, _gammaBlue );
561 // Gaussian blur image
562 // The number of neighbor pixels to be included in the convolution
563 // mask is specified by 'width_'. The standard deviation of the
564 // gaussian bell curve is specified by 'sigma_'.
565 Magick::gaussianBlurImage::gaussianBlurImage( const double width_,
566 const double sigma_ )
571 void Magick::gaussianBlurImage::operator()( Magick::Image &image_ ) const
573 image_.gaussianBlur( _width, _sigma );
576 // Apply a color lookup table (Hald CLUT) to the image.
577 Magick::haldClutImage::haldClutImage( const Image &haldClutImage_ )
578 : _haldClutImage ( haldClutImage_ )
581 void Magick::haldClutImage::operator()( Image &image_ ) const
583 image_.haldClut( _haldClutImage );
586 // Implode image (special effect)
587 Magick::implodeImage::implodeImage( const double factor_ )
591 void Magick::implodeImage::operator()( Magick::Image &image_ ) const
593 image_.implode( _factor );
596 // Implements the inverse discrete Fourier transform (IFT) of the image
597 // either as a magnitude / phase or real / imaginary image pair.
598 Magick::inverseFourierTransformImage::inverseFourierTransformImage( const Magick::Image &phaseImage_ )
599 : _phaseImage( phaseImage_ )
602 void Magick::inverseFourierTransformImage::operator()( Magick::Image &image_ ) const
604 image_.inverseFourierTransform( _phaseImage );
607 // Set image validity. Valid images become empty (inValid) if argument
609 Magick::isValidImage::isValidImage( const bool isValid_ )
610 : _isValid( isValid_ )
613 void Magick::isValidImage::operator()( Magick::Image &image_ ) const
615 image_.isValid( _isValid );
619 Magick::labelImage::labelImage( const std::string &label_ )
623 void Magick::labelImage::operator()( Magick::Image &image_ ) const
625 image_.label( _label );
629 Magick::levelImage::levelImage( const double black_point,
630 const double white_point,
631 const double mid_point )
632 : _black_point(black_point),
633 _white_point(white_point),
634 _mid_point(mid_point)
637 void Magick::levelImage::operator()( Magick::Image &image_ ) const
639 image_.level( _black_point, _white_point, _mid_point );
642 // Magnify image by integral size
643 Magick::magnifyImage::magnifyImage( void )
646 void Magick::magnifyImage::operator()( Magick::Image &image_ ) const
651 // Remap image colors with closest color from reference image
652 Magick::mapImage::mapImage( const Magick::Image &mapImage_ ,
654 : _mapImage( mapImage_ ),
658 void Magick::mapImage::operator()( Magick::Image &image_ ) const
660 image_.map( _mapImage, _dither );
663 // Floodfill designated area with a matte value
664 Magick::alphaFloodfillImage::alphaFloodfillImage( const Color &target_ ,
665 const unsigned int alpha_,
666 const ssize_t x_, const ssize_t y_,
667 const PaintMethod method_ )
668 : _target( target_ ),
675 void Magick::alphaFloodfillImage::operator()( Magick::Image &image_ ) const
677 image_.alphaFloodfill( _target, _alpha, _x, _y, _method );
680 // Filter image by replacing each pixel component with the median
681 // color in a circular neighborhood
682 Magick::medianConvolveImage::medianConvolveImage( const double radius_ )
686 void Magick::medianConvolveImage::operator()( Magick::Image &image_ ) const
688 image_.medianFilter( _radius );
691 // Reduce image by integral size
692 Magick::minifyImage::minifyImage( void )
695 void Magick::minifyImage::operator()( Magick::Image &image_ ) const
700 // Modulate percent hue, saturation, and brightness of an image
701 Magick::modulateImage::modulateImage( const double brightness_,
702 const double saturation_,
704 : _brightness( brightness_ ),
705 _saturation( saturation_ ),
709 void Magick::modulateImage::operator()( Magick::Image &image_ ) const
711 image_.modulate( _brightness, _saturation, _hue );
714 // Negate colors in image. Set grayscale to only negate grayscale
716 Magick::negateImage::negateImage( const bool grayscale_ )
717 : _grayscale( grayscale_ )
720 void Magick::negateImage::operator()( Magick::Image &image_ ) const
722 image_.negate( _grayscale );
725 // Normalize image (increase contrast by normalizing the pixel values
726 // to span the full range of color values)
727 Magick::normalizeImage::normalizeImage( void )
730 void Magick::normalizeImage::operator()( Magick::Image &image_ ) const
735 // Oilpaint image (image looks like oil painting)
736 Magick::oilPaintImage::oilPaintImage( const double radius_ )
740 void Magick::oilPaintImage::operator()( Magick::Image &image_ ) const
742 image_.oilPaint( _radius );
745 // Set or attenuate the image alpha channel. If the image pixels are
746 // opaque then they are set to the specified alpha value, otherwise
747 // they are blended with the supplied alpha value. The value of
748 // alpha_ ranges from 0 (completely opaque) to QuantumRange. The defines
749 // OpaqueAlpha and TransparentAlpha are available to specify
750 // completely opaque or completely transparent, respectively.
751 Magick::alphaImage::alphaImage( const unsigned int alpha_ )
755 void Magick::alphaImage::operator()( Magick::Image &image_ ) const
757 image_.alpha( _alpha );
760 // Change color of opaque pixel to specified pen color.
761 Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_,
762 const Magick::Color &penColor_ )
763 : _opaqueColor( opaqueColor_ ),
764 _penColor( penColor_ )
767 void Magick::opaqueImage::operator()( Magick::Image &image_ ) const
769 image_.opaque( _opaqueColor, _penColor );
772 // Quantize image (reduce number of colors)
773 Magick::quantizeImage::quantizeImage( const bool measureError_ )
774 : _measureError( measureError_ )
777 void Magick::quantizeImage::operator()( Image &image_ ) const
779 image_.quantize( _measureError );
782 // Raise image (lighten or darken the edges of an image to give a 3-D
783 // raised or lowered effect)
784 Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ ,
785 const bool raisedFlag_ )
786 : _geometry( geometry_ ),
787 _raisedFlag( raisedFlag_ )
790 void Magick::raiseImage::operator()( Magick::Image &image_ ) const
792 image_.raise( _geometry, _raisedFlag );
795 // Reduce noise in image using a noise peak elimination filter
796 Magick::reduceNoiseImage::reduceNoiseImage( void )
800 Magick::reduceNoiseImage::reduceNoiseImage ( const size_t order_ )
804 void Magick::reduceNoiseImage::operator()( Image &image_ ) const
806 image_.reduceNoise( _order );
809 // Roll image (rolls image vertically and horizontally) by specified
810 // number of columnms and rows)
811 Magick::rollImage::rollImage( const Magick::Geometry &roll_ )
812 : _columns( roll_.width() ),
813 _rows( roll_.height() )
816 Magick::rollImage::rollImage( const ssize_t columns_,
817 const ssize_t rows_ )
818 : _columns( columns_ ),
822 void Magick::rollImage::operator()( Magick::Image &image_ ) const
824 image_.roll( _columns, _rows );
827 // Rotate image counter-clockwise by specified number of degrees.
828 Magick::rotateImage::rotateImage( const double degrees_ )
829 : _degrees( degrees_ )
832 void Magick::rotateImage::operator()( Magick::Image &image_ ) const
834 image_.rotate( _degrees );
837 // Resize image by using pixel sampling algorithm
838 Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ )
839 : _geometry( geometry_ )
842 void Magick::sampleImage::operator()( Magick::Image &image_ ) const
844 image_.sample( _geometry );
847 // Resize image by using simple ratio algorithm
848 Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ )
849 : _geometry( geometry_ )
852 void Magick::scaleImage::operator()( Magick::Image &image_ ) const
854 image_.scale( _geometry );
857 // Segment (coalesce similar image components) by analyzing the
858 // histograms of the color components and identifying units that are
859 // homogeneous with the fuzzy c-means technique. Also uses
860 // QuantizeColorSpace and Verbose image attributes
861 Magick::segmentImage::segmentImage( const double clusterThreshold_ ,
862 const double smoothingThreshold_ )
863 : _clusterThreshold( clusterThreshold_ ),
864 _smoothingThreshold( smoothingThreshold_ )
867 void Magick::segmentImage::operator()( Magick::Image &image_ ) const
869 image_.segment( _clusterThreshold, _smoothingThreshold );
872 // Shade image using distant light source
873 Magick::shadeImage::shadeImage( const double azimuth_,
874 const double elevation_,
875 const bool colorShading_)
876 : _azimuth( azimuth_ ),
877 _elevation( elevation_ ),
878 _colorShading (colorShading_)
881 void Magick::shadeImage::operator()( Magick::Image &image_ ) const
883 image_.shade( _azimuth, _elevation, _colorShading );
886 // Simulate an image shadow
887 Magick::shadowImage::shadowImage( const double percent_opacity_,
889 const ssize_t x_, const ssize_t y_ )
890 : _percent_opacity( percent_opacity_ ),
896 void Magick::shadowImage::operator()( Magick::Image &image_ ) const
898 image_.shadow( _percent_opacity, _sigma, _x, _y );
901 // Sharpen pixels in image
902 Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ )
903 : _radius( radius_ ),
907 void Magick::sharpenImage::operator()( Magick::Image &image_ ) const
909 image_.sharpen( _radius, _sigma );
912 // Shave pixels from image edges.
913 Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ )
914 : _geometry( geometry_ )
917 void Magick::shaveImage::operator()( Magick::Image &image_ ) const
919 image_.shave( _geometry );
922 // Shear image (create parallelogram by sliding image by X or Y axis)
923 Magick::shearImage::shearImage( const double xShearAngle_,
924 const double yShearAngle_ )
925 : _xShearAngle( xShearAngle_ ),
926 _yShearAngle( yShearAngle_ )
929 void Magick::shearImage::operator()( Magick::Image &image_ ) const
931 image_.shear( _xShearAngle, _yShearAngle );
934 // Solarize image (similar to effect seen when exposing a photographic
935 // film to light during the development process)
936 Magick::solarizeImage::solarizeImage( const double factor_ )
940 void Magick::solarizeImage::operator()( Magick::Image &image_ ) const
942 image_.solarize( _factor );
945 // Spread pixels randomly within image by specified ammount
946 Magick::spreadImage::spreadImage( const size_t amount_ )
950 void Magick::spreadImage::operator()( Magick::Image &image_ ) const
952 image_.spread( _amount );
955 // Add a digital watermark to the image (based on second image)
956 Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ )
957 : _waterMark( waterMark_ )
960 void Magick::steganoImage::operator()( Magick::Image &image_ ) const
962 image_.stegano( _waterMark );
965 // Create an image which appears in stereo when viewed with red-blue
966 // glasses (Red image on left, blue on right)
967 Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ )
968 : _rightImage( rightImage_ )
971 void Magick::stereoImage::operator()( Magick::Image &image_ ) const
973 image_.stereo( _rightImage );
976 // Color to use when drawing object outlines
977 Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ )
978 : _strokeColor( strokeColor_ )
981 void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const
983 image_.strokeColor( _strokeColor );
986 // Swirl image (image pixels are rotated by degrees)
987 Magick::swirlImage::swirlImage( const double degrees_ )
988 : _degrees( degrees_ )
991 void Magick::swirlImage::operator()( Magick::Image &image_ ) const
993 image_.swirl( _degrees );
996 // Channel a texture on image background
997 Magick::textureImage::textureImage( const Magick::Image &texture_ )
998 : _texture( texture_ )
1001 void Magick::textureImage::operator()( Magick::Image &image_ ) const
1003 image_.texture( _texture );
1007 Magick::thresholdImage::thresholdImage( const double threshold_ )
1008 : _threshold( threshold_ )
1011 void Magick::thresholdImage::operator()( Magick::Image &image_ ) const
1013 image_.threshold( _threshold );
1016 // Transform image based on image and crop geometries
1017 Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_ )
1018 : _imageGeometry( imageGeometry_ ),
1022 Magick::transformImage::transformImage( const Magick::Geometry &imageGeometry_,
1023 const Geometry &cropGeometry_ )
1024 : _imageGeometry( imageGeometry_ ),
1025 _cropGeometry( cropGeometry_ )
1028 void Magick::transformImage::operator()( Magick::Image &image_ ) const
1030 if ( _cropGeometry.isValid() )
1031 image_.transform( _imageGeometry, _cropGeometry );
1033 image_.transform( _imageGeometry );
1036 // Set image color to transparent
1037 Magick::transparentImage::transparentImage( const Magick::Color& color_ )
1041 void Magick::transparentImage::operator()( Magick::Image &image_ ) const
1043 image_.transparent( _color );
1046 // Trim edges that are the background color from the image
1047 Magick::trimImage::trimImage( void )
1050 void Magick::trimImage::operator()( Magick::Image &image_ ) const
1055 // Map image pixels to a sine wave
1056 Magick::waveImage::waveImage( const double amplitude_,
1057 const double wavelength_ )
1058 : _amplitude( amplitude_ ),
1059 _wavelength( wavelength_ )
1062 void Magick::waveImage::operator()( Magick::Image &image_ ) const
1064 image_.wave( _amplitude, _wavelength );
1067 // resize image to specified size.
1068 Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ )
1069 : _geometry( geometry_ )
1072 void Magick::resizeImage::operator()( Magick::Image &image_ ) const
1074 image_.resize( _geometry );
1077 // Zoom image to specified size.
1078 Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ )
1079 : _geometry( geometry_ )
1082 void Magick::zoomImage::operator()( Magick::Image &image_ ) const
1084 image_.zoom( _geometry );
1088 // Function object image attribute accessors
1091 // Anti-alias Postscript and TrueType fonts (default true)
1092 Magick::antiAliasImage::antiAliasImage( const bool flag_ )
1096 void Magick::antiAliasImage::operator()( Magick::Image &image_ ) const
1098 image_.antiAlias( _flag );
1101 // Join images into a single multi-image file
1102 Magick::adjoinImage::adjoinImage( const bool flag_ )
1106 void Magick::adjoinImage::operator()( Magick::Image &image_ ) const
1108 image_.adjoin( _flag );
1111 // Time in 1/100ths of a second which must expire before displaying
1112 // the next image in an animated sequence.
1113 Magick::animationDelayImage::animationDelayImage( const size_t delay_ )
1117 void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const
1119 image_.animationDelay( _delay );
1122 // Number of iterations to loop an animation (e.g. Netscape loop
1124 Magick::animationIterationsImage::animationIterationsImage( const size_t iterations_ )
1125 : _iterations( iterations_ )
1128 void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const
1130 image_.animationIterations( _iterations );
1133 // Image background color
1134 Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ )
1138 void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const
1140 image_.backgroundColor( _color );
1143 // Name of texture image to tile onto the image background
1144 Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ )
1145 : _backgroundTexture( backgroundTexture_ )
1148 void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const
1150 image_.backgroundTexture( _backgroundTexture );
1153 // Image border color
1154 Magick::borderColorImage::borderColorImage( const Magick::Color &color_ )
1158 void Magick::borderColorImage::operator()( Magick::Image &image_ ) const
1160 image_.borderColor( _color );
1163 // Text bounding-box base color (default none)
1164 Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ )
1165 : _boxColor( boxColor_ ) { }
1167 void Magick::boxColorImage::operator()( Magick::Image &image_ ) const
1169 image_.boxColor( _boxColor );
1172 // Chromaticity blue primary point (e.g. x=0.15, y=0.06)
1173 Magick::chromaBluePrimaryImage::chromaBluePrimaryImage( const double x_,
1179 void Magick::chromaBluePrimaryImage::operator()( Magick::Image &image_ ) const
1181 image_.chromaBluePrimary( _x, _y );
1184 // Chromaticity green primary point (e.g. x=0.3, y=0.6)
1185 Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage( const double x_,
1191 void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const
1193 image_.chromaGreenPrimary( _x, _y );
1196 // Chromaticity red primary point (e.g. x=0.64, y=0.33)
1197 Magick::chromaRedPrimaryImage::chromaRedPrimaryImage( const double x_,
1203 void Magick::chromaRedPrimaryImage::operator()( Magick::Image &image_ ) const
1205 image_.chromaRedPrimary( _x, _y );
1208 // Chromaticity white point (e.g. x=0.3127, y=0.329)
1209 Magick::chromaWhitePointImage::chromaWhitePointImage( const double x_,
1215 void Magick::chromaWhitePointImage::operator()( Magick::Image &image_ ) const
1217 image_.chromaWhitePoint( _x, _y );
1220 // Colors within this distance are considered equal
1221 Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ )
1225 void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const
1227 image_.colorFuzz( _fuzz );
1230 // Color at colormap position index_
1231 Magick::colorMapImage::colorMapImage( const size_t index_,
1232 const Color &color_ )
1237 void Magick::colorMapImage::operator()( Magick::Image &image_ ) const
1239 image_.colorMap( _index, _color );
1242 // Composition operator to be used when composition is implicitly used
1243 // (such as for image flattening).
1244 Magick::composeImage::composeImage( const CompositeOperator compose_ )
1245 : _compose( compose_ )
1248 void Magick::composeImage::operator()( Magick::Image &image_ ) const
1250 image_.compose( _compose );
1254 Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ )
1255 : _compressType( compressType_ )
1258 void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const
1260 image_.compressType( _compressType );
1263 // Vertical and horizontal resolution in pixels of the image
1264 Magick::densityImage::densityImage( const Geometry &geomery_ )
1265 : _geomery( geomery_ )
1268 void Magick::densityImage::operator()( Magick::Image &image_ ) const
1270 image_.density( _geomery );
1273 // Image depth (bits allocated to red/green/blue components)
1274 Magick::depthImage::depthImage( const size_t depth_ )
1278 void Magick::depthImage::operator()( Magick::Image &image_ ) const
1280 image_.depth( _depth );
1283 // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image
1284 // formats which support endian-specific options.
1285 Magick::endianImage::endianImage( const Magick::EndianType endian_ )
1286 : _endian( endian_ )
1289 void Magick::endianImage::operator()( Magick::Image &image_ ) const
1291 image_.endian( _endian );
1295 Magick::fileNameImage::fileNameImage( const std::string &fileName_ )
1296 : _fileName( fileName_ )
1299 void Magick::fileNameImage::operator()( Magick::Image &image_ ) const
1301 image_.fileName( _fileName );
1304 // Filter to use when resizing image
1305 Magick::filterTypeImage::filterTypeImage( const FilterTypes filterType_ )
1306 : _filterType( filterType_ )
1309 void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const
1311 image_.filterType( _filterType );
1314 // Text rendering font
1315 Magick::fontImage::fontImage( const std::string &font_ )
1319 void Magick::fontImage::operator()( Magick::Image &image_ ) const
1321 image_.font( _font );
1325 Magick::fontPointsizeImage::fontPointsizeImage( const size_t pointsize_ )
1326 : _pointsize( pointsize_ )
1329 void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const
1331 image_.fontPointsize( _pointsize );
1334 // GIF disposal method
1335 Magick::gifDisposeMethodImage::gifDisposeMethodImage( const DisposeType disposeMethod_ )
1336 : _disposeMethod( disposeMethod_ )
1339 void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const
1341 image_.gifDisposeMethod( _disposeMethod );
1344 // Type of interlacing to use
1345 Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ )
1346 : _interlace( interlace_ )
1349 void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const
1351 image_.interlaceType( _interlace );
1354 // File type magick identifier (.e.g "GIF")
1355 Magick::magickImage::magickImage( const std::string &magick_ )
1356 : _magick( magick_ )
1359 void Magick::magickImage::operator()( Magick::Image &image_ ) const
1361 image_.magick( _magick );
1364 // Image supports transparent color
1365 Magick::alphaFlagImage::alphaFlagImage( const bool alphaFlag_ )
1366 : _alphaFlag( alphaFlag_ )
1369 void Magick::alphaFlagImage::operator()( Magick::Image &image_ ) const
1371 image_.alpha( _alphaFlag );
1374 // Transparent color
1375 Magick::alphaColorImage::alphaColorImage( const Color &alphaColor_ )
1376 : _alphaColor( alphaColor_ )
1379 void Magick::alphaColorImage::operator()( Magick::Image &image_ ) const
1381 image_.alphaColor( _alphaColor );
1384 // Indicate that image is black and white
1385 Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ )
1386 : _monochromeFlag( monochromeFlag_ )
1389 void Magick::monochromeImage::operator()( Magick::Image &image_ ) const
1391 image_.monochrome( _monochromeFlag );
1394 // Set pixel color at location x & y.
1395 Magick::pixelColorImage::pixelColorImage( const ssize_t x_,
1397 const Color &color_)
1400 _color( color_ ) { }
1402 void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const
1404 image_.pixelColor( _x, _y, _color );
1407 // Postscript page size.
1408 Magick::pageImage::pageImage( const Geometry &pageSize_ )
1409 : _pageSize( pageSize_ )
1412 void Magick::pageImage::operator()( Magick::Image &image_ ) const
1414 image_.page( _pageSize );
1417 // JPEG/MIFF/PNG compression level (default 75).
1418 Magick::qualityImage::qualityImage( const size_t quality_ )
1419 : _quality( quality_ )
1422 void Magick::qualityImage::operator()( Magick::Image &image_ ) const
1424 image_.quality( _quality );
1427 // Maximum number of colors to quantize to
1428 Magick::quantizeColorsImage::quantizeColorsImage( const size_t colors_ )
1429 : _colors( colors_ )
1432 void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const
1434 image_.quantizeColors( _colors );
1437 // Colorspace to quantize in.
1438 Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ )
1439 : _colorSpace( colorSpace_ )
1442 void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const
1444 image_.quantizeColorSpace( _colorSpace );
1447 // Dither image during quantization (default true).
1448 Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ )
1449 : _ditherFlag( ditherFlag_ )
1452 void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const
1454 image_.quantizeDither( _ditherFlag );
1457 // Quantization tree-depth
1458 Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const size_t treeDepth_ )
1459 : _treeDepth( treeDepth_ ) { }
1461 void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const
1463 image_.quantizeTreeDepth( _treeDepth );
1466 // The type of rendering intent
1467 Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ )
1468 : _renderingIntent( renderingIntent_ )
1471 void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const
1473 image_.renderingIntent( _renderingIntent );
1476 // Units of image resolution
1477 Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ )
1478 : _resolutionUnits( resolutionUnits_ )
1481 void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const
1483 image_.resolutionUnits( _resolutionUnits );
1486 // Image scene number
1487 Magick::sceneImage::sceneImage( const size_t scene_ )
1491 void Magick::sceneImage::operator()( Magick::Image &image_ ) const
1493 image_.scene( _scene );
1496 // Width and height of a raw image
1497 Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ )
1498 : _geometry( geometry_ )
1501 void Magick::sizeImage::operator()( Magick::Image &image_ ) const
1503 image_.size( _geometry );
1506 // Splice the background color into the image.
1507 Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ )
1508 : _geometry( geometry_ )
1511 void Magick::spliceImage::operator()( Magick::Image &image_ ) const
1513 image_.splice( _geometry );
1516 // stripImage strips an image of all profiles and comments.
1517 Magick::stripImage::stripImage( void )
1520 void Magick::stripImage::operator()( Magick::Image &image_ ) const
1525 // Subimage of an image sequence
1526 Magick::subImageImage::subImageImage( const size_t subImage_ )
1527 : _subImage( subImage_ )
1530 void Magick::subImageImage::operator()( Magick::Image &image_ ) const
1532 image_.subImage( _subImage );
1535 // Number of images relative to the base image
1536 Magick::subRangeImage::subRangeImage( const size_t subRange_ )
1537 : _subRange( subRange_ )
1540 void Magick::subRangeImage::operator()( Magick::Image &image_ ) const
1542 image_.subRange( _subRange );
1545 // Image storage type
1546 Magick::typeImage::typeImage( const Magick::ImageType type_ )
1550 void Magick::typeImage::operator()( Magick::Image &image_ ) const
1552 image_.type( _type );
1555 // Print detailed information about the image
1556 Magick::verboseImage::verboseImage( const bool verbose_ )
1557 : _verbose( verbose_ )
1560 void Magick::verboseImage::operator()( Magick::Image &image_ ) const
1562 image_.verbose( _verbose );
1565 // FlashPix viewing parameters
1566 Magick::viewImage::viewImage( const std::string &view_ )
1567 : _view( view_ ) { }
1569 void Magick::viewImage::operator()( Magick::Image &image_ ) const
1571 image_.view( _view );
1574 // X11 display to display to, obtain fonts from, or to capture image
1576 Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ )
1577 : _display( display_ )
1580 void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const
1582 image_.x11Display( _display );