mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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
This commit is contained in:
@@ -81,6 +81,10 @@ int main(int argc, char * argv[])
|
||||
CorrectionParameter & argCorrection = parameters.add<CorrectionParameter>('Y', "correction" , "Set the correction of the leds (requires 3 space seperated values between 0 and 255)");
|
||||
StringParameter & argIdT = parameters.add<StringParameter> ('z', "qualifier" , "Identifier(qualifier) of the temperature correction to set");
|
||||
CorrectionParameter & argTemperature = parameters.add<CorrectionParameter>('Z', "temperature" , "Set the temperature correction of the leds (requires 3 space seperated values between 0 and 255)");
|
||||
StringParameter & argIdA = parameters.add<StringParameter> ('j', "qualifier" , "Identifier(qualifier) of the adjustment to set");
|
||||
AdjustmentParameter & argRAdjust = parameters.add<AdjustmentParameter>('R', "redAdjustment" , "Set the adjustment of the red color (requires 3 space seperated values between 0 and 255)");
|
||||
AdjustmentParameter & argGAdjust = parameters.add<AdjustmentParameter>('G', "greenAdjustment", "Set the adjustment of the green color (requires 3 space seperated values between 0 and 255)");
|
||||
AdjustmentParameter & argBAdjust = parameters.add<AdjustmentParameter>('B', "blueAdjustment", "Set the adjustment of the blue color (requires 3 space seperated values between 0 and 255)");
|
||||
|
||||
// set the default values
|
||||
argAddress.setDefault(defaultServerAddress.toStdString());
|
||||
@@ -100,10 +104,11 @@ int main(int argc, char * argv[])
|
||||
|
||||
// check if at least one of the available color transforms is set
|
||||
bool colorTransform = argSaturation.isSet() || argValue.isSet() || argSaturationL.isSet() || argLuminance.isSet() || argThreshold.isSet() || argGamma.isSet() || argBlacklevel.isSet() || argWhitelevel.isSet();
|
||||
bool colorModding = colorTransform || argCorrection.isSet() || argTemperature.isSet();
|
||||
bool colorAdjust = argRAdjust.isSet() || argGAdjust.isSet() || argBAdjust.isSet();
|
||||
bool colorModding = colorTransform || colorAdjust || argCorrection.isSet() || argTemperature.isSet();
|
||||
|
||||
// check that exactly one command was given
|
||||
int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorModding});
|
||||
int commandCount = count({argColor.isSet(), argImage.isSet(), argEffect.isSet(), argServerInfo.isSet(), argClear.isSet(), argClearAll.isSet(), colorModding});
|
||||
if (commandCount != 1)
|
||||
{
|
||||
std::cerr << (commandCount == 0 ? "No command found." : "Multiple commands found.") << " Provide exactly one of the following options:" << std::endl;
|
||||
@@ -127,6 +132,10 @@ int main(int argc, char * argv[])
|
||||
std::cerr << " " << argCorrection.usageLine() << std::endl;
|
||||
std::cerr << " " << argIdT.usageLine() << std::endl;
|
||||
std::cerr << " " << argTemperature.usageLine() << std::endl;
|
||||
std::cerr << " " << argIdA.usageLine() << std::endl;
|
||||
std::cerr << " " << argRAdjust.usageLine() << std::endl;
|
||||
std::cerr << " " << argGAdjust.usageLine() << std::endl;
|
||||
std::cerr << " " << argBAdjust.usageLine() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -186,6 +195,24 @@ int main(int argc, char * argv[])
|
||||
argIdT.isSet() ? &tempId : nullptr,
|
||||
argTemperature.isSet() ? &temperature : nullptr);
|
||||
}
|
||||
|
||||
if (colorAdjust)
|
||||
{
|
||||
std::string adjustId;
|
||||
ColorAdjustmentValues redChannel, greenChannel, blueChannel;
|
||||
|
||||
if (argIdA.isSet()) adjustId = argIdA.getValue();
|
||||
if (argRAdjust.isSet()) redChannel = argRAdjust.getValue();
|
||||
if (argGAdjust.isSet()) greenChannel = argGAdjust.getValue();
|
||||
if (argBAdjust.isSet()) blueChannel = argBAdjust.getValue();
|
||||
|
||||
connection.setAdjustment(
|
||||
argIdA.isSet() ? &adjustId : nullptr,
|
||||
argRAdjust.isSet() ? &redChannel : nullptr,
|
||||
argGAdjust.isSet() ? &greenChannel : nullptr,
|
||||
argBAdjust.isSet() ? &blueChannel : nullptr);
|
||||
|
||||
}
|
||||
if (colorTransform)
|
||||
{
|
||||
std::string transId;
|
||||
|
||||
Reference in New Issue
Block a user