From af7482493ff16065a7ecea213e8b00e9a7198c9b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 14 May 2015 18:07:54 +0200 Subject: test: test ramp order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/test/test.c | 24 ++++++++++++++++++++++++ src/test/test.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/test/test.c b/src/test/test.c index 30d2952..d387a3c 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -136,6 +136,30 @@ int main(void) #undef Y #undef X + /* Test order of gamma ramps. */ + memcpy(ramps16.red, old_ramps16.red, ramps16.red_size * sizeof(uint16_t)); + memset(ramps16.green, 0, ramps16.green_size * sizeof(uint16_t)); + memset(ramps16.blue, 0, ramps16.blue_size * sizeof(uint16_t)); + printf("Making the monitor red-only for 1 second...\n"); + if ((rr |= r = libgamma_crtc_set_gamma_ramps16(crtc_state, ramps16))) + libgamma_perror("libgamma_crtc_set_gamma_ramps16", r); + sleep(1); + memset(ramps16.red, 0, ramps16.red_size * sizeof(uint16_t)); + memcpy(ramps16.green, old_ramps16.green, ramps16.green_size * sizeof(uint16_t)); + printf("Making the monitor green-only for 1 second...\n"); + if ((rr |= r = libgamma_crtc_set_gamma_ramps16(crtc_state, ramps16))) + libgamma_perror("libgamma_crtc_set_gamma_ramps16", r); + sleep(1); + memset(ramps16.green, 0, ramps16.green_size * sizeof(uint16_t)); + memcpy(ramps16.blue, old_ramps16.blue, ramps16.blue_size * sizeof(uint16_t)); + printf("Making the monitor green-only for 1 second...\n"); + if ((rr |= r = libgamma_crtc_set_gamma_ramps16(crtc_state, ramps16))) + libgamma_perror("libgamma_crtc_set_gamma_ramps16", r); + sleep(1); + if ((rr |= r = libgamma_crtc_set_gamma_ramps64(crtc_state, old_ramps64))) + libgamma_perror("libgamma_crtc_set_gamma_ramps64", r); + printf("Done!\n"); + /* TODO Test gamma ramp restore functions. */ done: diff --git a/src/test/test.h b/src/test/test.h index 62cda4c..0c22fe0 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -32,6 +32,7 @@ #include #include #include +#include #endif -- cgit v1.2.3-70-g09d2