diff options
| author | Mike Wey | 2011-04-10 23:27:55 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-04-10 23:27:55 +0200 |
| commit | 9926bd87c9419d12bf97bab4075ce6aaf48a00a8 (patch) | |
| tree | 70ca59e668faf0d716378a44b0fc7d5d4a41418c | |
| parent | a0d566c119d9ed287d022a65c6ad85f3475b1a98 (diff) | |
A few more image Properties
| -rw-r--r-- | dmagick/Image.d | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/dmagick/Image.d b/dmagick/Image.d index 4653ae5..b4b6e00 100644 --- a/dmagick/Image.d +++ b/dmagick/Image.d @@ -875,6 +875,67 @@ class Image return options.magick; } + 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; + } + bool matte() const + { + return imageRef.matte; + } + + /** + * Set the image transparent color. The default is "#bdbdbd". + */ + void matteColor(string color) + { + matteColor = new Color(color); + } + ///ditto + void matteColor(Color color) + { + imageRef.matte_color = color.pixelPacket; + options.matteColor = color.pixelPacket; + } + ///ditto + Color matteColor() const + { + return new Color(imageRef.matte_color); + } + + double meanErrorPerPixel() const + { + return imageRef.error.mean_error_per_pixel; + } + + void modulusDepth(size_t depth) + { + SetImageDepth(imageRef, depth); + options.depth = depth; + } + size_t modulusDepth() const + { + ExceptionInfo* exception = AcquireExceptionInfo(); + size_t depth = GetImageDepth(imageRef, exception); + + DMagickException.throwException(exception); + DestroyExceptionInfo(exception); + + return depth; + } + + Geometry montageGeometry() const + { + return Geometry( to!(string)(imageRef.geometry) ); + } + + + size_t rows() const { return imageRef.rows; |
