]> granicus.if.org Git - imagemagick/commitdiff
Added perceptibleChannel to Magick++.
authordirk <dirk@git.imagemagick.org>
Sat, 10 Aug 2013 07:55:41 +0000 (07:55 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 10 Aug 2013 07:55:41 +0000 (07:55 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Image.h

index a9bc76653a3a7f71ad4763cec1d63879c8b3d754..14b9704cc7ad95114954832d22a6d6a1ef752578 100644 (file)
@@ -1951,6 +1951,19 @@ void Magick::Image::perceptible ( const double epsilon_ )
   (void) DestroyExceptionInfo( &exceptionInfo );
 }
 
+void Magick::Image::perceptibleChannel ( const ChannelType channel_,
+                                         const double epsilon_ )
+{
+  modifyImage();
+  ExceptionInfo exceptionInfo;
+  GetExceptionInfo( &exceptionInfo );
+  ChannelType channel_mask = SetImageChannelMask( image(), channel_ );
+  PerceptibleImage( image(), epsilon_, &exceptionInfo );
+  SetPixelChannelMask( image(), channel_mask );
+  throwException( exceptionInfo );
+  (void) DestroyExceptionInfo( &exceptionInfo );
+}
+
 // Ping is similar to read except only enough of the image is read to
 // determine the image columns, rows, and filesize.  Access the
 // columns(), rows(), and fileSize() attributes after invoking ping.
index 206c46c7afb061e1d835aea773c724f832e216bf..27306da3f4814b91bbfdd696cea3226e40481d1e 100644 (file)
@@ -611,6 +611,8 @@ namespace Magick
     // -epsilon (whichever is closer) otherwise the pixel value remains
     // unchanged.
     void            perceptible ( const double epsilon_ );
+    void            perceptibleChannel ( const ChannelType channel_,
+                                         const double epsilon_ );
 
     // Ping is similar to read except only enough of the image is read
     // to determine the image columns, rows, and filesize.  Access the