mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
added flag to have BGR output instead of RGB
Former-commit-id: dbd35d6dd4a84d95e0a034b99843be4949a6e169
This commit is contained in:
@@ -96,6 +96,7 @@ Hyperion::Hyperion(const Json::Value &jsonConfig) :
|
||||
_redTransform(createColorTransform(jsonConfig["color"]["red"])),
|
||||
_greenTransform(createColorTransform(jsonConfig["color"]["green"])),
|
||||
_blueTransform(createColorTransform(jsonConfig["color"]["blue"])),
|
||||
_haveBgrOutput(jsonConfig["device"].get("bgr-output", false).asBool()),
|
||||
_device(constructDevice(jsonConfig["device"])),
|
||||
_timer()
|
||||
{
|
||||
@@ -301,6 +302,11 @@ void Hyperion::update()
|
||||
color.red = _redTransform->transform(color.red);
|
||||
color.green = _greenTransform->transform(color.green);
|
||||
color.blue = _blueTransform->transform(color.blue);
|
||||
|
||||
if (_haveBgrOutput)
|
||||
{
|
||||
std::swap(color.red, color.blue);
|
||||
}
|
||||
}
|
||||
|
||||
// Write the data to the device
|
||||
|
@@ -22,6 +22,10 @@
|
||||
"type" : "integer",
|
||||
"required" : true,
|
||||
"minimum" : 0
|
||||
},
|
||||
"bgr-output" : {
|
||||
"type" : "boolean",
|
||||
"required" : false
|
||||
}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
|
Reference in New Issue
Block a user