From 485c19ef3080c1492130f7032dbc8ee907a9a582 Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Wed, 4 Nov 2009 22:25:26 +0100 Subject: Allow individual adjustment of each gamma channel. --- colortemp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'colortemp.c') diff --git a/colortemp.c b/colortemp.c index c2ed83d..f0c5a19 100644 --- a/colortemp.c +++ b/colortemp.c @@ -153,7 +153,7 @@ colortemp_check_extension() } int -colortemp_set_temperature(int temp, float gamma) +colortemp_set_temperature(int temp, float gamma[3]) { xcb_generic_error_t *error; @@ -226,11 +226,11 @@ colortemp_set_temperature(int temp, float gamma) uint16_t *gamma_b = &gamma_ramps[2*gamma_ramp_size]; for (int i = 0; i < gamma_ramp_size; i++) { - gamma_r[i] = pow((float)i/gamma_ramp_size, 1.0/gamma) * + gamma_r[i] = pow((float)i/gamma_ramp_size, 1.0/gamma[0]) * UINT16_MAX * white_point[0]; - gamma_g[i] = pow((float)i/gamma_ramp_size, 1.0/gamma) * + gamma_g[i] = pow((float)i/gamma_ramp_size, 1.0/gamma[1]) * UINT16_MAX * white_point[1]; - gamma_b[i] = pow((float)i/gamma_ramp_size, 1.0/gamma) * + gamma_b[i] = pow((float)i/gamma_ramp_size, 1.0/gamma[2]) * UINT16_MAX * white_point[2]; } -- cgit v1.2.3-70-g09d2