Finalizing implementation of chroma and luma key Transparency filters

This commit is contained in:
Bruno Herbelin
2022-06-07 23:49:21 +02:00
parent ea6502a282
commit f6d528d36d
4 changed files with 39 additions and 40 deletions

View File

@@ -922,6 +922,22 @@ void ImGuiVisitor::visit (AlphaFilter& f)
if ( m == AlphaFilter::ALPHA_CHROMAKEY || m == AlphaFilter::ALPHA_LUMAKEY)
{
float t = filter_parameters["Threshold"];
if (ImGuiToolkit::IconButton(13, 14)) {
t = 0.f;
f.setProgramParameter("Threshold", t);
}
ImGui::SameLine(0, IMGUI_SAME_LINE);
ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN);
if (ImGui::SliderFloat( "Threshold", &t, 0.f, 1.f, "%.2f")) {
f.setProgramParameter("Threshold", t);
}
if (ImGui::IsItemDeactivatedAfterEdit()) {
oss << AlphaFilter::operation_label[ f.operation() ];
oss << " : " << "Threshold" << " " << std::setprecision(3) << t;
Action::manager().store(oss.str());
}
float v = filter_parameters["Tolerance"];
if (ImGuiToolkit::IconButton(13, 14)) {
v = 0.f;