diff options
| author | Mike Wey | 2011-07-17 20:22:10 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-07-17 20:22:10 +0200 |
| commit | 3ea114fc80284ae3d32764765a96f34d6910d397 (patch) | |
| tree | d727e55b843e0a84c0eaac191f491713f8a75c92 /dmagick/Geometry.d | |
| parent | bd91f8f1e8aedbb8d892463cb67ec66ffce55458 (diff) | |
Add Geometry.toAbsolute, resample, resize, roll, rotate, sample, scale, segment, selectiveBlur and sepiatone.
Diffstat (limited to 'dmagick/Geometry.d')
| -rw-r--r-- | dmagick/Geometry.d | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dmagick/Geometry.d b/dmagick/Geometry.d index 2ccab99..261c691 100644 --- a/dmagick/Geometry.d +++ b/dmagick/Geometry.d @@ -120,6 +120,28 @@ struct Geometry assert( geo.toString == "200x150!-50+25"); } + /** + * Calculate the absolute width and height based on the flags, + * and the profided width and height. + */ + Geometry toAbsolute(size_t width, size_t height) + { + ssize_t x, y; + + ParseMetaGeometry(toStringz(toString()), &x, &y, &width, &height); + + return Geometry(width, height, x, y); + } + + unittest + { + Geometry percentage = Geometry("50%"); + Geometry absolute = percentage.toAbsolute(100, 100); + + assert(absolute.width == 50); + assert(absolute.height == 50); + } + RectangleInfo rectangleInfo() { RectangleInfo info; |
