Browse Source

light: ambiguous numeric type

pull/2558/head
Maxim Prokhorov 1 year ago
parent
commit
a437371408
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      code/espurna/light.cpp

+ 5
- 5
code/espurna/light.cpp View File

@ -1584,11 +1584,11 @@ namespace {
// TODO: input value modifier, instead of a transition-only thing?
// TODO: calculate on the fly instead of limiting this to an 8bit value?
constexpr long LightGammaMin { 0 };
constexpr long LightGammaMax { 255 };
static constexpr long LightGammaMin { 0 };
static constexpr long LightGammaMax { 255 };
long _lightGammaMap(size_t index) {
const static std::array<uint8_t, 256> Gamma PROGMEM {
long _lightGammaValue(size_t index) {
static const std::array<uint8_t, 256> Gamma PROGMEM {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6,
@ -1622,7 +1622,7 @@ long _lightGammaMap(long value) {
if (Divisor != 0l) {
const long Scaled {
(value - espurna::light::ValueMin) * (LightGammaMax - LightGammaMin) / Divisor + LightGammaMin };
return _lightGammaMap(static_cast<size_t>(Scaled));
return _lightGammaValue(static_cast<size_t>(Scaled));
}
return espurna::light::ValueMin;


Loading…
Cancel
Save