summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--TODO2
-rw-r--r--src/aux.py18
2 files changed, 18 insertions, 2 deletions
diff --git a/TODO b/TODO
index 52c03c8..03026a0 100644
--- a/TODO
+++ b/TODO
@@ -4,8 +4,6 @@ High priority:
Medium priority:
Test, demo and document _ICC_PROFILE
- Add functions to store and restore curves so that we do not need
- to recalculate all filters before withs that are output specific.
Make it possible to have settings depend on sky condicitions.
(I have a GPL3 implmenetion of wheter observation in xpybar.)
diff --git a/src/aux.py b/src/aux.py
index cc91ef7..4645f85 100644
--- a/src/aux.py
+++ b/src/aux.py
@@ -64,3 +64,21 @@ def functionise(rgb):
curve[i] = cur[y]
return lambda : fcurve(*rgb)
+
+def store():
+ '''
+ Store the current adjustments
+
+ @return :(r:float, g:float, b:float) The colour curves
+ '''
+ return (r_curve[:], g_curve[:], b_curve[:])
+
+
+def restore(rgb):
+ '''
+ Discard any currently applied adjustments and apply stored adjustments
+
+ @param rgb:(r:float, g:float, b:float) The colour curves to restore
+ '''
+ (r_curve[:], g_curve[:], b_curve[:]) = rgb
+