From: cristy Date: Fri, 2 Apr 2010 20:59:26 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9705 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e959b608107ad7ddfc226f8a299ff053d68aa20;p=imagemagick --- diff --git a/Magick++/lib/Magick++/STL.h b/Magick++/lib/Magick++/STL.h index 101c9360f..6449b2f74 100644 --- a/Magick++/lib/Magick++/STL.h +++ b/Magick++/lib/Magick++/STL.h @@ -234,6 +234,19 @@ namespace Magick Color _penColor; }; + // Apply a color matrix to the image channels. The user supplied + // matrix may be of order 1 to 5 (1x1 through 5x5). + class MagickDLLDecl colorMatrixImage : public std::unary_function + { + public: + colorMatrixImage( const KernelInfo *color_matrix_ ); + + void operator()( Image &image_ ) const; + + private: + const KernelInfo *_color_matrix; + }; + // Convert the image colorspace representation class MagickDLLDecl colorSpaceImage : public std::unary_function { @@ -851,21 +864,6 @@ namespace Magick bool _raisedFlag; }; - // Apply a color matrix to the image channels. The user supplied - // matrix may be of order 1 to 5 (1x1 through 5x5). - class MagickDLLDecl recolorImage : public std::unary_function - { - public: - recolorImage( const unsigned int order_, - const double *color_matrix_ ); - - void operator()( Image &image_ ) const; - - private: - unsigned int _order; - const double *_color_matrix; - }; - // Reduce noise in image using a noise peak elimination filter class MagickDLLDecl reduceNoiseImage : public std::unary_function { diff --git a/Magick++/lib/STL.cpp b/Magick++/lib/STL.cpp index 17b80f72a..37e8d8f87 100644 --- a/Magick++/lib/STL.cpp +++ b/Magick++/lib/STL.cpp @@ -193,6 +193,17 @@ void Magick::colorizeImage::operator()( Magick::Image &image_ ) const image_.colorize( _opacityRed, _opacityGreen, _opacityBlue, _penColor ); } +// Apply a color matrix to the image channels. The user supplied +// matrix may be of order 1 to 6 (1x1 through 6x6). +Magick::colorMatrixImage::colorMatrixImage( const KernelInfo *color_matrix_ ) + : _color_matrix( color_matrix_ ) +{ +} +void Magick::colorMatrixImage::operator()( Image &image_ ) const +{ + image_.colorMatrix( _color_matrix ); +} + // Convert the image colorspace representation Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ ) : _colorSpace( colorSpace_ ) @@ -795,19 +806,6 @@ void Magick::raiseImage::operator()( Magick::Image &image_ ) const image_.raise( _geometry, _raisedFlag ); } -// Apply a color matrix to the image channels. The user supplied -// matrix may be of order 1 to 5 (1x1 through 5x5). -Magick::recolorImage::recolorImage( const unsigned int order_, - const double *color_matrix_ ) - : _order( order_ ), - _color_matrix( color_matrix_ ) -{ -} -void Magick::recolorImage::operator()( Image &image_ ) const -{ - image_.recolor( _order, _color_matrix ); -} - // Reduce noise in image using a noise peak elimination filter Magick::reduceNoiseImage::reduceNoiseImage( void ) : _order(3)