]> granicus.if.org Git - imagemagick/commitdiff
Added alphaChannel to Magick++.
authordirk <dirk@git.imagemagick.org>
Fri, 9 Aug 2013 21:14:11 +0000 (21:14 +0000)
committerdirk <dirk@git.imagemagick.org>
Fri, 9 Aug 2013 21:14:11 +0000 (21:14 +0000)
Magick++/lib/Image.cpp
Magick++/lib/Magick++/Image.h
Magick++/lib/Magick++/Include.h

index 647fbe933ea6caf29c6e95c67c121978fa34da89..a9bc76653a3a7f71ad4763cec1d63879c8b3d754 100644 (file)
@@ -434,6 +434,16 @@ void Magick::Image::alpha ( const unsigned int alpha_ )
   (void) DestroyExceptionInfo( &exceptionInfo );
 }
 
+void Magick::Image::alphaChannel ( AlphaChannelOption alphaOption_ )
+{
+  modifyImage();
+  ExceptionInfo exceptionInfo;
+  GetExceptionInfo( &exceptionInfo );
+  SetImageAlphaChannel( image(), alphaOption_, &exceptionInfo );
+  throwException( exceptionInfo );
+  (void) DestroyExceptionInfo( &exceptionInfo );
+}
+
 // Annotate using specified text, and placement location
 void Magick::Image::annotate ( const std::string &text_,
                                const Geometry &location_ )
index 2515a601eca34af27c663b66c210f37b353d0c07..206c46c7afb061e1d835aea773c724f832e216bf 100644 (file)
@@ -154,6 +154,10 @@ namespace Magick
     // transparent, respectively.
     void            alpha ( const unsigned int alpha_ );
 
+    // AlphaChannel() activates, deactivates, resets, or sets the alpha
+    // channel.
+    void            alphaChannel ( AlphaChannelOption alphaOption_ );
+
     //
     // Annotate image (draw text on image)
     //
index 69c1d24b0c7008c9516198a4a1c3b2c29ced5cd2..1a8e08af495b71de00b7ffd42e28f175cab9440f 100644 (file)
@@ -231,6 +231,20 @@ namespace Magick
   using MagickCore::MagickFalse;
   using MagickCore::MagickTrue;
 
+  // Alpha channel options
+  using MagickCore::AlphaChannelOption;
+  using MagickCore::UndefinedAlphaChannel;
+  using MagickCore::ActivateAlphaChannel;
+  using MagickCore::BackgroundAlphaChannel;
+  using MagickCore::CopyAlphaChannel;
+  using MagickCore::DeactivateAlphaChannel;
+  using MagickCore::ExtractAlphaChannel;
+  using MagickCore::OpaqueAlphaChannel;
+  using MagickCore::RemoveAlphaChannel;
+  using MagickCore::SetAlphaChannel;
+  using MagickCore::ShapeAlphaChannel;
+  using MagickCore::TransparentAlphaChannel;
+
   // Image class types
   using MagickCore::ClassType;
   using MagickCore::UndefinedClass;