diff options
Diffstat (limited to 'src/monitor.py')
-rw-r--r-- | src/monitor.py | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/monitor.py b/src/monitor.py index 90ae603..499864f 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -18,6 +18,7 @@ import sys from subprocess import Popen, PIPE +from aux import * from curve import * # /usr/lib @@ -36,22 +37,6 @@ except: pass ## Not compiled with DRM support -def translate_to_integers(): - ''' - Translate the curves from float to integer - - @param :(list<int>, list<int>, list<int>) The red curve, the green curve and, - the blue curve mapped to integers - ''' - R_curve, G_curve, B_curve = [0] * i_size, [0] * i_size, [0] * i_size - for i_curve, o_curve in ((r_curve, R_curve), (g_curve, G_curve), (b_curve, B_curve)): - for i in range(i_size): - o_curve[i] = int(i_curve[i] * (o_size - 1) + 0.5) - if clip_result: - o_curve[i] = min(max(0, o_curve[i]), (o_size - 1)) - return (R_curve, G_curve, B_curve) - - def close_c_bindings(): ''' Close all C bindings and let them free resources and close connections @@ -68,27 +53,6 @@ def close_c_bindings(): drm_manager.close() -def ramps_to_function(r, g, b): - ''' - Convert a three colour curves to a function that applies those adjustments - - @param r:int The red colour curves as [0, 65535] integers - @param g:int The green colour curves as [0, 65535] integers - @param b:int The blue colour curves as [0, 65535] integers - @return :()→void Function to invoke to apply the curves that the parameters [r, g and b] represents - ''' - 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(r, g, b) - - def randr_get(crtc = 0, screen = 0): ''' Gets the current colour curves using the X11 extension RandR |