Skip to content

Commit 9fc3712

Browse files
committed
Add Hybrid RGB Smoothing Interpolator (2)
1 parent 5862aea commit 9fc3712

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sources/infinite-color-engine/InfiniteHybridRgbInterpolator.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ void InfiniteHybridRgbInterpolator::updateCurrentColors(float currentTimeMs) {
161161

162162
SharedOutputColors InfiniteHybridRgbInterpolator::getCurrentColors()
163163
{
164-
return std::make_shared<std::vector<linalg::vec<float, 3>>>(_currentColorsRGB);
164+
auto result = std::make_shared<std::vector<linalg::vec<float, 3>>>();
165+
result->reserve(_currentColorsRGB.size());
166+
167+
for (const auto& rgb : _currentColorsRGB)
168+
result->push_back(linalg::clamp(rgb, 0.f, 1.f));
169+
170+
return result;
165171
}
166172

167173
void InfiniteHybridRgbInterpolator::test() {

0 commit comments

Comments
 (0)