Update Hyperion.cpp

Former-commit-id: f5cb215d9d6625102530b7f2b1ccce5145ec0768
This commit is contained in:
AEtHeLsYn 2015-12-22 10:06:04 +01:00
parent 9acdf946bf
commit 516df4b83a

View File

@ -470,6 +470,10 @@ Hyperion::Hyperion(const Json::Value &jsonConfig) :
{ {
throw std::runtime_error("Color correction incorrectly set"); throw std::runtime_error("Color correction incorrectly set");
} }
if (!_raw2ledTemperature->verifyCorrections())
{
throw std::runtime_error("Color temperature incorrectly set");
}
if (!_raw2ledTransform->verifyTransforms()) if (!_raw2ledTransform->verifyTransforms())
{ {
throw std::runtime_error("Color transformation incorrectly set"); throw std::runtime_error("Color transformation incorrectly set");
@ -512,6 +516,9 @@ Hyperion::~Hyperion()
// delete the color correction // delete the color correction
delete _raw2ledCorrection; delete _raw2ledCorrection;
// delete the color temperature correction
delete _raw2ledTemperature;
} }
unsigned Hyperion::getLedCount() const unsigned Hyperion::getLedCount() const
@ -562,6 +569,11 @@ const std::vector<std::string> & Hyperion::getCorrectionIds() const
return _raw2ledCorrection->getCorrectionIds(); return _raw2ledCorrection->getCorrectionIds();
} }
const std::vector<std::string> & Hyperion::getTemperatureIds() const
{
return _raw2ledTemperature->getCorrectionIds();
}
ColorTransform * Hyperion::getTransform(const std::string& id) ColorTransform * Hyperion::getTransform(const std::string& id)
{ {
return _raw2ledTransform->getTransform(id); return _raw2ledTransform->getTransform(id);
@ -572,6 +584,11 @@ ColorCorrection * Hyperion::getCorrection(const std::string& id)
return _raw2ledCorrection->getCorrection(id); return _raw2ledCorrection->getCorrection(id);
} }
ColorCorrection * Hyperion::getTemperature(const std::string& id)
{
return _raw2ledTemperature->getCorrection(id);
}
void Hyperion::transformsUpdated() void Hyperion::transformsUpdated()
{ {
update(); update();