summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-21 10:07:03 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-21 10:07:03 +0100
commit6effa56a6219821ad678c104ad551460c872f83b (patch)
treee3f87c99fa65181292fe44a44216e7eb21cd3aec /examples
parentdocument icc support in info manual (diff)
downloadblueshift-6effa56a6219821ad678c104ad551460c872f83b.tar.gz
blueshift-6effa56a6219821ad678c104ad551460c872f83b.tar.bz2
blueshift-6effa56a6219821ad678c104ad551460c872f83b.tar.xz
add icc in example
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--examples/comprehensive35
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/comprehensive b/examples/comprehensive
index bcb20c1..a1166cc 100644
--- a/examples/comprehensive
+++ b/examples/comprehensive
@@ -115,6 +115,14 @@ gamma_blue_day, gamma_blue_night, gamma_blue_default = [1], [1], [1]
# the colour temperature is low.
+# ICC profile for video filtering and monitor calibration, respectively.
+# Replace `None` with the pathname of the profile. It is assume that
+# the calibration profile is already applied and that you want it to
+# still be applied on exit.
+icc_video_filter_profile = ["/dev/shm/_/xcalib-0.8/bluish.icc"]
+icc_calibration_profile = [None]
+
+
monitor_controller = lambda : randr(*monitors)
'''
:()→void Function used by Blueshift on exit to apply reset colour curves, if using preimplemented `reset`
@@ -200,6 +208,19 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
# Remove settings from last run.
start_over()
+ # Apply ICC profile as a video filter.
+ i = m % len(icc_video_filter_profile)
+ if icc_video_filter_profile[i] is not None:
+ if isinstance(icc_video_filter_profile[i], str):
+ icc_video_filter_profile[i] = load_icc(icc_video_filter_profile[i])
+ icc_video_filter_profile[i]()
+ # Fade in/out filter
+ if fade is not None:
+ alpha = abs(fade)
+ for curve in (r_curve, g_curve, b_curve):
+ for i in range(i_size):
+ curve[i] = purify(curve[i], i / (i_size - 1))
+
# Apply colour temperature using raw CIE 1964 10 degree CMF data with interpolation.
temperature(temperature_, lambda t : divide_by_maximum(cmf_10deg(t)))
@@ -221,6 +242,13 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
# Apply gamma correction to monitor.
gamma(gamma_red_, gamma_green_, gamma_blue_)
+ # Apply ICC profile as a monitor calibration.
+ 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])
+ icc_calibration_profile[i]()
+
# Flush settings to monitor.
if len(monitors) == 0:
randr()
@@ -246,6 +274,13 @@ def reset():
# Apply gamma correction to monitor.
gamma(gamma_red_, gamma_green_, gamma_blue_)
+ # Apply ICC profile as a monitor calibration.
+ 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])
+ icc_calibration_profile[i]()
+
# Flush settings to monitor.
if len(monitors) == 0:
randr()