From bd6a4aa2e2e19da2d4d1c82c46ee02a7b828de35 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Sun, 7 Aug 2011 15:29:33 +0200 Subject: Filters. More filters reorganisation and consistency work. Translations. PO template, PO file list and French translation update. (bzr r10531) --- src/extension/internal/filter/blurs.h | 12 +-- src/extension/internal/filter/bumps.h | 24 +++--- src/extension/internal/filter/color.h | 111 +++------------------------ src/extension/internal/filter/filter-all.cpp | 2 +- src/extension/internal/filter/image.h | 6 +- src/extension/internal/filter/overlays.h | 4 +- src/extension/internal/filter/paint.h | 109 +++++++++++++++++++++++--- src/extension/internal/filter/shadows.h | 4 +- src/extension/internal/filter/transparency.h | 4 +- 9 files changed, 138 insertions(+), 138 deletions(-) (limited to 'src') diff --git a/src/extension/internal/filter/blurs.h b/src/extension/internal/filter/blurs.h index d6f9a79e6..b09a4f347 100644 --- a/src/extension/internal/filter/blurs.h +++ b/src/extension/internal/filter/blurs.h @@ -107,7 +107,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Clean edges") "\n" + "" N_("Clean Edges") "\n" "org.inkscape.effect.filter.CleanEdges\n" "0.4\n" "\n" @@ -134,7 +134,7 @@ CleanEdges::get_filter_text (Inkscape::Extension::Extension * ext) blur << ext->get_param_float("blur"); _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -167,7 +167,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Cross blur") "\n" + "" N_("Cross Blur") "\n" "org.inkscape.effect.filter.CrossBlur\n" "0\n" "0\n" @@ -211,7 +211,7 @@ CrossBlur::get_filter_text (Inkscape::Extension::Extension * ext) blend << ext->get_param_enum("blend"); _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -307,7 +307,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Image blur") "\n" + "" N_("Image Blur") "\n" "org.inkscape.effect.filter.ImageBlur\n" "\n" "\n" @@ -380,7 +380,7 @@ ImageBlur::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/bumps.h b/src/extension/internal/filter/bumps.h index 596d1547f..e8c80315a 100644 --- a/src/extension/internal/filter/bumps.h +++ b/src/extension/internal/filter/bumps.h @@ -37,7 +37,7 @@ namespace Filter { Options * Image simplification (0.01->10., default 0.01) -> blur1 (stdDeviation) * Bump simplification (0.01->10., default 0.01) -> blur2 (stdDeviation) - * Crop (-1.->1., default 0) -> composite1 (k3) + * Crop (-50.->50., default 1) -> composite1 (k3) * Red (-50.->50., default 0.) -> colormatrix1 (values) * Green (-50.->50., default 0.) -> colormatrix1 (values) * Blue (-50.->50., default 0.) -> colormatrix1 (values) @@ -85,8 +85,8 @@ public: "\n" "0.01\n" "0.01\n" - "0\n" - "<_param name=\"sourceHeader\" type=\"description\" appearance=\"header\">Bump source\n" + "1\n" + "<_param name=\"sourceHeader\" type=\"description\" appearance=\"header\">" N_("Bump source") "\n" "0\n" "0\n" "0\n" @@ -108,14 +108,14 @@ public: "<_item value=\"point\">" N_("Point") "\n" "<_item value=\"spot\">" N_("Spot") "\n" "\n" - "<_param name=\"distantHeader\" type=\"description\" appearance=\"header\">Distant light options\n" + "<_param name=\"distantHeader\" type=\"description\" appearance=\"header\">" N_("Distant light options") "\n" "225\n" "45\n" - "<_param name=\"pointHeader\" type=\"description\" appearance=\"header\">Point light options\n" + "<_param name=\"pointHeader\" type=\"description\" appearance=\"header\">" N_("Point light options") "\n" "526\n" "372\n" "150\n" - "<_param name=\"spotHeader\" type=\"description\" appearance=\"header\">Spot light options\n" + "<_param name=\"spotHeader\" type=\"description\" appearance=\"header\">" N_("Spot light options") "\n" "526\n" "372\n" "150\n" @@ -290,7 +290,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Diffuse light") "\n" + "" N_("Diffuse Light") "\n" "org.inkscape.effect.filter.DiffuseLight\n" "6\n" "25\n" @@ -334,7 +334,7 @@ DiffuseLight::get_filter_text (Inkscape::Extension::Extension * ext) a << (color & 0xff) / 255.0F; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -370,7 +370,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Matte jelly") "\n" + "" N_("Matte Jelly") "\n" "org.inkscape.effect.filter.MatteJelly\n" "7\n" "0.9\n" @@ -417,7 +417,7 @@ MatteJelly::get_filter_text (Inkscape::Extension::Extension * ext) a << (color & 0xff) / 255.0F; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -454,7 +454,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Specular light") "\n" + "" N_("Specular Light") "\n" "org.inkscape.effect.filter.SpecularLight\n" "6\n" "1\n" @@ -501,7 +501,7 @@ SpecularLight::get_filter_text (Inkscape::Extension::Extension * ext) a << (color & 0xff) / 255.0F; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h index e8de022b9..e19c2054d 100644 --- a/src/extension/internal/filter/color.h +++ b/src/extension/internal/filter/color.h @@ -13,7 +13,6 @@ * Color shift * Colorize * Duochrome - * Electrize * Greyscale * Lightness * Quadritone @@ -102,7 +101,7 @@ Brightness::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n", brightness.str().c_str(), sat.str().c_str(), sat.str().c_str(), lightness.str().c_str(), sat.str().c_str(), brightness.str().c_str(), @@ -143,7 +142,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Channel painting") "\n" + "" N_("Channel Painting") "\n" "org.inkscape.effect.filter.ChannelPaint\n" "\n" "\n" @@ -206,7 +205,7 @@ ChannelPaint::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -245,7 +244,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Color shift") "\n" + "" N_("Color Shift") "\n" "org.inkscape.effect.filter.ColorShift\n" "330\n" "0.6\n" @@ -275,7 +274,7 @@ ColorShift::get_filter_text (Inkscape::Extension::Extension * ext) sat << ext->get_param_float("sat"); _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n", shift.str().c_str(), sat.str().c_str()); @@ -380,7 +379,7 @@ Colorize::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -501,7 +500,7 @@ Duochrome::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -517,92 +516,6 @@ Duochrome::get_filter_text (Inkscape::Extension::Extension * ext) return _filter; }; /* Duochrome filter */ -/** - \brief Custom predefined Electrize filter. - - Electro solarization effects. - - Filter's parameters: - * Simplify (0.01->10., default 2.) -> blur (stdDeviation) - * Effect type (enum: table or discrete, default "table") -> component (type) - * Level (0->10, default 3) -> component (tableValues) - * Inverted (boolean, default false) -> component (tableValues) -*/ -class Electrize : public Inkscape::Extension::Internal::Filter::Filter { -protected: - virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext); - -public: - Electrize ( ) : Filter() { }; - virtual ~Electrize ( ) { if (_filter != NULL) g_free((void *)_filter); return; } - - static void init (void) { - Inkscape::Extension::build_from_mem( - "\n" - "" N_("Electrize") "\n" - "org.inkscape.effect.filter.Electrize\n" - "2.0\n" - "\n" - "<_item value=\"table\">" N_("Table") "\n" - "<_item value=\"discrete\">" N_("Discrete") "\n" - "\n" - "3\n" - "false\n" - "\n" - "all\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "" N_("Electro solarization effects") "\n" - "\n" - "\n", new Electrize()); - }; -}; - -gchar const * -Electrize::get_filter_text (Inkscape::Extension::Extension * ext) -{ - if (_filter != NULL) g_free((void *)_filter); - - std::ostringstream blur; - std::ostringstream type; - std::ostringstream values; - - blur << ext->get_param_float("blur"); - type << ext->get_param_enum("type"); - - // TransfertComponent table values are calculated based on the effect level and inverted parameters. - int val = 0; - int levels = ext->get_param_int("levels") + 1; - if (ext->get_param_bool("invert")) { - val = 1; - } - values << val; - for ( int step = 1 ; step <= levels ; step++ ) { - if (val == 1) { - val = 0; - } - else { - val = 1; - } - values << " " << val; - } - - _filter = g_strdup_printf( - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n" - "\n", blur.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str()); - - return _filter; -}; /* Electrize filter */ - /** \brief Custom predefined Greyscale filter. @@ -688,7 +601,7 @@ Greyscale::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n", line.str().c_str(), line.str().c_str(), line.str().c_str(), transparency.str().c_str()); return _filter; @@ -747,7 +660,7 @@ Lightness::get_filter_text (Inkscape::Extension::Extension * ext) offset << ext->get_param_float("offset"); _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -833,7 +746,7 @@ Quadritone::get_filter_text (Inkscape::Extension::Extension * ext) blend2 << ext->get_param_enum("blend2"); _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -913,7 +826,7 @@ Solarize::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -1065,7 +978,7 @@ Tritone::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/filter-all.cpp b/src/extension/internal/filter/filter-all.cpp index ffac97e0c..5b3280656 100755 --- a/src/extension/internal/filter/filter-all.cpp +++ b/src/extension/internal/filter/filter-all.cpp @@ -52,7 +52,6 @@ Filter::filters_all (void ) ColorShift::init(); Colorize::init(); Duochrome::init(); - Electrize::init(); Greyscale::init(); Lightness::init(); Quadritone::init(); @@ -69,6 +68,7 @@ Filter::filters_all (void ) Chromolitho::init(); CrossEngraving::init(); Drawing::init(); + Electrize::init(); NeonDraw::init(); Posterize::init(); PosterizeBasic::init(); diff --git a/src/extension/internal/filter/image.h b/src/extension/internal/filter/image.h index 3f1a33055..47744a2f6 100644 --- a/src/extension/internal/filter/image.h +++ b/src/extension/internal/filter/image.h @@ -46,7 +46,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Edge detect") "\n" + "" N_("Edge Detect") "\n" "org.inkscape.effect.filter.EdgeDetect\n" "\n" "<_item value=\"all\">" N_("All") "\n" @@ -59,7 +59,7 @@ public: "all\n" "\n" "\n" - "\n" + "\n" "\n" "\n" "" N_("Detect color edges in object") "\n" @@ -97,7 +97,7 @@ EdgeDetect::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n", matrix.str().c_str(), inverted.str().c_str(), level.str().c_str()); diff --git a/src/extension/internal/filter/overlays.h b/src/extension/internal/filter/overlays.h index 4c59b553b..0d02777d1 100644 --- a/src/extension/internal/filter/overlays.h +++ b/src/extension/internal/filter/overlays.h @@ -53,7 +53,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Noise fill") "\n" + "" N_("Noise Fill") "\n" "org.inkscape.effect.filter.NoiseFill\n" "\n" "\n" @@ -123,7 +123,7 @@ NoiseFill::get_filter_text (Inkscape::Extension::Extension * ext) inverted << "in"; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/paint.h b/src/extension/internal/filter/paint.h index 7a1cc6046..c2eb0c0ae 100644 --- a/src/extension/internal/filter/paint.h +++ b/src/extension/internal/filter/paint.h @@ -11,6 +11,7 @@ * Chromolitho * Cross engraving * Drawing + * Electrize * Neon draw * Posterize * Posterize basic @@ -228,7 +229,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Cross engraving") "\n" + "" N_("Cross Engraving") "\n" "org.inkscape.effect.filter.CrossEngraving\n" "30\n" "1\n" @@ -272,7 +273,7 @@ CrossEngraving::get_filter_text (Inkscape::Extension::Extension * ext) trans << "blend"; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -331,16 +332,16 @@ public: "org.inkscape.effect.filter.Drawing\n" "\n" "\n" - "<_param name=\"simplifyheader\" type=\"description\" appearance=\"header\">Simplify\n" + "<_param name=\"simplifyheader\" type=\"description\" appearance=\"header\">" N_("Simplify") "\n" "0.6\n" "10\n" "0\n" "false\n" - "<_param name=\"smoothheader\" type=\"description\" appearance=\"header\">Smoothness\n" + "<_param name=\"smoothheader\" type=\"description\" appearance=\"header\">" N_("Smoothness") "\n" "0.6\n" "6\n" "2\n" - "<_param name=\"meltheader\" type=\"description\" appearance=\"header\">Melt\n" + "<_param name=\"meltheader\" type=\"description\" appearance=\"header\">" N_("Melt") "\n" "1\n" "6\n" "2\n" @@ -468,6 +469,92 @@ Drawing::get_filter_text (Inkscape::Extension::Extension * ext) }; /* Drawing filter */ +/** + \brief Custom predefined Electrize filter. + + Electro solarization effects. + + Filter's parameters: + * Simplify (0.01->10., default 2.) -> blur (stdDeviation) + * Effect type (enum: table or discrete, default "table") -> component (type) + * Level (0->10, default 3) -> component (tableValues) + * Inverted (boolean, default false) -> component (tableValues) +*/ +class Electrize : public Inkscape::Extension::Internal::Filter::Filter { +protected: + virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext); + +public: + Electrize ( ) : Filter() { }; + virtual ~Electrize ( ) { if (_filter != NULL) g_free((void *)_filter); return; } + + static void init (void) { + Inkscape::Extension::build_from_mem( + "\n" + "" N_("Electrize") "\n" + "org.inkscape.effect.filter.Electrize\n" + "2.0\n" + "\n" + "<_item value=\"table\">" N_("Table") "\n" + "<_item value=\"discrete\">" N_("Discrete") "\n" + "\n" + "3\n" + "false\n" + "\n" + "all\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" N_("Electro solarization effects") "\n" + "\n" + "\n", new Electrize()); + }; +}; + +gchar const * +Electrize::get_filter_text (Inkscape::Extension::Extension * ext) +{ + if (_filter != NULL) g_free((void *)_filter); + + std::ostringstream blur; + std::ostringstream type; + std::ostringstream values; + + blur << ext->get_param_float("blur"); + type << ext->get_param_enum("type"); + + // TransfertComponent table values are calculated based on the effect level and inverted parameters. + int val = 0; + int levels = ext->get_param_int("levels") + 1; + if (ext->get_param_bool("invert")) { + val = 1; + } + values << val; + for ( int step = 1 ; step <= levels ; step++ ) { + if (val == 1) { + val = 0; + } + else { + val = 1; + } + values << " " << val; + } + + _filter = g_strdup_printf( + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n", blur.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str(), type.str().c_str(), values.str().c_str()); + + return _filter; +}; /* Electrize filter */ + /** \brief Custom predefined Neon draw filter. @@ -494,7 +581,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Neon draw") "\n" + "" N_("Neon Draw") "\n" "org.inkscape.effect.filter.NeonDraw\n" "\n" "<_item value=\"table\">Smoothed\n" @@ -549,7 +636,7 @@ NeonDraw::get_filter_text (Inkscape::Extension::Extension * ext) dark << "component1"; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -599,7 +686,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Poster paint") "\n" + "" N_("Poster Paint") "\n" "org.inkscape.effect.filter.Posterize\n" "\n" "<_item value=\"normal\">Normal\n" @@ -684,7 +771,7 @@ Posterize::get_filter_text (Inkscape::Extension::Extension * ext) antialias << "0.01"; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" @@ -723,7 +810,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Posterize basic") "\n" + "" N_("Posterize Basic") "\n" "org.inkscape.effect.filter.PosterizeBasic\n" "5\n" "4.0\n" @@ -760,7 +847,7 @@ PosterizeBasic::get_filter_text (Inkscape::Extension::Extension * ext) transf << " 1"; _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/shadows.h b/src/extension/internal/filter/shadows.h index 49f1003cc..2d63ac00f 100644 --- a/src/extension/internal/filter/shadows.h +++ b/src/extension/internal/filter/shadows.h @@ -53,7 +53,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Drop shadow") "\n" + "" N_("Drop Shadow") "\n" "org.inkscape.effect.filter.ColorDropShadow\n" "\n" "\n" @@ -158,7 +158,7 @@ ColorizableDropShadow::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n" diff --git a/src/extension/internal/filter/transparency.h b/src/extension/internal/filter/transparency.h index c47df89df..f8f02575b 100644 --- a/src/extension/internal/filter/transparency.h +++ b/src/extension/internal/filter/transparency.h @@ -57,7 +57,7 @@ public: static void init (void) { Inkscape::Extension::build_from_mem( "\n" - "" N_("Channel transparency") "\n" + "" N_("Channel Transparency") "\n" "org.inkscape.effect.filter.ChannelTransparency\n" "-1\n" "0.5\n" @@ -100,7 +100,7 @@ ChannelTransparency::get_filter_text (Inkscape::Extension::Extension * ext) } _filter = g_strdup_printf( - "\n" + "\n" "\n" "\n" "\n", red.str().c_str(), green.str().c_str(), blue.str().c_str(), alpha.str().c_str(), -- cgit v1.2.3