summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-16 18:31:01 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-16 18:31:01 +0100
commitda67a3b4652dfd8f61999e83b43896a23cc08fc5 (patch)
tree081b8bf95c2268ed1b50ed1fb762dbf21a582682
parentcie_invert takes only one argument (diff)
downloadblueshift-da67a3b4652dfd8f61999e83b43896a23cc08fc5.tar.gz
blueshift-da67a3b4652dfd8f61999e83b43896a23cc08fc5.tar.bz2
blueshift-da67a3b4652dfd8f61999e83b43896a23cc08fc5.tar.xz
fix cie_invert
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--examples/lisp-esque2
-rw-r--r--examples/lisp-esque.conf19
-rw-r--r--info/blueshift.texinfo10
-rw-r--r--src/curve.py11
4 files changed, 25 insertions, 17 deletions
diff --git a/examples/lisp-esque b/examples/lisp-esque
index 0ec3551..61e1586 100644
--- a/examples/lisp-esque
+++ b/examples/lisp-esque
@@ -496,7 +496,7 @@ class CIEInvert:
def __init__(self):
self.monitors = [(False, False, False, False, False, False)]
def __call__(self, monitor, alpha):
- cie_invert(self.monitors[monitor][3 if alpha == 0 else 0])
+ cie_invert(*(self.monitors[monitor][3 if alpha == 0 else 0:][:3]))
def _invert(mods, args):
'''
diff --git a/examples/lisp-esque.conf b/examples/lisp-esque.conf
index 4e6a8e1..19ee95c 100644
--- a/examples/lisp-esque.conf
+++ b/examples/lisp-esque.conf
@@ -132,15 +132,16 @@
; The two above combined: (icc:filter (nil nil nil) (nil nil nil))
; Negative image settings.
- (negative no) ; Does nothing
- ; (negative yes) ; Inverts the colours on the encoding axes
- ; (negative) ; Synonym for the above
- ; (negative (yes no no)) ; Inverts the red colour on the encoding axis
- ; (negative yes no) ; Inverts the colours on the encoding axes on the first monitor
- ; ; but not the second monitor selected by (monitors)
- ; (invert yes) ; Inverts the colours on the output axes using the sRGB colour space
- ; (invert (yes no no)) ; Inverts the red colour on the output axes using the sRGB colour space
- ; (invert:cie yes) ; Inverts the colours on the output axes using the CIE xyY colour space
+ (negative no) ; Does nothing
+ ; (negative yes) ; Inverts the colours on the encoding axes
+ ; (negative) ; Synonym for the above
+ ; (negative (yes no no)) ; Inverts the red colour on the encoding axis
+ ; (negative yes no) ; Inverts the colours on the encoding axes on the first monitor
+ ; ; but not the second monitor selected by (monitors)
+ ; (invert yes) ; Inverts the colours on the output axes using the sRGB colour space
+ ; (invert (yes no no)) ; Inverts the red colour on the output axes using the sRGB colour space
+ ; (invert:cie yes) ; Inverts the colours on the output axes using the CIE xyY colour space
+ ; (invert:cie (yes no no)) ; Inverts the red colour on the output axes using the CIE xyY colour space
; These cannot be time dependent.
; Colour temperature at high day and high night, respectively.
diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo
index 8570ccf..7ea6686 100644
--- a/info/blueshift.texinfo
+++ b/info/blueshift.texinfo
@@ -510,10 +510,16 @@ are @code{True}, respectively.
Inverts the all values on the colour curves
using the CIE xyY colour space instead of sRGB.
-@item cie_invert(y)
+@item cie_invert(rgb)
Inverts the all values on the colour curves
using the CIE xyY colour space instead of sRGB,
-if @code{y} is @code{true}.
+if @code{rgb} is @code{true}.
+
+@item cie_invert(r, g, b)
+Inverts the all values on the red, green and
+blue curves using the CIE xyY colour space
+instead of sRGB if @code{r}, @code{g} and
+@code{b} are @code{True}, respectively.
@item sigmoid(r, g, b)
An inverted sigmoid curve function is applied
diff --git a/src/curve.py b/src/curve.py
index cac2b53..23a77cb 100644
--- a/src/curve.py
+++ b/src/curve.py
@@ -389,11 +389,12 @@ def cie_invert(r = True, g = None, b = 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):
- (x, y, Y) = srgb_to_ciexyy(r_curve[i], g_curve[i], b_curve[i])
- (r_curve[i], g_curve[i], b_curve[i]) = ciexyy_to_srgb(x, y, 1 - Y)
+ for i in range(i_size):
+ (x, y, Y) = srgb_to_ciexyy(r_curve[i], g_curve[i], b_curve[i])
+ (r_, g_, b_) = ciexyy_to_srgb(x, y, 1 - Y)
+ if r: r_curve[i] = r_
+ if g: g_curve[i] = g_
+ if b: b_curve[i] = b_
def sigmoid(r, g, b):