Skip to content

Commit

Permalink
Replace GAMMA_V to constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
DrA1ex committed Feb 2, 2024
1 parent 2d592c8 commit 605a8a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/fx/color_efect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/sys_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#define BUTTON_FN(x)
#endif

#define GAMMA_V(x) (2.2f + (float) (x - 128) / 128.f)
constexpr float gamma_value(uint8_t x) { return (2.2f + (float) (x - 128) / 128.f); }

0 comments on commit 605a8a4

Please sign in to comment.