diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp
index cf3653d..75062d0 100644
--- a/Magick++/lib/Image.cpp
+++ b/Magick++/lib/Image.cpp
@@ -571,6 +571,15 @@
(void) DestroyExceptionInfo( &exceptionInfo );
}
+// contains one or more color corrections and applies the correction to the
+// image.
+void Magick::Image::cdl ( const std::string &cdl_ )
+{
+ modifyImage();
+ (void) ColorDecisionListImage( image(), cdl_.c_str() );
+ throwImageException();
+}
+
// Colorize
void Magick::Image::colorize ( const unsigned int opacityRed_,
const unsigned int opacityGreen_,
@@ -737,15 +746,16 @@
// mapping color lookups of the source image to a new destination image
// usally of the same size as the source image, unless 'bestfit' is set to
// true.
-void Magick::Image::distort ( const DistortImageMethod method,
- const unsigned long number_arguments,
- const double *arguments,
- unsigned int bestfit )
+void Magick::Image::distort ( const DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_,
+ const bool bestfit_ )
{
ExceptionInfo exceptionInfo;
GetExceptionInfo( &exceptionInfo );
- MagickCore::Image* newImage = DistortImage ( image(), method,
- number_arguments, arguments, (MagickBooleanType) bestfit, &exceptionInfo );
+ MagickCore::Image* newImage = DistortImage ( image(), method_,
+ number_arguments_, arguments_, bestfit_ == true ? MagickTrue : MagickFalse,
+ &exceptionInfo );
replaceImage( newImage );
throwException( exceptionInfo );
(void) DestroyExceptionInfo( &exceptionInfo );
@@ -1120,6 +1130,14 @@
(void) DestroyExceptionInfo( &exceptionInfo );
}
+// Apply a color lookup table (Hald CLUT) to the image.
+void Magick::Image::haldClut ( const Image &clutImage_ )
+{
+ modifyImage();
+ (void) HaldClutImage( image(), clutImage_.constImage() );
+ throwImageException();
+}
+
// Implode image
void Magick::Image::implode ( const double factor_ )
{
@@ -1606,6 +1624,20 @@
(void) DestroyExceptionInfo( &exceptionInfo );
}
+// Apply a color matrix to the image channels. The user supplied
+// matrix may be of order 1 to 5 (1x1 through 5x5).
+void Magick::Image::recolor (const unsigned int order_,
+ const double *color_matrix_)
+{
+ ExceptionInfo exceptionInfo;
+ GetExceptionInfo( &exceptionInfo );
+ MagickCore::Image* newImage =
+ RecolorImage( image(), order_, color_matrix_, &exceptionInfo );
+ replaceImage( newImage );
+ throwException( exceptionInfo );
+ (void) DestroyExceptionInfo( &exceptionInfo );
+}
+
// Reduce noise in image
void Magick::Image::reduceNoise ( const double order_ )
{
diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h
index 418be41..26f9ca4 100644
--- a/Magick++/lib/Magick++/Image.h
+++ b/Magick++/lib/Magick++/Image.h
@@ -197,6 +197,11 @@
// horizontal or vertical subregion of image.
void chop ( const Geometry &geometry_ );
+
+ // Accepts a lightweight Color Correction Collection
+ // (CCC) file which solely contains one or more color corrections and
+ // applies the correction to the image.
+ void cdl ( const std::string &cdl_ );
// Colorize image with pen color, using specified percent opacity
// for red, green, and blue quantums
@@ -262,10 +267,10 @@
// mapping color lookups of the source image to a new destination image
// usally of the same size as the source image, unless 'bestfit' is set to
// true.
- void distort ( const DistortImageMethod method,
- const unsigned long number_arguments,
- const double *arguments,
- unsigned int bestfit = 0 );
+ void distort ( const DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_,
+ const bool bestfit_ = false );
// Draw on image using a single drawable
void draw ( const Drawable &drawable_ );
@@ -372,6 +377,10 @@
void gaussianBlurChannel ( const ChannelType channel_,
const double width_,
const double sigma_ );
+
+ // Apply a color lookup table (Hald CLUT) to the image.
+ void haldClut ( const Image &clutImage_ );
+
// Implode image (special effect)
void implode ( const double factor_ );
@@ -1089,6 +1098,11 @@
void quantizeTreeDepth ( const unsigned int treeDepth_ );
unsigned int quantizeTreeDepth ( void ) const;
+ // Apply a color matrix to the image channels. The user supplied
+ // matrix may be of order 1 to 5 (1x1 through 5x5).
+ void recolor (const unsigned int order_,
+ const double *color_matrix_);
+
// The type of rendering intent
void renderingIntent ( const RenderingIntent renderingIntent_ );
RenderingIntent renderingIntent ( void ) const;
diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h
index 7d2b347..c47d81a 100644
--- a/Magick++/lib/Magick++/Include.h
+++ b/Magick++/lib/Magick++/Include.h
@@ -564,6 +564,7 @@
using MagickCore::CoderError;
using MagickCore::CoderFatalError;
using MagickCore::CoderWarning;
+ using MagickCore::ColorDecisionListImage;
using MagickCore::ColorizeImage;
using MagickCore::ColorPacket;
using MagickCore::CompositeImage;
@@ -748,6 +749,7 @@
using MagickCore::GlobExpression;
using MagickCore::GravityAdjustGeometry;
using MagickCore::GreaterValue;
+ using MagickCore::HaldClutImage;
using MagickCore::HeightValue;
using MagickCore::ImageError;
using MagickCore::ImageFatalError;
@@ -820,6 +822,7 @@
using MagickCore::RaiseImage;
using MagickCore::RandomThresholdImageChannel;
using MagickCore::ReadImage;
+ using MagickCore::RecolorImage;
using MagickCore::RectangleInfo;
using MagickCore::ReduceNoiseImage;
using MagickCore::RegisterMagickInfo;
diff --git a/Magick++/lib/Magick++/STL.h b/Magick++/lib/Magick++/STL.h
index 432ac49..a3262ed 100644
--- a/Magick++/lib/Magick++/STL.h
+++ b/Magick++/lib/Magick++/STL.h
@@ -199,6 +199,20 @@
Geometry _geometry;
};
+ // Accepts a lightweight Color Correction Collection (CCC) file which solely
+ // contains one or more color corrections and applies the correction to the
+ // image.
+ class MagickDLLDecl cdlImage : public std::unary_function<Image&,void>
+ {
+ public:
+ cdlImage( const std::string &cdl_ );
+
+ void operator()( Image &image_ ) const;
+
+ private:
+ std::string _cdl;
+ };
+
// Colorize image using pen color at specified percent opacity
class MagickDLLDecl colorizeImage : public std::unary_function<Image&,void>
{
@@ -314,6 +328,31 @@
private:
};
+ // Distort image. distorts an image using various distortion methods, by
+ // mapping color lookups of the source image to a new destination image
+ // usally of the same size as the source image, unless 'bestfit' is set to
+ // true.
+ class MagickDLLDecl distortImage : public std::unary_function<Image&,void>
+ {
+ public:
+ distortImage( const Magick::DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_,
+ const bool bestfit_ );
+
+ distortImage( const Magick::DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_ );
+
+ void operator()( Image &image_ ) const;
+
+ private:
+ DistortImageMethod _method;
+ unsigned long _number_arguments;
+ const double *_arguments;
+ bool _bestfit;
+ };
+
// Draw on image
class MagickDLLDecl drawImage : public std::unary_function<Image&,void>
{
@@ -535,6 +574,18 @@
double _sigma;
};
+ // Apply a color lookup table (Hald CLUT) to the image.
+ class MagickDLLDecl haldClutImage : public std::unary_function<Image&,void>
+ {
+ public:
+ haldClutImage( const Image &haldClutImage_ );
+
+ void operator()( Image &image_ ) const;
+
+ private:
+ Image _haldClutImage;
+ };
+
// Implode image (special effect)
class MagickDLLDecl implodeImage : public std::unary_function<Image&,void>
{
@@ -787,6 +838,21 @@
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<Image&,void>
+ {
+ 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<Image&,void>
{
diff --git a/Magick++/lib/STL.cpp b/Magick++/lib/STL.cpp
index 7baef8e..d74b0d1 100644
--- a/Magick++/lib/STL.cpp
+++ b/Magick++/lib/STL.cpp
@@ -157,6 +157,18 @@
image_.chop( _geometry );
}
+// accepts a lightweight Color Correction Collection (CCC) file which solely
+// contains one or more color corrections and applies the correction to the
+// image.
+Magick::cdlImage::cdlImage( const std::string &cdl_ )
+ : _cdl ( cdl_ )
+{
+}
+void Magick::cdlImage::operator()( Image &image_ ) const
+{
+ image_.cdl( _cdl.c_str() );
+}
+
// Colorize image using pen color at specified percent opacity
Magick::colorizeImage::colorizeImage( const unsigned int opacityRed_,
const unsigned int opacityGreen_,
@@ -266,6 +278,34 @@
image_.despeckle( );
}
+// Distort image. distorts an image using various distortion methods, by
+// mapping color lookups of the source image to a new destination image
+// usally of the same size as the source image, unless 'bestfit' is set to
+// true.
+Magick::distortImage::distortImage( const Magick::DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_,
+ const bool bestfit_ )
+ : _method ( method_ ),
+ _number_arguments ( number_arguments_ ),
+ _arguments ( arguments_ ),
+ _bestfit( bestfit_ )
+{
+}
+Magick::distortImage::distortImage( const Magick::DistortImageMethod method_,
+ const unsigned long number_arguments_,
+ const double *arguments_ )
+ : _method ( method_ ),
+ _number_arguments ( number_arguments_ ),
+ _arguments ( arguments_ ),
+ _bestfit( false )
+{
+}
+void Magick::distortImage::operator()( Magick::Image &image_ ) const
+{
+ image_.distort( _method, _number_arguments, _arguments, _bestfit );
+}
+
// Draw on image
Magick::drawImage::drawImage( const Magick::Drawable &drawable_ )
: _drawableList()
@@ -520,6 +560,16 @@
image_.gaussianBlur( _width, _sigma );
}
+// Apply a color lookup table (Hald CLUT) to the image.
+Magick::haldClutImage::haldClutImage( const Image &haldClutImage_ )
+ : _haldClutImage ( haldClutImage_ )
+{
+}
+void Magick::haldClutImage::operator()( Image &image_ ) const
+{
+ image_.haldClut( _haldClutImage );
+}
+
// Implode image (special effect)
Magick::implodeImage::implodeImage( const double factor_ )
: _factor( factor_ )
@@ -734,6 +784,19 @@
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)