Update background with luma and chroma ref for L C curves Color and Light

This commit is contained in:
Desmis
2020-07-15 11:38:03 +02:00
parent af0b83be81
commit 7ce4d0eb52
5 changed files with 75 additions and 1 deletions

View File

@@ -39,7 +39,9 @@ MyDiagonalCurve::MyDiagonalCurve () :
ugpX(0.0),
ugpY(0.0),
activeParam(-1),
bghistvalid(false)
bghistvalid(false),
locallabRef(0.0)
{
grab_point = -1;
@@ -129,6 +131,36 @@ std::vector<double> MyDiagonalCurve::get_vector (int veclen)
return vector;
}
void MyDiagonalCurve::updateLocallabBackground(double ref)
{
locallabRef = ref;
mcih->pending++;
idle_register.add(
[this]() -> bool
{
if (mcih->destroyed) {
if (mcih->pending == 1) {
delete mcih;
} else {
--mcih->pending;
}
return false;
}
mcih->clearPixmap();
mcih->myCurve->queue_draw();
--mcih->pending;
return false;
}
);
}
void MyDiagonalCurve::get_LUT (LUTf &lut)
{
@@ -260,6 +292,20 @@ void MyDiagonalCurve::draw (int handle)
cr->set_line_width (1.0 * s);
// Draw Locallab reference value in the background
if (locallabRef > 0.0) {
cr->set_line_width(1.0);
cr->move_to(double(graphX + 1), double(graphY - 1));
c = style->get_color(state);
cr->set_source_rgba(c.get_red(), c.get_green(), c.get_blue(), 0.2);
cr->line_to(double(graphX + 1), double(graphY - 1) - double(graphH - 2));
cr->line_to(double(graphX) + 1.5 + locallabRef*double(graphW -2), double(graphY - 1) - double(graphH - 2));
cr->line_to(double(graphX) + 1.5 + locallabRef*double(graphW -2), double(graphY - 1));
cr->close_path();
cr->fill();
cr->stroke();
}
// draw the left colored bar
if (leftBar) {
// first the background