From 516df4b83a7595a20195ba74597ed4e0c51e0360 Mon Sep 17 00:00:00 2001 From: AEtHeLsYn Date: Tue, 22 Dec 2015 10:06:04 +0100 Subject: [PATCH] Update Hyperion.cpp Former-commit-id: f5cb215d9d6625102530b7f2b1ccce5145ec0768 --- libsrc/hyperion/Hyperion.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index dc6ca3fb..eef3bd7d 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -470,6 +470,10 @@ Hyperion::Hyperion(const Json::Value &jsonConfig) : { throw std::runtime_error("Color correction incorrectly set"); } + if (!_raw2ledTemperature->verifyCorrections()) + { + throw std::runtime_error("Color temperature incorrectly set"); + } if (!_raw2ledTransform->verifyTransforms()) { throw std::runtime_error("Color transformation incorrectly set"); @@ -512,6 +516,9 @@ Hyperion::~Hyperion() // delete the color correction delete _raw2ledCorrection; + + // delete the color temperature correction + delete _raw2ledTemperature; } unsigned Hyperion::getLedCount() const @@ -562,6 +569,11 @@ const std::vector & Hyperion::getCorrectionIds() const return _raw2ledCorrection->getCorrectionIds(); } +const std::vector & Hyperion::getTemperatureIds() const +{ + return _raw2ledTemperature->getCorrectionIds(); +} + ColorTransform * Hyperion::getTransform(const std::string& id) { return _raw2ledTransform->getTransform(id); @@ -572,6 +584,11 @@ ColorCorrection * Hyperion::getCorrection(const std::string& id) return _raw2ledCorrection->getCorrection(id); } +ColorCorrection * Hyperion::getTemperature(const std::string& id) +{ + return _raw2ledTemperature->getCorrection(id); +} + void Hyperion::transformsUpdated() { update();