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:
@@ -322,6 +322,51 @@ void JsonConnection::setTemperature(std::string * temperatureId, ColorCorrection
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
void JsonConnection::setAdjustment(std::string * adjustmentId, ColorAdjustmentValues * redAdjustment, ColorAdjustmentValues * greenAdjustment, ColorAdjustmentValues * blueAdjustment)
|
||||
{
|
||||
std::cout << "Set color adjustments" << std::endl;
|
||||
|
||||
// create command
|
||||
Json::Value command;
|
||||
command["command"] = "adjustment";
|
||||
Json::Value & adjust = command["adjustment"];
|
||||
|
||||
if (adjustmentId != nullptr)
|
||||
{
|
||||
adjust["id"] = *adjustmentId;
|
||||
}
|
||||
|
||||
if (redAdjustment != nullptr)
|
||||
{
|
||||
Json::Value & v = adjust["redAdjust"];
|
||||
v.append(redAdjustment->valueRed);
|
||||
v.append(redAdjustment->valueGreen);
|
||||
v.append(redAdjustment->valueBlue);
|
||||
}
|
||||
|
||||
if (greenAdjustment != nullptr)
|
||||
{
|
||||
Json::Value & v = adjust["greenAdjust"];
|
||||
v.append(greenAdjustment->valueRed);
|
||||
v.append(greenAdjustment->valueGreen);
|
||||
v.append(greenAdjustment->valueBlue);
|
||||
}
|
||||
|
||||
if (blueAdjustment != nullptr)
|
||||
{
|
||||
Json::Value & v = adjust["blueAdjust"];
|
||||
v.append(blueAdjustment->valueRed);
|
||||
v.append(blueAdjustment->valueGreen);
|
||||
v.append(blueAdjustment->valueBlue);
|
||||
}
|
||||
|
||||
// send command message
|
||||
Json::Value reply = sendMessage(command);
|
||||
|
||||
// parse reply message
|
||||
parseReply(reply);
|
||||
}
|
||||
|
||||
Json::Value JsonConnection::sendMessage(const Json::Value & message)
|
||||
{
|
||||
// serialize message (FastWriter already appends a newline)
|
||||
|
||||
Reference in New Issue
Block a user