From: jucablues Date: Fri, 18 Jan 2008 10:40:23 +0000 (+0000) Subject: info-box for filter effects dialog X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e516eaa7497ddc87b5f6a96941d316d265b46ebc;p=inkscape.git info-box for filter effects dialog --- diff --git a/share/icons/Makefile.am b/share/icons/Makefile.am index 6ab7851ea..fc9fe9294 100644 --- a/share/icons/Makefile.am +++ b/share/icons/Makefile.am @@ -1,7 +1,31 @@ iconsdir = $(datadir)/inkscape/icons -pixmaps = +pixmaps = \ + feBlend-icon.png \ + feBlend-icon.svg \ + feColorMatrix-icon.png \ + feColorMatrix-icon.svg \ + feComposite-icon.png \ + feComposite-icon.svg \ + feConvolveMatrix-icon.png \ + feConvolveMatrix-icon.svg \ + feDiffuseLighting-icon.png \ + feDiffuseLighting-icon.svg \ + feFlood-icon.png \ + feFlood-icon.svg \ + feGaussianBlur-icon.png \ + feGaussianBlur-icon.svg \ + feMerge-icon.png \ + feMerge-icon.svg \ + feMorphology-icon.png \ + feMorphology-icon.svg \ + feOffset-icon.png \ + feOffset-icon.svg \ + feSpecularLighting-icon.png \ + feSpecularLighting-icon.svg \ + feTurbulence-icon.png \ + feTurbulence-icon.svg icons_DATA = \ $(pixmaps) \ diff --git a/share/icons/feBlend-icon.png b/share/icons/feBlend-icon.png new file mode 100644 index 000000000..ac30bdc64 Binary files /dev/null and b/share/icons/feBlend-icon.png differ diff --git a/share/icons/feBlend-icon.svg b/share/icons/feBlend-icon.svg new file mode 100644 index 000000000..4b288d240 --- /dev/null +++ b/share/icons/feBlend-icon.svg @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + feBlend Filter Primitive Example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + + + + + feBlend Example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feColorMatrix-icon.png b/share/icons/feColorMatrix-icon.png new file mode 100644 index 000000000..9c1192b1c Binary files /dev/null and b/share/icons/feColorMatrix-icon.png differ diff --git a/share/icons/feColorMatrix-icon.svg b/share/icons/feColorMatrix-icon.svg new file mode 100644 index 000000000..1427636de --- /dev/null +++ b/share/icons/feColorMatrix-icon.svg @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + c + + + + + + hexamines icon + + + + this is an image originaly intended to be used in inkscape + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feComposite-icon.png b/share/icons/feComposite-icon.png new file mode 100644 index 000000000..ac30bdc64 Binary files /dev/null and b/share/icons/feComposite-icon.png differ diff --git a/share/icons/feComposite-icon.svg b/share/icons/feComposite-icon.svg new file mode 100644 index 000000000..5e8b16399 --- /dev/null +++ b/share/icons/feComposite-icon.svg @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + feComposite Filter Primitive Example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + + + + + feComposite Example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feConvolveMatrix-icon.png b/share/icons/feConvolveMatrix-icon.png new file mode 100644 index 000000000..3cd7fb323 Binary files /dev/null and b/share/icons/feConvolveMatrix-icon.png differ diff --git a/share/icons/feConvolveMatrix-icon.svg b/share/icons/feConvolveMatrix-icon.svg new file mode 100644 index 000000000..954c4e043 --- /dev/null +++ b/share/icons/feConvolveMatrix-icon.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + feConvolveMatrix filter primitive example + 18 Jan 2008 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + ConvolveMatrix filter primitive example + + + this is an image originaly intended to be used in Inkscape + + + Felipe Corrêa da Silva Sanches + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feDiffuseLighting-icon.png b/share/icons/feDiffuseLighting-icon.png new file mode 100644 index 000000000..fb5ed7a8f Binary files /dev/null and b/share/icons/feDiffuseLighting-icon.png differ diff --git a/share/icons/feDiffuseLighting-icon.svg b/share/icons/feDiffuseLighting-icon.svg new file mode 100644 index 000000000..0de8beae7 --- /dev/null +++ b/share/icons/feDiffuseLighting-icon.svg @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + Lighting effects example + 18 Jan 2008 + + + Niko Kiirala. Derived by Felipe Sanches + + + + + Copyright 2007 Niko Kiirala, Felipe Sanches licensed under Creatice Commons by-sa 3.0 + + + + + feDiffuseLighting + feSpecularLighting + light + lighting effects + + + An example, how to make metallic-looking objects with SVG lighting effects + + + Felipe Corrêa da Silva Sanches + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feFlood-icon.png b/share/icons/feFlood-icon.png new file mode 100644 index 000000000..de1a42151 Binary files /dev/null and b/share/icons/feFlood-icon.png differ diff --git a/share/icons/feFlood-icon.svg b/share/icons/feFlood-icon.svg new file mode 100644 index 000000000..67e7d29ad --- /dev/null +++ b/share/icons/feFlood-icon.svg @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + feMorphology Filter Primitive Example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + + + + + feMorphology Example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feGaussianBlur-icon.png b/share/icons/feGaussianBlur-icon.png new file mode 100644 index 000000000..ccbb89217 Binary files /dev/null and b/share/icons/feGaussianBlur-icon.png differ diff --git a/share/icons/feGaussianBlur-icon.svg b/share/icons/feGaussianBlur-icon.svg new file mode 100644 index 000000000..ae44ad47f --- /dev/null +++ b/share/icons/feGaussianBlur-icon.svg @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + feGaussianBlur filter primitive example + 18 Jan 2008 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + hexamines icon + + + this is an image originaly intended to be used in the hexamines game + + + Felipe Corrêa da Silva Sanches + + + c + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feMerge-icon.png b/share/icons/feMerge-icon.png new file mode 100644 index 000000000..ac30bdc64 Binary files /dev/null and b/share/icons/feMerge-icon.png differ diff --git a/share/icons/feMerge-icon.svg b/share/icons/feMerge-icon.svg new file mode 100644 index 000000000..47bca3c2b --- /dev/null +++ b/share/icons/feMerge-icon.svg @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + feMerge Filter Primitive Example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + + + + + feMerge Example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feMorphology-icon.png b/share/icons/feMorphology-icon.png new file mode 100644 index 000000000..a3fa7d4cd Binary files /dev/null and b/share/icons/feMorphology-icon.png differ diff --git a/share/icons/feMorphology-icon.svg b/share/icons/feMorphology-icon.svg new file mode 100644 index 000000000..d2de17c81 --- /dev/null +++ b/share/icons/feMorphology-icon.svg @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + feMorphology Filter Primitive Example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + c + + + + + + feMorphology Example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feOffset-icon.png b/share/icons/feOffset-icon.png new file mode 100644 index 000000000..41d2baa4b Binary files /dev/null and b/share/icons/feOffset-icon.png differ diff --git a/share/icons/feOffset-icon.svg b/share/icons/feOffset-icon.svg new file mode 100644 index 000000000..22a6f2a6d --- /dev/null +++ b/share/icons/feOffset-icon.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + image/svg+xml + + + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + c + + + + + + hexamines icon + + + + this is an image originaly intended to be used in the hexamines game + + + + + + + + + + + + + + + + diff --git a/share/icons/feSpecularLighting-icon.png b/share/icons/feSpecularLighting-icon.png new file mode 100644 index 000000000..fb5ed7a8f Binary files /dev/null and b/share/icons/feSpecularLighting-icon.png differ diff --git a/share/icons/feSpecularLighting-icon.svg b/share/icons/feSpecularLighting-icon.svg new file mode 100644 index 000000000..2cc70d25b --- /dev/null +++ b/share/icons/feSpecularLighting-icon.svg @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + Lighting effects example + 18 Jan 2007 + + + Niko Kiirala, derived by Felipe Sanches + + + + + Copyright 2008 Niko Kiirala, Felipe Sanches, licensed under Creatice Commons by-sa 3.0 + + + + + feDiffuseLighting + feSpecularLighting + light + lighting effects + + + An example, how to make metallic-looking objects with SVG lighting effects + + + Felipe Corrêa da Silva Sanches + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/icons/feTurbulence-icon.png b/share/icons/feTurbulence-icon.png new file mode 100644 index 000000000..e8f9df1df Binary files /dev/null and b/share/icons/feTurbulence-icon.png differ diff --git a/share/icons/feTurbulence-icon.svg b/share/icons/feTurbulence-icon.svg new file mode 100644 index 000000000..4b7baefc2 --- /dev/null +++ b/share/icons/feTurbulence-icon.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + image/svg+xml + + feTurbulence example + 2007-07-03 + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + Felipe Corrêa da Silva Sanches + + + + + + + + + feTurbulence example + + + + this is an image originaly intended to be used in Inkscape + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 8e6d678fc..f2c40b968 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -34,6 +34,7 @@ #include "filter-effects-dialog.h" #include "filter-enums.h" #include "inkscape.h" +#include "path-prefix.h" #include "selection.h" #include "sp-feblend.h" #include "sp-fecolormatrix.h" @@ -1889,6 +1890,7 @@ FilterEffectsDialog::FilterEffectsDialog() // Initialize widget hierarchy Gtk::HPaned* hpaned = Gtk::manage(new Gtk::HPaned); Gtk::ScrolledWindow* sw_prims = Gtk::manage(new Gtk::ScrolledWindow); + Gtk::HBox* infobox = Gtk::manage(new Gtk::HBox); Gtk::HBox* hb_prims = Gtk::manage(new Gtk::HBox); Gtk::Frame* fr_settings = Gtk::manage(new Gtk::Frame(_("Effect parameters"))); Gtk::Alignment* al_settings = Gtk::manage(new Gtk::Alignment); @@ -1896,19 +1898,27 @@ FilterEffectsDialog::FilterEffectsDialog() hpaned->pack1(_filter_modifier); hpaned->pack2(_primitive_box); _primitive_box.pack_start(*sw_prims); + _primitive_box.pack_start(*infobox,false, false); _primitive_box.pack_start(*hb_prims, false, false); sw_prims->add(_primitive_list); + infobox->pack_start(_infobox_icon, false, false); + infobox->pack_end(_infobox_desc, false, false); + _infobox_desc.set_line_wrap(true); + hb_prims->pack_end(_add_primitive_type, false, false); hb_prims->pack_end(_add_primitive, false, false); _getContents()->pack_start(*fr_settings, false, false); fr_settings->add(*al_settings); al_settings->add(_settings_box); - + _primitive_list.signal_primitive_changed().connect( sigc::mem_fun(*this, &FilterEffectsDialog::update_settings_view)); _filter_modifier.signal_filter_changed().connect( sigc::mem_fun(_primitive_list, &PrimitiveList::update)); + _add_primitive_type.signal_changed().connect( + sigc::mem_fun(*this, &FilterEffectsDialog::update_primitive_infobox)); + sw_prims->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); sw_prims->set_shadow_type(Gtk::SHADOW_IN); al_settings->set_padding(0, 0, 12, 0); @@ -1921,6 +1931,7 @@ FilterEffectsDialog::FilterEffectsDialog() show_all_children(); init_settings_widgets(); _primitive_list.update(); + update_primitive_infobox(); } FilterEffectsDialog::~FilterEffectsDialog() @@ -2044,6 +2055,76 @@ void FilterEffectsDialog::add_primitive() } } +void FilterEffectsDialog::update_primitive_infobox() +{ + switch(_add_primitive_type.get_active_data()->id){ + case(NR::NR_FILTER_BLEND): + _infobox_icon.set(g_strdup_printf("%s/feBlend-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feBlend filter primitive gives us 4 image blending modes: screen, multiply, darken and lighten.")); + break; + case(NR::NR_FILTER_COLORMATRIX): + _infobox_icon.set(g_strdup_printf("%s/feColorMatrix-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feColorMatrix filter primitive applies a matrix transformation to colour of each rendered pixel. This allows for effects like turning object to grayscale, modifying colour saturation and changing colour hue.")); + break; + case(NR::NR_FILTER_COMPONENTTRANSFER): + //_infobox_icon.set(g_strdup_printf("%s/feComponentTransfer-icon.png", INKSCAPE_PIXMAPDIR)); + //_infobox_desc.set_markup(_("")); + break; + case(NR::NR_FILTER_COMPOSITE): + _infobox_icon.set(g_strdup_printf("%s/feComposite-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feComposite filter primitive composites two images using one of the Porter-Duff blending modes or the aritmetic mode described in SVG standard. Porter-Duff blending modes are essentially logical operations between the corresponding pixel values of the images.")); + break; + case(NR::NR_FILTER_CONVOLVEMATRIX): + _infobox_icon.set(g_strdup_printf("%s/feConvolveMatrix-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feConvolveMatrix lets you specify a Convolution to be applied on the image. Common effects created using convolution matrices are blur, sharpening, embossing and edge detection. Note that while gaussian blur can be created using this filter primitive, the special gaussian blur primitive is faster and resolution-independent.")); + break; + case(NR::NR_FILTER_DIFFUSELIGHTING): + _infobox_icon.set(g_strdup_printf("%s/feDiffuseLighting-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("Filter primitives feDiffuseLighting and feSpecularLighting create lighting maps for the object in input image. These filters use alpha channel of input image as a height map: the more opaque given point in input image is, the nearer spectator it is considered to be.")); + break; + case(NR::NR_FILTER_DISPLACEMENTMAP): + _infobox_icon.set(g_strdup_printf("%s/feDisplacementMap-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feDisplacementMap filter primitive displaces the pixels in the first input using the second input as a displacement map, that shows from how far the pixel should come from. Classical examples are whirl and pinch effects.")); + break; + case(NR::NR_FILTER_FLOOD): + _infobox_icon.set(g_strdup_printf("%s/feFlood-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feFlood filter primitive fills its region with a given color and opacity. It can be used as an auxiliary tool, usualy in combination with other filter primitives, in order to facilitate some common color handling operations.")); + break; + case(NR::NR_FILTER_GAUSSIANBLUR): + _infobox_icon.set(g_strdup_printf("%s/feGaussianBlur-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feGaussianBlur filter primitive gives an out-of-focus aspect to images. It is commonly used toghether with feOffset in order to create a drop shadow effect.")); + break; + case(NR::NR_FILTER_IMAGE): + //_infobox_icon.set(g_strdup_printf("%s/feImage-icon.png", INKSCAPE_PIXMAPDIR)); + //_infobox_desc.set_markup(_("")); + break; + case(NR::NR_FILTER_MERGE): + _infobox_icon.set(g_strdup_printf("%s/feMerge-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feMerge filter primitive composites several temporary images inside the filter primitive to a single image. It uses normal alpha compositing for this. This is equivalent to using several feBlend primitives in 'normal' mode or several feComposite primitives in 'over' mode.")); + break; + case(NR::NR_FILTER_MORPHOLOGY): + _infobox_icon.set(g_strdup_printf("%s/feMorphology-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feMorphology filter primitive provides erode and dilate effects. For single-colour objects erode makes the object thinner and dilate makes it thicker.")); + break; + case(NR::NR_FILTER_OFFSET): + _infobox_icon.set(g_strdup_printf("%s/feOffset-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feOffset filter primitive offsets the image by an user-defined amount. For example, this is useful for drop shadows, where the shadow is in a slightly different position than the actual object.")); + break; + case(NR::NR_FILTER_SPECULARLIGHTING): + _infobox_icon.set(g_strdup_printf("%s/feSpecularLighting-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("Filter primitives feDiffuseLighting and feSpecularLighting create lighting maps for the object in input image. These filters use alpha channel of input image as a height map: the more opaque given point in input image is, the nearer spectator it is considered to be.")); + break; + case(NR::NR_FILTER_TILE): + //_infobox_icon.set(g_strdup_printf("%s/feTile-icon.png", INKSCAPE_PIXMAPDIR)); + //_infobox_desc.set_markup(_("")); + break; + case(NR::NR_FILTER_TURBULENCE): + _infobox_icon.set(g_strdup_printf("%s/feTurbulence-icon.png", INKSCAPE_PIXMAPDIR)); + _infobox_desc.set_markup(_("The feTurbulence filter primitive renders Perlin noise. This kind of noise is useful in simulating several nature phenomena like clouds, fire and smoke and in generating complex textures like marble or granite.")); + break; + } +} + void FilterEffectsDialog::duplicate_primitive() { SPFilter* filter = _filter_modifier.get_selected_filter(); diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 34f282fbb..3d105dfd0 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -215,10 +215,15 @@ private: void update_settings_view(); void update_settings_sensitivity(); void update_color_matrix(); + void update_primitive_infobox(); // Filter effect selection FilterModifier _filter_modifier; + // Primitives Info Box + Gtk::Label _infobox_desc; + Gtk::Image _infobox_icon; + // View/add primitives Gtk::VBox _primitive_box; PrimitiveList _primitive_list;