summaryrefslogtreecommitdiffstats
path: root/src/monitor.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-13 18:31:12 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-13 18:31:12 +0100
commite7414dd28460f6e364e5bb57b22c4a798be8d386 (patch)
tree4a5aecb8f0d16683f1c4b524df85ce591ab3fe59 /src/monitor.py
parentadd drm_get (diff)
downloadblueshift-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 '')
-rw-r--r--src/monitor.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/monitor.py b/src/monitor.py
index 01c70d0..3947435 100644
--- a/src/monitor.py
+++ b/src/monitor.py
@@ -197,6 +197,21 @@ def vidmode(*crtcs, screen = 0):
pass # Happens on exit by TERM signal
+def drm(*crtcs, card = 0):
+ '''
+ Applies colour curves using DRM
+
+ @param crtcs:*int The CRT controllers to use, all are used if none are specified
+ @param card:int The card that the monitors belong to
+ '''
+ connection = drm_manager.open_card(card)
+ (R_curve, G_curve, B_curve) = translate_to_integers()
+ try:
+ drm_set_gamma_ramps(connection, list(crtcs), i_size, R_curve, G_curve, B_curve)
+ except OverflowError:
+ pass # Happens on exit by TERM signal
+
+
def print_curves(*crtcs, screen = 0, compact = False):
'''
Prints the curves to stdout