diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-23 17:49:30 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-23 17:49:30 +0100 |
commit | 71f64125e8f66cf0e504c8b35f7ab89f22765ae4 (patch) | |
tree | d524163236bd911b9113843a0eabafbbc17801d2 /src/monitor.py | |
parent | typo (diff) | |
download | blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.gz blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.bz2 blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.xz |
fix errors in getting current curves + add getting curent curves to tests + fix multimonitor mistakes in examples
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/monitor.py')
-rw-r--r-- | src/monitor.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/monitor.py b/src/monitor.py index 3d75e72..7572061 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -75,14 +75,17 @@ def randr_get(crtc = 0, screen = 0): randr_opened = screen else: sys.exit(1) - (r, g, b) = randr_read() + (r, g, b) = randr_read(crtc) + r = [y / 65535 for y in r] + g = [y / 65535 for y in g] + b = [y / 65535 for y in b] def fcurve(R_curve, G_curve, B_curve): for curve, cur in curves(R_curve, G_curve, B_curve): for i in range(i_size): y = int(curve[i] * (len(cur) - 1) + 0.5) y = min(max(0, y), len(cur) - 1) curve[i] = cur[y] - return lambda : fcurve + return lambda : fcurve(r, g, b) def vidmode_get(crtc = 0, screen = 0): @@ -102,14 +105,17 @@ def vidmode_get(crtc = 0, screen = 0): vidmode_opened = screen else: sys.exit(1) - (r, g, b) = vidmode_read() + (r, g, b) = vidmode_read(crtc) + r = [y / 65535 for y in r] + g = [y / 65535 for y in g] + b = [y / 65535 for y in b] def fcurve(R_curve, G_curve, B_curve): for curve, cur in curves(R_curve, G_curve, B_curve): for i in range(i_size): y = int(curve[i] * (len(cur) - 1) + 0.5) y = min(max(0, y), len(cur) - 1) curve[i] = cur[y] - return lambda : fcurve + return lambda : fcurve(r, g, b) def randr(*crtcs, screen = 0): |