--User changes

-Clear all color curves when clicking Reset while holding down Ctrl.
 -Interpolate color curves when generating a sequence.

--Bug fixes
 -Undo a change made last year which gave the wrong color index for final xforms when generating a sequence.

--Code changes
 -No longer assume palettes are 256 elements. Can now read longer palettes.
 -Ensure OpenCL images always get written when created.
This commit is contained in:
Person
2019-04-25 22:34:09 -07:00
parent 77515aae73
commit 5f98be7336
7 changed files with 49 additions and 28 deletions

View File

@ -1733,25 +1733,18 @@ void Renderer<T, bucketT>::ComputeCurves()
{
if (m_CurvesSet)
{
//Timing t;
auto st = m_Csa.size();
vector<glm::tvec2<float, glm::defaultp>> vals;
vals.reserve(m_Ember.m_Curves.m_Points[0].size());
for (glm::length_t i = 0; i < m_Ember.m_Curves.m_Points.size(); i++)//Overall, r, g, b.
{
for (auto& p : m_Ember.m_Curves.m_Points[i])
vals.push_back(p);
if (!m_Ember.m_Curves.m_Points[i].empty())
{
Spline<float> spline(m_Ember.m_Curves.m_Points[i]);//Will internally sort.
Spline<float> spline(vals);//Will internally sort.
for (glm::length_t j = 0; j < st; j++)
m_Csa[j][i] = spline.Interpolate(j * ONE_OVER_CURVES_LENGTH_M1);
vals.clear();
for (glm::length_t j = 0; j < st; j++)
m_Csa[j][i] = spline.Interpolate(j * ONE_OVER_CURVES_LENGTH_M1);
}
}
//t.Toc("ComputeCurves");
}
}