diff options
author | emersion <contact@emersion.fr> | 2018-07-25 14:46:50 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-08-02 23:33:59 +0100 |
commit | 2ae05756319206a9fbfde29e38bdcb04743486e4 (patch) | |
tree | f91627375a3279e3eedb68dd5af05cbcfcf3c785 | |
parent | b0c32019c384b51fdd53e573c5e52fdf082a888d (diff) |
examples/gamma-control: fix brightness formula
-rw-r--r-- | examples/gamma-control.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/gamma-control.c b/examples/gamma-control.c index e2af9cdd..a060b883 100644 --- a/examples/gamma-control.c +++ b/examples/gamma-control.c @@ -115,7 +115,7 @@ static void fill_gamma_table(uint16_t *table, uint32_t ramp_size, uint16_t *b = table + 2 * ramp_size; for (uint32_t i = 0; i < ramp_size; ++i) { double val = (double)i / (ramp_size - 1); - val = contrast * pow(val, 1.0 / gamma) + (1 - brightness); + val = contrast * pow(val, 1.0 / gamma) + (brightness - 1); if (val > 1.0) { val = 1.0; } else if (val < 0.0) { |