summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2011-01-14 11:06:57 +0000
committerJazzyNico <nicoduf@yahoo.fr>2011-01-14 11:06:57 +0000
commit1239eae9d7c71b1d440eeb795de1984740c34df8 (patch)
treed53195ad4b2f3a7aad1a6747c45a3b645f967583 /src/extension
parentExtensions. Text support improvement in XAML and FXG export. (diff)
downloadinkscape-1239eae9d7c71b1d440eeb795de1984740c34df8.tar.gz
inkscape-1239eae9d7c71b1d440eeb795de1984740c34df8.zip
Filters. Some custom predefined filters fixes and tweaks (Silhouette and Neon Draw).
(bzr r10005)
Diffstat (limited to 'src/extension')
-rwxr-xr-xsrc/extension/internal/filter/abc.h4
-rwxr-xr-xsrc/extension/internal/filter/experimental.h28
2 files changed, 12 insertions, 20 deletions
diff --git a/src/extension/internal/filter/abc.h b/src/extension/internal/filter/abc.h
index b96585113..e0eeec7cb 100755
--- a/src/extension/internal/filter/abc.h
+++ b/src/extension/internal/filter/abc.h
@@ -717,7 +717,7 @@ Roughen::get_filter_text (Inkscape::Extension::Extension * ext)
Repaint anything visible monochrome
Filter's parameters:
- * Blur (0.->50., default 0) -> blur (stdDeviation)
+ * Blur (0.01->50., default 0.01) -> blur (stdDeviation)
* Cutout (boolean, default False) -> composite (false=in, true=out)
* Color (guint, default 0,0,0,255) -> flood (flood-color, flood-opacity)
*/
@@ -735,7 +735,7 @@ public:
"<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
"<name>" N_("Silhouette, custom (ABCs)") "</name>\n"
"<id>org.inkscape.effect.filter.Silhouette</id>\n"
- "<param name=\"blur\" gui-text=\"" N_("Blur:") "\" type=\"float\" min=\"0.\" max=\"50\">0</param>\n"
+ "<param name=\"blur\" gui-text=\"" N_("Blur:") "\" type=\"float\" min=\"0.01\" max=\"50\">0.01</param>\n"
"<param name=\"cutout\" gui-text=\"" N_("Cutout") "\" type=\"boolean\">false</param>\n"
"<param name=\"color\" gui-text=\"" N_("Color") "\" type=\"color\">255</param>\n"
"<effect>\n"
diff --git a/src/extension/internal/filter/experimental.h b/src/extension/internal/filter/experimental.h
index 0375f008d..07b376954 100755
--- a/src/extension/internal/filter/experimental.h
+++ b/src/extension/internal/filter/experimental.h
@@ -498,8 +498,8 @@ public:
"<name>" N_("Neon draw, custom") "</name>\n"
"<id>org.inkscape.effect.filter.NeonDraw</id>\n"
"<param name=\"type\" gui-text=\"" N_("Line type:") "\" type=\"enum\">\n"
- "<_item value=\"smooth\">Smoothed</_item>\n"
- "<_item value=\"hard\">Contrasted</_item>\n"
+ "<_item value=\"table\">Smoothed</_item>\n"
+ "<_item value=\"discrete\">Contrasted</_item>\n"
"</param>\n"
"<param name=\"simply\" gui-text=\"" N_("Simplify:") "\" type=\"float\" min=\"0.01\" max=\"20.0\">1.5</param>\n"
"<param name=\"width\" gui-text=\"" N_("Line width:") "\" type=\"float\" min=\"0.01\" max=\"20.0\">1.5</param>\n"
@@ -532,27 +532,19 @@ NeonDraw::get_filter_text (Inkscape::Extension::Extension * ext)
std::ostringstream simply;
std::ostringstream width;
std::ostringstream lightness;
- std::ostringstream type1;
- std::ostringstream type2;
+ std::ostringstream type;
std::ostringstream dark;
- const gchar *type = ext->get_param_enum("type");
- if ((g_ascii_strcasecmp("smooth", type) == 0)) {
- type1 << "table";
- type2 << "table";
- } else {
- type1 << "discrete";
- type2 << "discrete";
- }
-
+ type << ext->get_param_enum("type");
blend << ext->get_param_enum("blend");
simply << ext->get_param_float("simply");
width << ext->get_param_float("width");
lightness << ext->get_param_float("lightness");
+ const gchar *typestr = ext->get_param_enum("type");
if (ext->get_param_bool("dark"))
dark << "component2";
- else if ((g_ascii_strcasecmp("smooth", type) == 0))
+ else if ((g_ascii_strcasecmp("table", typestr) == 0))
dark << "blur2";
else
dark << "component1";
@@ -562,9 +554,9 @@ NeonDraw::get_filter_text (Inkscape::Extension::Extension * ext)
"<feBlend blend=\"normal\" mode=\"%s\" result=\"blend\" />\n"
"<feGaussianBlur in=\"blend\" stdDeviation=\"%s\" result=\"blur1\" />\n"
"<feComponentTransfer result=\"component1\">\n"
- "<feFuncR type=\"%s\" tableValues=\"0 0.3 0.6 1 1\" />\n"
- "<feFuncG type=\"%s\" tableValues=\"0 0.3 0.6 1 1\" />\n"
- "<feFuncB type=\"%s\" tableValues=\"0 0.3 0.6 1 1\" />\n"
+ "<feFuncR type=\"discrete\" tableValues=\"0 0.3 0.6 1 1\" />\n"
+ "<feFuncG type=\"discrete\" tableValues=\"0 0.3 0.6 1 1\" />\n"
+ "<feFuncB type=\"discrete\" tableValues=\"0 0.3 0.6 1 1\" />\n"
"</feComponentTransfer>\n"
"<feGaussianBlur in=\"component1\" stdDeviation=\"%s\" result=\"blur2\" />\n"
"<feComponentTransfer in=\"blur2\" result=\"component2\">\n"
@@ -574,7 +566,7 @@ NeonDraw::get_filter_text (Inkscape::Extension::Extension * ext)
"</feComponentTransfer>\n"
"<feComposite in=\"component2\" in2=\"%s\" k3=\"%s\" operator=\"arithmetic\" k2=\"1\" result=\"composite1\" />\n"
"<feComposite in=\"composite1\" in2=\"SourceGraphic\" operator=\"in\" result=\"composite2\" />\n"
- "</filter>\n", blend.str().c_str(), simply.str().c_str(), type1.str().c_str(), type1.str().c_str(), type1.str().c_str(), width.str().c_str(), type2.str().c_str(), type2.str().c_str(), type2.str().c_str(), dark.str().c_str(), lightness.str().c_str());
+ "</filter>\n", blend.str().c_str(), simply.str().c_str(), width.str().c_str(), type.str().c_str(), type.str().c_str(), type.str().c_str(), dark.str().c_str(), lightness.str().c_str());
return _filter;
}; /* NeonDraw filter */