diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2014-12-27 20:22:04 -0500 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2014-12-27 20:22:11 -0500 |
commit | ec5aa19acf1b768586688dd7c82ee0d64d314b40 (patch) | |
tree | 767475829fda9b9856532535e06dcb3ad02a5b32 /src/gamma-quartz.c | |
parent | redshift: Add config setting to set gamma separately for day/night (diff) | |
download | redshift-ng-ec5aa19acf1b768586688dd7c82ee0d64d314b40.tar.gz redshift-ng-ec5aa19acf1b768586688dd7c82ee0d64d314b40.tar.bz2 redshift-ng-ec5aa19acf1b768586688dd7c82ee0d64d314b40.tar.xz |
redshift: Simplify set_temperature by passing color_setting_t
Changes all set_temperature function in gamma adjustment methods
to take a color_setting_t pointer with the color settings.
Colorramp functions are similarly changed to take a color settings
struct.
Diffstat (limited to 'src/gamma-quartz.c')
-rw-r--r-- | src/gamma-quartz.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gamma-quartz.c b/src/gamma-quartz.c index 2f439da..f28955f 100644 --- a/src/gamma-quartz.c +++ b/src/gamma-quartz.c @@ -75,8 +75,8 @@ quartz_set_option(quartz_state_t *state, const char *key, const char *value) } static void -quartz_set_temperature_for_display(CGDirectDisplayID display, int temp, - float brightness, const float gamma[3]) +quartz_set_temperature_for_display(CGDirectDisplayID display, + const color_setting_t *setting) { uint32_t ramp_size = CGDisplayGammaTableCapacity(display); if (ramp_size == 0) { @@ -97,7 +97,7 @@ quartz_set_temperature_for_display(CGDirectDisplayID display, int temp, float *gamma_b = &gamma_ramps[2*ramp_size]; colorramp_fill_float(gamma_r, gamma_g, gamma_b, ramp_size, - temp, brightness, gamma); + setting); CGError error = CGSetDisplayTransferByTable(display, ramp_size, @@ -111,8 +111,8 @@ quartz_set_temperature_for_display(CGDirectDisplayID display, int temp, } int -quartz_set_temperature(quartz_state_t *state, int temp, float brightness, - const float gamma[3]) +quartz_set_temperature(quartz_state_t *state, + const color_setting_t *setting) { int r; CGError error; @@ -136,8 +136,7 @@ quartz_set_temperature(quartz_state_t *state, int temp, float brightness, } for (int i = 0; i < display_count; i++) { - quartz_set_temperature_for_display(displays[i], temp, - brightness, gamma); + quartz_set_temperature_for_display(displays[i], setting); } free(displays); |