]> granicus.if.org Git - imagemagick/commitdiff
Fixed setting the gamma for each channel instead of only the red one.
authordirk <dirk@git.imagemagick.org>
Sun, 8 Feb 2015 13:12:27 +0000 (13:12 +0000)
committerdirk <dirk@git.imagemagick.org>
Sun, 8 Feb 2015 13:12:27 +0000 (13:12 +0000)
Magick++/lib/Image.cpp

index c09757d28755c58f8eefd6808a36793a8a3ed12b..3afa2e03636df5f953e731d32451020134c60a93 100644 (file)
@@ -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;
 }