]> granicus.if.org Git - imagemagick/commitdiff
Added new method to check if an image contains a specific channel.
authordirk <dirk@git.imagemagick.org>
Thu, 29 Jan 2015 18:47:05 +0000 (18:47 +0000)
committerdirk <dirk@git.imagemagick.org>
Thu, 29 Jan 2015 18:47:05 +0000 (18:47 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Image.h
Magick++/lib/Magick++/Include.h

index 66fefe5a34949e420406b76466d0bf6aaf29e1cc..559fc001393d3a8118b3062107a59b929e8e817d 100644 (file)
@@ -960,6 +960,11 @@ MagickCore::DisposeType Magick::Image::gifDisposeMethod(void) const
   return(constImage()->dispose);
 }
 
+bool Magick::Image::hasChannel(const PixelChannel channel) const
+{
+  return (GetPixelChannelTraits(constImage(),channel) != UndefinedPixelTrait);
+}
+
 void Magick::Image::highlightColor(const Color color_)
 {
   std::string
index bd9005be95a9b5a53f5b5d0e500f8083df4c9010..17ff6bf946bd98b35b11d902738ae8add69049d9 100644 (file)
@@ -276,6 +276,8 @@ namespace Magick
     void gifDisposeMethod(const DisposeType disposeMethod_);
     DisposeType gifDisposeMethod(void) const;
 
+    bool hasChannel(const PixelChannel channel) const;
+
     // When comparing images, emphasize pixel differences with this color.
     void highlightColor(const Color color_);
 
index 48d9b09696404a4df3b1f18775e89b7d2dfec5a2..39a269f4ad0e5b89aab1a0e574beba4dc3d22d02 100644 (file)
@@ -1270,6 +1270,7 @@ namespace Magick
   using MagickCore::GetNextValueInLinkedList;
   using MagickCore::GetNumberOfElementsInLinkedList;
   using MagickCore::GetPixelBlue;
+  using MagickCore::GetPixelChannelTraits;
   using MagickCore::GetPixelGreen;
   using MagickCore::GetPixelInfo;
   using MagickCore::GetPixelRed;