diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-21 02:57:28 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-21 02:57:28 +0100 |
commit | bb1332aa418415eab6b5d731d8a4c1b84b36db77 (patch) | |
tree | 4368e1671459b61c122f42fdcd5610089cb69dcb /src/curve.py | |
parent | doc 0 param negative (diff) | |
download | blueshift-bb1332aa418415eab6b5d731d8a4c1b84b36db77.tar.gz blueshift-bb1332aa418415eab6b5d731d8a4c1b84b36db77.tar.bz2 blueshift-bb1332aa418415eab6b5d731d8a4c1b84b36db77.tar.xz |
rename negative to invert (mirror y) and add negative that reverses (mirror x)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/curve.py')
-rw-r--r-- | src/curve.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/curve.py b/src/curve.py index 6446a2a..001108f 100644 --- a/src/curve.py +++ b/src/curve.py @@ -336,7 +336,24 @@ def gamma(r, g = None, b = None): def negative(r = True, g = None, b = None): ''' - Invert the colour curves (negative image) + Revese the colour curves (negative image with gamma preservation) + + @param r:bool Whether to invert the red curve + @param g:bool? Whether to invert the green curve, defaults to `r` if `None` + @param b:bool? Whether to invert the blue curve, defaults to `r` if `None` + ''' + if g is None: g = r + if b is None: b = r + for (curve, setting) in curves(r, g, b): + if setting: + for i in range(i_size // 2): + j = i_size - 1 - i + curve[i], curve[j] = curve[j], curve[i] + + +def invert(r = True, g = None, b = None): + ''' + Invert the colour curves (negative image with gamma invertion) @param r:bool Whether to invert the red curve @param g:bool? Whether to invert the green curve, defaults to `r` if `None` |