fix/refactor backlight stuff (#394)

* fix/refactor backlight stuff:
- fix colors dont turn of when backlight 0 and black is set
- add option to use not colored backlight
- fix colored backlight not colored on very low color values
- various code style tunings

* apply needed change to wizard

* backlight disabled on static color and efects

* fix warnings

* try fix udp compiler warnings
This commit is contained in:
redPanther
2017-02-11 22:52:47 +01:00
committed by GitHub
parent 199d266bc0
commit e1165e112f
33 changed files with 364 additions and 240 deletions

View File

@@ -20,10 +20,11 @@ public:
/// @param gammaR The used red gamma
/// @param gammaG The used green gamma
/// @param gammab The used blue gamma
/// @param brightnessLow The used lower brightness
/// @param backlightThreshold The used lower brightness
/// @param backlightColored use color in backlight
/// @param brightnessHigh The used higher brightness
///
RgbTransform(double gammaR, double gammaG, double gammaB, double brightnessLow, double brightnessHigh);
RgbTransform(double gammaR, double gammaG, double gammaB, double backlightThreshold, bool backlightColored, double brightnessHigh);
///
/// Destructor
@@ -39,19 +40,34 @@ public:
/// @return The current blue gamma value
double getGammaB() const;
/// @param gamma New gamma value
/// @param gammaR New red gamma value
/// @param gammaG New green gamma value
/// @param gammaB New blue gamma value
void setGamma(double gammaR,double gammaG=-1, double gammaB=-1);
/// @return The current lower brightness
double getBrightnessMin() const;
double getBacklightThreshold() const;
/// @param gamma New lower brightness
void setBrightnessMin(double brightness);
/// @param backlightThreshold New lower brightness
void setBacklightThreshold(double backlightThreshold);
/// @return The current lower brightness
/// @return The current state
bool getBacklightColored() const;
/// @param backlightColored en/disable colored backlight
void setBacklightColored(bool backlightColored);
/// @return return state of backlight
bool getBackLightEnabled() const;
/// @param enable en/disable backlight
void setBackLightEnabled(bool enable);
/// @return The current brightness
double getBrightness() const;
/// @param gamma New lower brightness
/// @param brightness New brightness
void setBrightness(double brightness);
///
@@ -72,15 +88,17 @@ private:
/// @param gammaR The used red gamma
/// @param gammaG The used green gamma
/// @param gammab The used blue gamma
/// @param brightnessLow The used lower brightness
/// @param backlightThreshold The used lower brightness
/// @param backlightColored en/disable color in backlight
/// @param brightnessHigh The used higher brightness
///
void init(double gammaR, double gammaG, double gammaB, double brightnessLow, double brightnessHigh);
void init(double gammaR, double gammaG, double gammaB, double backlightThreshold, bool backlightColored, double brightnessHigh);
/// (re)-initilize the color mapping
void initializeMapping(); /// The saturation gain
double _brightnessLow;
double _backlightThreshold;
bool _backlightColored;
double _brightnessHigh;
double _sumBrightnessLow;
double _sumBrightnessHigh;
@@ -93,4 +111,6 @@ private:
uint8_t _mappingR[256];
uint8_t _mappingG[256];
uint8_t _mappingB[256];
bool _backLightEnabled;
};