hyperion.ng/include/utils/RgbChannelAdjustment.h
AEtHeLsYn b37cbd26d5 Add color adjustment to all RBG channels
* Channel adjustment config

* Create RgbChannelAdjustment.h

* Delete RgbChannelAdjustment.h

* Create RgbChannelAdjustment.cpp

* Create RgbChannelAdjustment.h

* Delete RgbChannelAdjustment.cpp

* Create ColorAdjustment.cpp

* Delete RgbChannelAdjustment.h

* Create ColorAdjustment.h

* Update ColorAdjustment.h

* Update ColorAdjustment.h

* Update ColorAdjustment.h

* Update ColorAdjustment.cpp

* Update Hyperion.cpp

* Update Hyperion.cpp

* Update Hyperion.cpp

* Update Hyperion.h

* Create RgbChannelAdjustment.cpp

* Create RgbChannelAdjustment.h

* Create ColorAdjustment.h

* Create MultiColorAdjustment.h

* Update MultiColorAdjustment.h

* Create MultiColorAdjustment.cpp

* Delete ColorAdjustment.cpp

* Delete ColorAdjustment.h

* Update RgbChannelAdjustment.cpp

* Update Hyperion.cpp

* Update Hyperion.h

* Update Hyperion.cpp

* Bug fixes

* Update hyperion.config.json

* Add color adjustment to json server and client and adapt hyperion-remote

* Change the color modification order

* Minor bug fix

* Create calibration Images folder

* Create calibration Gamma folder

* Create calibration RGB folder

* Added files via upload

* Delete .gitkeep

* Delete .gitkeep

* Added files via upload

* Delete .gitkeep

* Update color effect order and don't correct twice

* Uploaded gradient images


Former-commit-id: 8ab465e59834f12a21709a6f4546bd6808a2a495
2016-04-02 00:04:11 +02:00

67 lines
1.5 KiB
C++

#pragma once
// STL includes
#include <cstdint>
/// Correction for a single color byte value
/// All configuration values are unsigned int and assume the color value to be between 0 and 255
class RgbChannelAdjustment
{
public:
/// Default constructor
RgbChannelAdjustment();
/// Constructor
/// @param adjustR
/// @param adjustG
/// @param adjustB
RgbChannelAdjustment(int adjustR, int adjustG, int adjustB);
/// Destructor
~RgbChannelAdjustment();
/// @return The current adjustR value
uint8_t getadjustmentR() const;
/// @param threshold New adjustR value
void setadjustmentR(uint8_t adjustR);
/// @return The current adjustG value
uint8_t getadjustmentG() const;
/// @param gamma New adjustG value
void setadjustmentG(uint8_t adjustG);
/// @return The current adjustB value
uint8_t getadjustmentB() const;
/// @param blacklevel New adjustB value
void setadjustmentB(uint8_t adjustB);
/// Transform the given array value
/// @param input The input color bytes
/// @return The corrected byte value
uint8_t adjustmentR(uint8_t inputR) const;
uint8_t adjustmentG(uint8_t inputG) const;
uint8_t adjustmentB(uint8_t inputB) const;
private:
/// (re)-initilize the color mapping
void initializeMapping();
private:
/// The adjustment of R channel
int _adjustR;
/// The adjustment of G channel
int _adjustG;
/// The adjustment of B channel
int _adjustB;
/// The mapping from input color to output color
int _mappingR[256];
int _mappingG[256];
int _mappingB[256];
};