From: dirk Date: Thu, 8 Oct 2015 12:42:57 +0000 (+0200) Subject: Added inverse option to the transparent method. X-Git-Tag: 7.0.1-0~572 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fcdcaf5f27967318e07808b67498cceac3b4125;p=imagemagick Added inverse option to the transparent method. --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 28c508b52..fe6d47e01 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -4639,7 +4639,7 @@ void Magick::Image::transformScale(const double sx_,const double sy_) options()->transformScale(sx_,sy_); } -void Magick::Image::transparent(const Color &color_) +void Magick::Image::transparent(const Color &color_,const bool inverse_) { PixelInfo target; @@ -4656,8 +4656,8 @@ void Magick::Image::transparent(const Color &color_) (void) QueryColorCompliance(color.c_str(),AllCompliance,&target, exceptionInfo); modifyImage(); - TransparentPaintImage(image(),&target,TransparentAlpha,MagickFalse, - exceptionInfo); + TransparentPaintImage(image(),&target,TransparentAlpha, + inverse_ == true ? MagickTrue : MagickFalse,exceptionInfo); ThrowImageException; } diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index e32c50133..27dfc5163 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -1415,7 +1415,7 @@ namespace Magick // Add matte image to image, setting pixels matching color to // transparent - void transparent(const Color &color_); + void transparent(const Color &color_,const bool inverse_=false); // Add matte image to image, for all the pixels that lies in between // the given two color