display hue chroma lumaref on mask curves - dispaly 1:1 in some expanders - thanks to Pandagrapher

This commit is contained in:
Desmis
2019-03-04 10:20:08 +01:00
parent 65a418ae27
commit 5156edeb8a
11 changed files with 175 additions and 79 deletions

View File

@@ -39,7 +39,8 @@ MyFlatCurve::MyFlatCurve () :
deletedPointX(0.0),
leftTanHandle({0.0, 0.0}),
rightTanHandle({0.0, 0.0}),
draggingElement(false)
draggingElement(false),
locallabRef(0.0)
{
graphW = get_allocation().get_width() - RADIUS * 2;
@@ -164,6 +165,19 @@ void MyFlatCurve::draw ()
Gdk::RGBA c;
// 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();
}
cr->set_line_width (1.0);
// draw f(x)=0.5 line
@@ -1872,6 +1886,35 @@ void MyFlatCurve::stopNumericalAdjustment()
}
}
void MyFlatCurve::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 MyFlatCurve::setType (FlatCurveType t)
{