diff options
-rwxr-xr-x | src/__main__.py | 1 | ||||
-rw-r--r-- | src/curve.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/__main__.py b/src/__main__.py index 6ad21ce..cee2f85 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -55,6 +55,7 @@ def periodically(year, month, day, hour, minute, second, weekday, fade): (**) See https://en.wikipedia.org/wiki/Leap_second ''' if fade is None: + negative(False, False, False) temperature(6500, lambda T : divide_by_maximum(series_d(T)), True) temperature(6500, lambda T : clip_whitepoint(simple_whitepoint(T)), True) temperature(6500, cmf_2deg, True) 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 |