From 236765414d6dd0aca6ce7a3d720adcb9ab9b0597 Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Wed, 27 Apr 2011 22:41:18 +0200 Subject: Switch matte for alpha --- dmagick/Image.d | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'dmagick') diff --git a/dmagick/Image.d b/dmagick/Image.d index 30505b4..bea432a 100644 --- a/dmagick/Image.d +++ b/dmagick/Image.d @@ -392,6 +392,19 @@ class Image imageRef = ImageRef(image); } + /** + * Set a flag to indicate whether or not to use alpha channel data. + */ + void alpha(AlphaChannelType type) + { + SetImageAlphaChannel(imageRef, type); + } + ///ditto + bool alpha() const + { + GetImageAlphaChannel(imageRef); + } + /** * Number of ticks which must expire before displaying the * next image in an animated sequence. The default number @@ -1075,26 +1088,6 @@ class Image return options.magick; } - /** - * If true, honor the opacity values in the image pixels. - * If set True, store matte channel if the image - * has one otherwise create an opaque one. - */ - void matte(bool flag) - { - // If the image has a matte channel, and it's - // not desired set the matte channel to fully opaque. - if ( !flag && imageRef.matte ) - SetImageOpacity(imageRef, OpaqueOpacity); - - imageRef.matte = flag; - } - ///ditto - bool matte() const - { - return imageRef.matte != 0; - } - /** * Set the image transparent color. The default is "#bdbdbd". */ -- cgit v1.2.3