From 82f3fbdb203707d79d2ecd18308f140612179c35 Mon Sep 17 00:00:00 2001 From: Funatiq Date: Sun, 22 May 2016 00:30:53 +0200 Subject: [PATCH] Reorder Transform and Adjustment (#636) Change order from "Adjustment -> Transform" to "Transform -> Adjustment" Former-commit-id: 5b63d0bce98a80b5a2604e43772574ec6bbfd2a5 --- libsrc/hyperion/Hyperion.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 45a2d322..67687864 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -860,9 +860,9 @@ void Hyperion::update() // Apply the correction and the transform to each led and color-channel // Avoid applying correction, the same task is performed by adjustment // std::vector correctedColors = _raw2ledCorrection->applyCorrection(priorityInfo.ledColors); - std::vector adjustedColors = _raw2ledAdjustment->applyAdjustment(priorityInfo.ledColors); - std::vector transformColors =_raw2ledTransform->applyTransform(adjustedColors); - std::vector ledColors = _raw2ledTemperature->applyCorrection(transformColors); + std::vector transformColors =_raw2ledTransform->applyTransform(priorityInfo.ledColors); + std::vector adjustedColors = _raw2ledAdjustment->applyAdjustment(transformColors); + std::vector ledColors = _raw2ledTemperature->applyCorrection(adjustedColors); const std::vector& leds = _ledString.leds(); int i = 0; for (ColorRgb& color : ledColors) @@ -885,18 +885,14 @@ void Hyperion::update() break; case ORDER_GBR: { - uint8_t temp = color.red; - color.red = color.green; - color.green = color.blue; - color.blue = temp; + std::swap(color.red, color.green); + std::swap(color.green, color.blue); break; } case ORDER_BRG: { - uint8_t temp = color.red; - color.red = color.blue; - color.blue = color.green; - color.green = temp; + std::swap(color.red, color.blue); + std::swap(color.green, color.blue); break; } }