summaryrefslogtreecommitdiffstats
path: root/src/curve.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-15 21:31:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-15 21:31:30 +0100
commite71ff4d62dc4ca7c6a134d24ce4ef829670c23cb (patch)
treec49d3aa88592d6b971ef0724315a2dbac5ff9e9a /src/curve.py
parentprototype for randr usage: inverts the colours (diff)
downloadblueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.gz
blueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.bz2
blueshift-e71ff4d62dc4ca7c6a134d24ce4ef829670c23cb.tar.xz
add negative
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/curve.py')
-rw-r--r--src/curve.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/curve.py b/src/curve.py
index 8a6b28c..34adf29 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -263,6 +263,20 @@ def gamma(r, g, b):
curve[i] **= level
+def negative(r, g, b):
+ '''
+ Invert the colour curves (negative image)
+
+ @param r:bool Whether to invert the red curve
+ @param g:bool Whether to invert the green curve
+ @param b:bool Whether to invert the blue curve
+ '''
+ for (curve, setting) in curves(r, g, b):
+ if setting:
+ for i in range(i_size):
+ curve[i] = 1 - curve[i]
+
+
def sigmoid(r, g, b):
'''
Apply S-curve correction on the colour curves