new brightness handling (#430)

* clean color adjustment

* now a prio duration of "0" means infinity

* implement dynamic 'just in time' initialization

* implement new brightness handling

* cahnge access level

* i18n fix

* - cleanup brightness stuff
- update webserver, now with initial ssl support

* - backlightThreshold is now 0-100 instead 0-1
- better performance for brightness - use piecewise linear instead of sqrt
This commit is contained in:
redPanther
2017-04-03 05:19:05 +02:00
committed by GitHub
parent 852f7b86bb
commit 5ea3c752b5
22 changed files with 366 additions and 139 deletions

View File

@@ -22,14 +22,26 @@ public:
/// Destructor
~RgbChannelAdjustment();
///
/// Transform the given array value
///
/// @param input The input color bytes
void apply(uint8_t input, uint8_t & red, uint8_t & green, uint8_t & blue);
/// @param brightness The current brightness value
/// @param red The red color component
/// @param green The green color component
/// @param blue The blue color component
///
/// @note The values are updated in place.
///
void apply(uint8_t input, uint8_t brightness, uint8_t & red, uint8_t & green, uint8_t & blue);
///
/// setAdjustment RGB
///
/// @param adjustR
/// @param adjustG
/// @param adjustB
///
void setAdjustment(uint8_t adjustR, uint8_t adjustG, uint8_t adjustB);
/// @return The current adjustR value
@@ -43,11 +55,11 @@ public:
private:
/// color channels
enum ColorChannel { RED=0,GREEN=1, BLUE=2 };
enum ColorChannel { RED=0, GREEN=1, BLUE=2 };
/// reset init of color mapping
void resetInitialized();
/// (re)-initilize the color mapping
void initializeMapping();
/// The adjustment of RGB channel
uint8_t _adjust[3];
@@ -59,4 +71,10 @@ private:
/// Logger instance
Logger * _log;
/// bitfield to determine white value is alreade initialized
bool _initialized[256];
/// current brightness value
uint8_t _brightness;
};