From 7244b95844cfa73aefe78f66517d6c9bf819ee35 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 18 Jun 2022 11:30:11 +0200 Subject: [PATCH] Documentation and icons for FrameBuffer filters unified icons, new entry in help window. --- FrameBufferFilter.cpp | 2 +- FrameBufferFilter.h | 11 +++++ ImGuiVisitor.cpp | 17 ++++---- UserInterfaceManager.cpp | 89 ++++++++++++++++++++++++++++++++++----- rsc/images/icons.dds | Bin 1638528 -> 1638528 bytes 5 files changed, 98 insertions(+), 21 deletions(-) diff --git a/FrameBufferFilter.cpp b/FrameBufferFilter.cpp index efcd847..276bb6a 100644 --- a/FrameBufferFilter.cpp +++ b/FrameBufferFilter.cpp @@ -6,7 +6,7 @@ #include "FrameBufferFilter.h" const char* FrameBufferFilter::type_label[FrameBufferFilter::FILTER_INVALID] = { - "None", "Delay", "Resample", "Blur", "Sharpen", "Smooth & Noise", "Edge", "Transparency", "Custom shader" + "None", "Delay", "Resample", "Blur", "Sharpen", "Smooth & Noise", "Edge", "Alpha", "Custom shader" }; FrameBufferFilter::FrameBufferFilter() : enabled_(true), input_(nullptr) diff --git a/FrameBufferFilter.h b/FrameBufferFilter.h index 11a0743..b5ae301 100644 --- a/FrameBufferFilter.h +++ b/FrameBufferFilter.h @@ -7,6 +7,17 @@ class Visitor; class FrameBuffer; + +#define ICON_FILTER_DELAY 10, 15 +#define ICON_FILTER_RESAMPLE 1, 10 +#define ICON_FILTER_BLUR 0, 9 +#define ICON_FILTER_SHARPEN 2, 1 +#define ICON_FILTER_SMOOTH 14, 8 +#define ICON_FILTER_EDGE 16, 8 +#define ICON_FILTER_ALPHA 13, 4 +#define ICON_FILTER_IMAGE 1, 4 + + class FrameBufferFilter { bool enabled_; diff --git a/ImGuiVisitor.cpp b/ImGuiVisitor.cpp index c8b2712..888a2ed 100644 --- a/ImGuiVisitor.cpp +++ b/ImGuiVisitor.cpp @@ -724,7 +724,7 @@ void ImGuiVisitor::visit (PassthroughFilter&) void ImGuiVisitor::visit (DelayFilter& f) { - if (ImGuiToolkit::IconButton(10, 15)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_DELAY)) { f.setDelay(0.f); Action::manager().store("Delay 0 s"); } @@ -745,7 +745,7 @@ void ImGuiVisitor::visit (ResampleFilter& f) std::ostringstream oss; // Resampling Factor selection - if (ImGuiToolkit::IconButton(8, 5)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_RESAMPLE)) { f.setFactor( 0 ); oss << "Resample " << ResampleFilter::factor_label[0]; Action::manager().store(oss.str()); @@ -766,7 +766,7 @@ void ImGuiVisitor::visit (BlurFilter& f) oss << "Blur "; // Method selection - if (ImGuiToolkit::IconButton(7, 16)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_BLUR)) { f.setMethod( 0 ); oss << BlurFilter::method_label[0]; Action::manager().store(oss.str()); @@ -812,7 +812,7 @@ void ImGuiVisitor::visit (SharpenFilter& f) oss << "Sharpen "; // Method selection - if (ImGuiToolkit::IconButton(2, 1)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_SHARPEN)) { f.setMethod( 0 ); oss << SharpenFilter::method_label[0]; Action::manager().store(oss.str()); @@ -857,7 +857,7 @@ void ImGuiVisitor::visit (SmoothFilter& f) oss << "Smooth "; // Method selection - if (ImGuiToolkit::IconButton(14, 8)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_SMOOTH)) { f.setMethod( 0 ); oss << SmoothFilter::method_label[0]; Action::manager().store(oss.str()); @@ -902,7 +902,7 @@ void ImGuiVisitor::visit (EdgeFilter& f) oss << "Edge "; // Method selection - if (ImGuiToolkit::IconButton(16, 8)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_EDGE)) { f.setMethod( 0 ); oss << EdgeFilter::method_label[0]; Action::manager().store(oss.str()); @@ -947,7 +947,7 @@ void ImGuiVisitor::visit (AlphaFilter& f) oss << "Alpha "; // Method selection - if (ImGuiToolkit::IconButton(13, 4)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_ALPHA)) { f.setOperation( 0 ); oss << AlphaFilter::operation_label[0]; Action::manager().store(oss.str()); @@ -1029,7 +1029,7 @@ void ImGuiVisitor::visit (AlphaFilter& f) void ImGuiVisitor::visit (ImageFilter& f) { // Selection of Algorithm - if (ImGuiToolkit::IconButton(1, 4)) { + if (ImGuiToolkit::IconButton(ICON_FILTER_IMAGE)) { FilteringProgram target; f.setProgram( target ); } @@ -1071,7 +1071,6 @@ void ImGuiVisitor::visit (ImageFilter& f) // } // Open Editor -// ImGuiToolkit::IconButton(18, 18); ImGui::SameLine(0, IMGUI_SAME_LINE); if ( ImGui::Button( ICON_FA_CODE " Open editor", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) Settings::application.widget.shader_editor = true; diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index e2bd3f5..175b1a4 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -1592,8 +1592,8 @@ void HelperToolbox::Render() if (ImGui::BeginMenu(IMGUI_TITLE_HELP)) { // Enable/Disable Ableton Link - if ( ImGui::MenuItem( ICON_FA_EXTERNAL_LINK_ALT " Online user manual") ) { - SystemToolkit::open("https://github.com/brunoherbelin/vimix/wiki/User-manual"); + if ( ImGui::MenuItem( ICON_FA_BOOK_OPEN " Online wiki") ) { + SystemToolkit::open("https://github.com/brunoherbelin/vimix/wiki"); } // Enable/Disable tooltips @@ -1615,6 +1615,25 @@ void HelperToolbox::Render() const float width_window = ImGui::GetWindowSize().x - ImGui::GetFontSize(); const float width_column0 = ImGui::GetFontSize() * 6; + + if (ImGui::CollapsingHeader("Documentation", ImGuiTreeNodeFlags_DefaultOpen)) + { + + ImGui::Columns(2, "viewscolumn", false); // 4-ways, with border + ImGui::SetColumnWidth(0, width_column0); + + ImGui::Text("User manual"); ImGui::NextColumn(); + ImGuiToolkit::ButtonOpenUrl("Online user manual", "https://github.com/brunoherbelin/vimix/wiki/User-manual", ImVec2(ImGui::GetContentRegionAvail().x, 0)); + ImGui::NextColumn(); + ImGui::Text("OSC"); ImGui::NextColumn(); + ImGuiToolkit::ButtonOpenUrl("Open Sound Control API", "https://github.com/brunoherbelin/vimix/wiki/Open-Sound-Control-API", ImVec2(ImGui::GetContentRegionAvail().x, 0)); + ImGui::NextColumn(); + ImGui::Text("SRT"); ImGui::NextColumn(); + ImGuiToolkit::ButtonOpenUrl("Secure Reliable Transport Broadcast", "https://github.com/brunoherbelin/vimix/wiki/SRT-stream-I-O", ImVec2(ImGui::GetContentRegionAvail().x, 0)); + + ImGui::Columns(1); + } + if (ImGui::CollapsingHeader("Views")) { @@ -1729,7 +1748,7 @@ void HelperToolbox::Render() ImGui::Text ("Displays the rendering output as a source, with or without loopback."); ImGui::NextColumn(); ImGuiToolkit::Icon(ICON_SOURCE_CLONE); ImGui::SameLine(0, IMGUI_SAME_LINE);ImGui::Text("Clone"); ImGui::NextColumn(); - ImGui::Text ("Clone a source into another source, possibly with a short delay."); + ImGui::Text ("Clone a source into another source with a filter."); ImGui::NextColumn(); ImGuiToolkit::Icon(ICON_SOURCE_GROUP); ImGui::SameLine(0, IMGUI_SAME_LINE);ImGui::Text("Group"); ImGui::NextColumn(); ImGui::Text ("Group of sources rendered together after flattenning them in Layers view."); @@ -1738,7 +1757,53 @@ void HelperToolbox::Render() ImGui::PopTextWrapPos(); } - if (ImGui::CollapsingHeader("Inputs")) + if (ImGui::CollapsingHeader("Filters")) + { + ImGui::Text("Select 'Clone & Filter' on a source to access filters;"); + + ImGui::Columns(2, "windowcolumn", false); // 4-ways, with border + ImGui::SetColumnWidth(0, width_column0); + ImGui::PushTextWrapPos(width_window ); + + ImGuiToolkit::Icon(ICON_FILTER_DELAY); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Delay"); ImGui::NextColumn(); + ImGui::Text("Postpones the display of the input source by a given delay (between 0.0 and 2.0 seconds)."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_RESAMPLE); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Resample"); ImGui::NextColumn(); + ImGui::Text ("Displays the input source with a different resolution. Downsampling is producing a smaller resolution (half or quarter). Upsampling is producing a higher resolution (double). GPU filtering is applied to improve scaling quality."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_BLUR); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Blur"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU bluring filter. Radius of the filter (when available) is a fraction of the image height. "); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_SHARPEN); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Sharpen"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU sharpening filter."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_SMOOTH); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Smooth"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU smoothing filters to reduce noise. Inverse filters to add noise or grain are also available."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_EDGE); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Edge"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU filter to outline edges."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_ALPHA); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Alpha"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU chroma-key (green screen) or luma-key (black screen). Inverse filter fills transparent alpha with an opaque color."); + ImGui::NextColumn(); + ImGuiToolkit::Icon(ICON_FILTER_IMAGE); ImGui::SameLine(0, IMGUI_SAME_LINE); + ImGui::Text("Custom"); ImGui::NextColumn(); + ImGui::Text ("Applies a real-time GPU fragment shader defined by custom code in OpenGL Shading Language (GLSL). "); + ImGuiToolkit::ButtonOpenUrl("About GLSL", "https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language", ImVec2(ImGui::GetContentRegionAvail().x, 0)); + ImGuiToolkit::ButtonOpenUrl("Browse shadertoy.com", "https://www.shadertoy.com", ImVec2(ImGui::GetContentRegionAvail().x, 0)); + + ImGui::Columns(1); + ImGui::PopTextWrapPos(); + } + + if (ImGui::CollapsingHeader("Input Mapping")) { ImGui::Columns(2, "inputcolumn", false); // 4-ways, with border ImGui::SetColumnWidth(0, width_column0); @@ -1761,7 +1826,7 @@ void HelperToolbox::Render() ImGui::PopTextWrapPos(); } - if (ImGui::CollapsingHeader("Keyboard shortcuts", ImGuiTreeNodeFlags_DefaultOpen)) + if (ImGui::CollapsingHeader("Keyboard shortcuts")) { ImGui::Columns(2, "keyscolumns", false); // 4-ways, with border ImGui::SetColumnWidth(0, width_column0); @@ -1770,6 +1835,10 @@ void HelperToolbox::Render() ImGui::Text(ICON_FA_BARS " Main menu"); ImGui::NextColumn(); ImGui::Text("INS"); ImGui::NextColumn(); ImGui::Text(ICON_FA_PLUS " New source"); ImGui::NextColumn(); + ImGui::Text("DEL"); ImGui::NextColumn(); + ImGui::Text(ICON_FA_BACKSPACE " Delete source"); ImGui::NextColumn(); + ImGui::Text("TAB"); ImGui::NextColumn(); + ImGui::Text(ICON_FA_EXCHANGE_ALT " Switch Current source"); ImGui::NextColumn(); ImGui::Text("F1"); ImGui::NextColumn(); ImGui::Text(ICON_FA_BULLSEYE " Mixing view"); ImGui::NextColumn(); ImGui::Text("F2"); ImGui::NextColumn(); @@ -1778,10 +1847,6 @@ void HelperToolbox::Render() ImGui::Text(ICON_FA_LAYER_GROUP " Layers view"); ImGui::NextColumn(); ImGui::Text("F4"); ImGui::NextColumn(); ImGui::Text(ICON_FA_CHESS_BOARD " Texturing view"); ImGui::NextColumn(); - ImGui::Text(ICON_FA_BACKSPACE " DEL"); ImGui::NextColumn(); - ImGui::Text("Delete Current source"); ImGui::NextColumn(); - ImGui::Text(ICON_FA_EXCHANGE_ALT " TAB"); ImGui::NextColumn(); - ImGui::Text("Switch Current source"); ImGui::NextColumn(); ImGui::Text(CTRL_MOD "TAB"); ImGui::NextColumn(); ImGui::Text("Switch view"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_FULLSCREEN); ImGui::NextColumn(); @@ -1795,6 +1860,8 @@ void HelperToolbox::Render() ImGui::Text(ICON_FA_CLOCK " " TOOLTIP_TIMER "window"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_INPUTS); ImGui::NextColumn(); ImGui::Text(ICON_FA_HAND_PAPER " " TOOLTIP_INPUTS "window"); ImGui::NextColumn(); + ImGui::Text(SHORTCUT_SHADEREDITOR); ImGui::NextColumn(); + ImGui::Text(ICON_FA_CODE " " TOOLTIP_SHADEREDITOR "window"); ImGui::NextColumn(); ImGui::Text(SHORTCUT_NOTE); ImGui::NextColumn(); ImGui::Text(ICON_FA_STICKY_NOTE " " TOOLTIP_NOTE); ImGui::NextColumn(); ImGui::Text("ESC"); ImGui::NextColumn(); @@ -5418,7 +5485,7 @@ void ShaderEditor::Render() if (ImGui::MenuItem( MENU_UNDO, SHORTCUT_UNDO, nullptr, !ro && _editor.CanUndo())) _editor.Undo(); - if (ImGui::MenuItem( MENU_REDO, SHORTCUT_REDO, nullptr, !ro && _editor.CanRedo())) + if (ImGui::MenuItem( MENU_REDO, CTRL_MOD "Y", nullptr, !ro && _editor.CanRedo())) _editor.Redo(); if (ImGui::MenuItem( MENU_COPY, SHORTCUT_COPY, nullptr, _editor.HasSelection())) _editor.Copy(); @@ -5493,7 +5560,7 @@ void ShaderEditor::Render() std::string num = m.str().substr(2, m.length()-2); if ( BaseToolkit::is_a_number(num, &l)){ status_ += "line "; - status_ += std::to_string(l-16); + status_ += std::to_string(l-15); } s = m.suffix().str(); } diff --git a/rsc/images/icons.dds b/rsc/images/icons.dds index 6c8a230dbc056a9717c898d24ae9618a1830fa59..850dd053278b50eab4cd892712fdf0fc351c346d 100644 GIT binary patch delta 2417 zcmZ`)acCP=7{7NmNxQq&yQEuHrlyx7ZUdL)jukg1(OkA7Q>G><1wjTTL2=UgN0P~0 zd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