From: JazzyNico Date: Mon, 13 Sep 2010 19:28:57 +0000 (+0200) Subject: Filters. Experimental filters improvements (new default values and options). X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=642b1bd5f081069ac0dc8fea88468735465cfe1f;p=inkscape.git Filters. Experimental filters improvements (new default values and options). --- diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h index 4fd60aab8..08ba4b475 100644 --- a/src/extension/internal/filter/color.h +++ b/src/extension/internal/filter/color.h @@ -22,28 +22,29 @@ namespace Extension { namespace Internal { namespace Filter { -class Bicolorizer : public Inkscape::Extension::Internal::Filter::Filter { +class Duochrome : public Inkscape::Extension::Internal::Filter::Filter { protected: virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext); public: - Bicolorizer ( ) : Filter() { }; - virtual ~Bicolorizer ( ) { if (_filter != NULL) g_free((void *)_filter); return; } + Duochrome ( ) : Filter() { }; + virtual ~Duochrome ( ) { if (_filter != NULL) g_free((void *)_filter); return; } static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Bicolorizer -EXP-") "\n" - "org.inkscape.effect.filter.bicolorizer\n" + "" N_("Duochrome, custom -EXP-") "\n" + "org.inkscape.effect.filter.Duochrome\n" // Using color widgets in tabs makes Inkscape crash... // "\n" // "\n" + "false\n" "<_param name=\"header1\" type=\"groupheader\">Color 1\n" - "1946122495\n" + "1364325887\n" // "\n" // "\n" "<_param name=\"header2\" type=\"groupheader\">Color 2\n" - "367387135\n" + "-65281\n" // "\n" // "\n" "\n" @@ -55,13 +56,13 @@ public: "\n" "" N_("Change colors to a two colors palette") "\n" "\n" - "\n", new Bicolorizer()); + "\n", new Duochrome()); }; }; gchar const * -Bicolorizer::get_filter_text (Inkscape::Extension::Extension * ext) +Duochrome::get_filter_text (Inkscape::Extension::Extension * ext) { if (_filter != NULL) g_free((void *)_filter); @@ -73,9 +74,11 @@ Bicolorizer::get_filter_text (Inkscape::Extension::Extension * ext) std::ostringstream r2; std::ostringstream g2; std::ostringstream b2; + std::ostringstream fluo; guint32 color1 = ext->get_param_color("color1"); guint32 color2 = ext->get_param_color("color2"); + bool fluorescence = ext->get_param_bool("fluo"); a1 << (color1 & 0xff) / 255.0F; r1 << ((color1 >> 24) & 0xff); g1 << ((color1 >> 16) & 0xff); @@ -84,25 +87,24 @@ Bicolorizer::get_filter_text (Inkscape::Extension::Extension * ext) r2 << ((color2 >> 24) & 0xff); g2 << ((color2 >> 16) & 0xff); b2 << ((color2 >> 8) & 0xff); + if (fluorescence) fluo << ""; + else fluo << " in=\"result6\""; _filter = g_strdup_printf( - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" "\n" - "\n" + "\n" "\n" "\n" - "\n" - "\n" - "\n", a1.str().c_str(), r1.str().c_str(), g1.str().c_str(), b1.str().c_str(), a2.str().c_str(), r2.str().c_str(), g2.str().c_str(), b2.str().c_str()); + "\n" + "\n" + "\n" + "\n", a1.str().c_str(), r1.str().c_str(), g1.str().c_str(), b1.str().c_str(), a2.str().c_str(), r2.str().c_str(), g2.str().c_str(), b2.str().c_str(), fluo.str().c_str()); return _filter; }; diff --git a/src/extension/internal/filter/drop-shadow.h b/src/extension/internal/filter/drop-shadow.h index 914d9cf9d..d8c79e3cc 100644 --- a/src/extension/internal/filter/drop-shadow.h +++ b/src/extension/internal/filter/drop-shadow.h @@ -157,7 +157,7 @@ public: "3.0\n" "6.0\n" "6.0\n" - "0\n" + "127\n" "\n" "all\n" "\n" diff --git a/src/extension/internal/filter/filter-all.cpp b/src/extension/internal/filter/filter-all.cpp index de683ba83..ef168e09e 100644 --- a/src/extension/internal/filter/filter-all.cpp +++ b/src/extension/internal/filter/filter-all.cpp @@ -22,7 +22,7 @@ void Filter::filters_all (void ) { // Here come the filters which are coded in C++ in order to present a parameters dialog - Bicolorizer::init(); + Duochrome::init(); DropShadow::init(); DropGlow::init(); ColorizableDropShadow::init();