From: dirk Date: Sat, 23 May 2015 07:33:03 +0000 (+0000) Subject: Added isOpaque to the Image class of Magick++. X-Git-Tag: 7.0.1-0~1014 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fbb0a3f139d16789fc2bcaaa4a547ff9d931ee1c;p=imagemagick Added isOpaque to the Image class of Magick++. --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 37db1fed0..84df690f2 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -1023,6 +1023,17 @@ Magick::Blob Magick::Image::iptcProfile(void) const iptc_profile))); } +bool Magick::Image::isOpaque(void) const +{ + MagickBooleanType + result; + + GetPPException; + result=IsImageOpaque(constImage(),exceptionInfo); + ThrowImageException; + return(result != MagickFalse ? true : false); +} + void Magick::Image::isValid(const bool isValid_) { if (!isValid_) diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index 772f148c7..afe37ce8b 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -297,6 +297,10 @@ namespace Magick void iptcProfile(const Blob &iptcProfile_); Blob iptcProfile(void) const; + // Returns true if none of the pixels in the image have an alpha value + // other than OpaqueAlpha (QuantumRange). + bool isOpaque(void) const; + // Does object contain valid image? void isValid(const bool isValid_); bool isValid(void) const; diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h index 792c251db..0f2ed51a8 100644 --- a/Magick++/lib/Magick++/Include.h +++ b/Magick++/lib/Magick++/Include.h @@ -1321,6 +1321,7 @@ namespace Magick using MagickCore::InvokeDynamicImageFilter; using MagickCore::IsEventLogging; using MagickCore::IsGeometry; + using MagickCore::IsImageOpaque; using MagickCore::IsImagesEqual; using MagickCore::KuwaharaImage; using MagickCore::LevelImage;