From: dirk Date: Sun, 8 Feb 2015 13:12:27 +0000 (+0000) Subject: Fixed setting the gamma for each channel instead of only the red one. X-Git-Tag: 7.0.1-0~1316 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e2bdfa8375d6f4c069730085aa5e18b31b6ac62;p=imagemagick Fixed setting the gamma for each channel instead of only the red one. --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index c09757d28..3afa2e036 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -3104,15 +3104,15 @@ void Magick::Image::gamma(const double gamma_) void Magick::Image::gamma(const double gammaRed_,const double gammaGreen_, const double gammaBlue_) { - char - gamma[MaxTextExtent + 1]; - - FormatLocaleString(gamma,MaxTextExtent,"%3.6f/%3.6f/%3.6f/",gammaRed_, - gammaGreen_,gammaBlue_); - modifyImage(); GetPPException; - GammaImage(image(),atof(gamma),exceptionInfo); + GetAndSetPPChannelMask(RedChannel); + (void) GammaImage(image(),gammaRed_,exceptionInfo); + SetPPChannelMask(GreenChannel); + (void) GammaImage(image(),gammaGreen_,exceptionInfo); + SetPPChannelMask(BlueChannel); + (void) GammaImage(image(),gammaBlue_,exceptionInfo); + RestorePPChannelMask; ThrowImageException; }