diff options
| author | Mike Wey | 2011-08-21 19:56:53 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-08-21 19:56:53 +0200 |
| commit | 38b47ebbaff4326800286b2a93579298be6578c6 (patch) | |
| tree | 3a1af4e91f3b8c00f9a567437f49148dc2f6708f /dmagick/ColorYUV.d | |
| parent | c1d158781cc242922663d12c4ad2ea6316093e65 (diff) | |
Add dmagick.ColorCMYK
Diffstat (limited to 'dmagick/ColorYUV.d')
| -rw-r--r-- | dmagick/ColorYUV.d | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dmagick/ColorYUV.d b/dmagick/ColorYUV.d index 16bc63a..19feebf 100644 --- a/dmagick/ColorYUV.d +++ b/dmagick/ColorYUV.d @@ -4,7 +4,7 @@ * Authors: Mike Wey */ -module dmagick.ColorRGB; +module dmagick.ColorYUV; import dmagick.Color; @@ -22,7 +22,7 @@ import dmagick.c.quantum; * The luminance component is sufficient for black-and-white TV sets, * whereas color TV sets need the additional chrominance information. */ -class ColorRGB : Color +class ColorYUV : Color { this() { @@ -130,7 +130,13 @@ class ColorRGB : Color * Convert an YUV value to a RGB value. */ private void convertYUVToRGB(double y, double u, double v, ref Quantum red, ref Quantum green, ref Quantum blue) + in { + assert(y <= 1 && y >= 0); + assert(u <= 1 && u >= 0); + assert(v <= 1 && v >= 0); + } + body { // ⌈R⌉ ⌈ 1.000 0.000 1.140⌉ ⌈Y⌉ // |G|=| 1.000 -0.395 -0.581|·|U| // ⌊B⌋ ⌊ 1.000 2.032 0.000⌋ ⌊V⌋ |
