mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update MultiColorCorrection.cpp
Former-commit-id: ec17038daea5061bf4910a4884d715e767604155
This commit is contained in:
parent
0ba143cd20
commit
5215e45f10
@ -12,7 +12,7 @@ MultiColorCorrection::MultiColorCorrection(const unsigned ledCnt) :
|
|||||||
|
|
||||||
MultiColorCorrection::~MultiColorCorrection()
|
MultiColorCorrection::~MultiColorCorrection()
|
||||||
{
|
{
|
||||||
// Clean up all the transforms
|
// Clean up all the correctinos
|
||||||
for (ColorCorrection * correction : _correction)
|
for (ColorCorrection * correction : _correction)
|
||||||
{
|
{
|
||||||
delete correction;
|
delete correction;
|
||||||
@ -59,7 +59,7 @@ const std::vector<std::string> & MultiColorCorrection::getCorrectionIds()
|
|||||||
|
|
||||||
ColorCorrection* MultiColorCorrection::getCorrection(const std::string& id)
|
ColorCorrection* MultiColorCorrection::getCorrection(const std::string& id)
|
||||||
{
|
{
|
||||||
// Iterate through the unique transforms until we find the one with the given id
|
// Iterate through the unique corrections until we find the one with the given id
|
||||||
for (ColorCorrection * correction : _correction)
|
for (ColorCorrection * correction : _correction)
|
||||||
{
|
{
|
||||||
if (correction->_id == id)
|
if (correction->_id == id)
|
||||||
@ -68,13 +68,13 @@ ColorCorrection* MultiColorCorrection::getCorrection(const std::string& id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The ColorTransform was not found
|
// The ColorCorrection was not found
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<ColorRgb> MultiColorCorrection::applyCorrection(const std::vector<ColorRgb>& rawColors)
|
std::vector<ColorRgb> MultiColorCorrection::applyCorrection(const std::vector<ColorRgb>& rawColors)
|
||||||
{
|
{
|
||||||
// Create a copy, as we will do the rest of the transformation in place
|
// Create a copy, as we will do the rest of the correction in place
|
||||||
std::vector<ColorRgb> ledColors(rawColors);
|
std::vector<ColorRgb> ledColors(rawColors);
|
||||||
|
|
||||||
const size_t itCnt = std::min(_ledCorrections.size(), rawColors.size());
|
const size_t itCnt = std::min(_ledCorrections.size(), rawColors.size());
|
||||||
@ -83,7 +83,7 @@ std::vector<ColorRgb> MultiColorCorrection::applyCorrection(const std::vector<Co
|
|||||||
ColorCorrection * correction = _ledCorrections[i];
|
ColorCorrection * correction = _ledCorrections[i];
|
||||||
if (correction == nullptr)
|
if (correction == nullptr)
|
||||||
{
|
{
|
||||||
// No transform set for this led (do nothing)
|
// No correction set for this led (do nothing)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ColorRgb& color = ledColors[i];
|
ColorRgb& color = ledColors[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user