diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-13 18:31:12 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-13 18:31:12 +0100 |
commit | e7414dd28460f6e364e5bb57b22c4a798be8d386 (patch) | |
tree | 4a5aecb8f0d16683f1c4b524df85ce591ab3fe59 /src/blueshift_drm.pyx | |
parent | add drm_get (diff) | |
download | blueshift-e7414dd28460f6e364e5bb57b22c4a798be8d386.tar.gz blueshift-e7414dd28460f6e364e5bb57b22c4a798be8d386.tar.bz2 blueshift-e7414dd28460f6e364e5bb57b22c4a798be8d386.tar.xz |
add function for applying curves with drm
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_drm.pyx')
-rw-r--r-- | src/blueshift_drm.pyx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/blueshift_drm.pyx b/src/blueshift_drm.pyx index 001ec41..3576744 100644 --- a/src/blueshift_drm.pyx +++ b/src/blueshift_drm.pyx @@ -157,12 +157,12 @@ def drm_get_gamma_ramps(int connection, int crtc_index, int gamma_size): return None -def drm_set_gamma_ramps(int connection, int crtc_index, int gamma_size, r_curve, g_curve, b_curve): +def drm_set_gamma_ramps(int connection, crtc_indices, int gamma_size, r_curve, g_curve, b_curve): ''' Set the gamma ramps of the of a monitor @param connection The identifier for the connection to the card - @param crtc_index The index of the CRTC to read from + @param crtc_index:list<int> The index of the CRTC to read from @param gamma_size The size a gamma ramp @param r_curve:list<unsigned short int> The red gamma ramp @param g_curve:list<unsigned short int> The green gamma ramp @@ -181,7 +181,9 @@ def drm_set_gamma_ramps(int connection, int crtc_index, int gamma_size, r_curve, r[i] = r_curve[i] & 0xFFFF g[i] = g_curve[i] & 0xFFFF b[i] = b_curve[i] & 0xFFFF - rc = blueshift_drm_set_gamma_ramps(connection, crtc_index, gamma_size, r, g, b) + rc = 0 + for crtc_index in crtc_indices: + rc |= blueshift_drm_set_gamma_ramps(connection, crtc_index, gamma_size, r, g, b) free(r) free(g) free(b) |