]> granicus.if.org Git - imagemagick/commitdiff
Added isOpaque to the Image class of Magick++.
authordirk <dirk@git.imagemagick.org>
Sat, 23 May 2015 07:33:03 +0000 (07:33 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 23 May 2015 07:33:03 +0000 (07:33 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Image.h
Magick++/lib/Magick++/Include.h

index 37db1fed0787ef2feed4d62bd9986d92f7d9f8d1..84df690f2f443bc7709ccb8eb144da45ace4ef77 100644 (file)
@@ -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_)
index 772f148c7a06819cbb4cbd70d99550d77432156f..afe37ce8bf08e4b009ed56362fa966f25326bbc5 100644 (file)
@@ -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;
index 792c251dbb3186f1ef74683f61f916792008c371..0f2ed51a8c777fa3c2c05d9768fd572b33cfb142 100644 (file)
@@ -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;