added flag to have BGR output instead of RGB

Former-commit-id: dbd35d6dd4a84d95e0a034b99843be4949a6e169
This commit is contained in:
johan
2013-10-27 10:18:31 +01:00
parent 2aaf58aa78
commit 2471bd8753
8 changed files with 55 additions and 25 deletions

View File

@@ -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

View File

@@ -22,6 +22,10 @@
"type" : "integer",
"required" : true,
"minimum" : 0
},
"bgr-output" : {
"type" : "boolean",
"required" : false
}
},
"additionalProperties" : false