diff options
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): |