summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-05 14:50:10 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-05 14:50:10 +0200
commite69bfe4385280adf528f0802f43cd53f509c1ca6 (patch)
treeeafe0472d01b17dcaae6b4217010c500941ce698
parentdoc (diff)
downloadblueshift-e69bfe4385280adf528f0802f43cd53f509c1ca6.tar.gz
blueshift-e69bfe4385280adf528f0802f43cd53f509c1ca6.tar.bz2
blueshift-e69bfe4385280adf528f0802f43cd53f509c1ca6.tar.xz
derp + demo interpolation1.16
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--examples/comprehensive22
1 files changed, 19 insertions, 3 deletions
diff --git a/examples/comprehensive b/examples/comprehensive
index dcde526..580d0bf 100644
--- a/examples/comprehensive
+++ b/examples/comprehensive
@@ -131,7 +131,7 @@ def apply_curves(*crtcs, screen = 0):
@param screen:int The screen to which the monitors belong
'''
# Single display and single server, variant:
- (apply_curves_tty if ttymode apply_curves_x)(*crtcs, screen = screen)
+ (apply_curves_tty if ttymode else apply_curves_x)(*crtcs, screen = screen)
# Variant for TTY and all X display:
#apply_curves_tty(*crtcs, screen = screen)
@@ -315,7 +315,15 @@ for i in range(len(current_calibration)):
if f is not None:
if not len(monitors) == 0:
m = monitors[i % len(monitors)]
- current_calibration[i] = f(m)
+ f = f(m)
+
+ # Use linear interpolation
+ f = interpolate_function(f, linearly_interpolate_ramp)
+ # Use cubic interpolation
+ #f = interpolate_function(f, cubicly_interpolate_ramp)
+ # Otherwise use nearest-neighbour
+
+ current_calibration[i] = f
monitor_controller = lambda : apply_curves(*monitors)
@@ -489,7 +497,15 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
i = m % len(icc_calibration_profile)
if icc_calibration_profile[i] is not None:
if isinstance(icc_calibration_profile[i], str):
- icc_calibration_profile[i] = load_icc(icc_calibration_profile[i])
+ f = load_icc(icc_calibration_profile[i])
+
+ # Use linear interpolation
+ f = interpolate_function(f, linearly_interpolate_ramp)
+ # Use cubic interpolation
+ #f = interpolate_function(f, cubicly_interpolate_ramp)
+ # Otherwise use nearest-neighbour
+
+ icc_calibration_profile[i] = f
icc_calibration_profile[i]()
# Flush settings to monitor.