aboutsummaryrefslogtreecommitdiffstats
path: root/colortemp.c
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2009-11-04 22:25:26 +0100
committerJon Lund Steffensen <jonlst@gmail.com>2009-11-04 22:25:26 +0100
commit485c19ef3080c1492130f7032dbc8ee907a9a582 (patch)
treee5e88a0a65bb5aeca21faa8a6e3792e71989575e /colortemp.c
parentMake transition period a bit shorter. (diff)
downloadredshift-ng-485c19ef3080c1492130f7032dbc8ee907a9a582.tar.gz
redshift-ng-485c19ef3080c1492130f7032dbc8ee907a9a582.tar.bz2
redshift-ng-485c19ef3080c1492130f7032dbc8ee907a9a582.tar.xz
Allow individual adjustment of each gamma channel.
Diffstat (limited to 'colortemp.c')
-rw-r--r--colortemp.c8
1 files changed, 4 insertions, 4 deletions
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];
}