summaryrefslogtreecommitdiffstats
path: root/src/monitor.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-23 17:49:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-23 17:49:30 +0100
commit71f64125e8f66cf0e504c8b35f7ab89f22765ae4 (patch)
treed524163236bd911b9113843a0eabafbbc17801d2 /src/monitor.py
parenttypo (diff)
downloadblueshift-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 '')
-rw-r--r--src/monitor.py14
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):