From 605a8a4b22008ff4028155dbca79927d6b66d2b3 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 2 Feb 2024 21:51:49 +0500 Subject: [PATCH] Replace GAMMA_V to constexpr --- src/application.cpp | 2 +- src/fx/color_efect.cpp | 2 +- src/sys_macro.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/application.cpp b/src/application.cpp index f38fb9c..a84849b 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -37,7 +37,7 @@ void Application::load() { #if GAMMA_CORRECTION_RT == DISABLED if (config.gamma != 0) { - napplyGamma_video(current_palette.entries, 16, GAMMA_V(config.gamma)); + napplyGamma_video(current_palette.entries, 16, gamma_value(config.gamma)); } #endif } diff --git a/src/fx/color_efect.cpp b/src/fx/color_efect.cpp index be95b37..ee99779 100644 --- a/src/fx/color_efect.cpp +++ b/src/fx/color_efect.cpp @@ -34,7 +34,7 @@ void ColorEffectManager::call(Led &led, const PaletteT *palette, const PresetCon #if GAMMA_CORRECTION_RT == ENABLED _state.params.gamma_correction = gamma > 0; - _state.params.gamma = GAMMA_V(gamma); + _state.params.gamma = gamma_value(gamma); #else _state.params.gamma_correction = false; _state.params.gamma = 0; diff --git a/src/sys_macro.h b/src/sys_macro.h index f9669fe..d03e041 100644 --- a/src/sys_macro.h +++ b/src/sys_macro.h @@ -8,4 +8,4 @@ #define BUTTON_FN(x) #endif -#define GAMMA_V(x) (2.2f + (float) (x - 128) / 128.f) \ No newline at end of file +constexpr float gamma_value(uint8_t x) { return (2.2f + (float) (x - 128) / 128.f); } \ No newline at end of file