Code

Filters. New custom predefined filters (all ABCs, Neon draw, Color shilf, Silhouette...
[inkscape.git] / src / extension / internal / filter / morphology.h
index 8e00b47bee34d43674fe8f9c7ae696f8c8801808..5584ce5065e77a15de2bd973ac8d355255f7b09d 100644 (file)
@@ -3,7 +3,7 @@
 /* Change the 'MORPHOLOGY' above to be your file name */
 
 /*
- * Copyright (C) 2010 Authors:
+ * Copyright (C) 2011 Authors:
  *   Ivan Louette (filters)
  *   Nicolas Dufour (UI) <nicoduf@yahoo.fr>
  *
@@ -39,40 +39,40 @@ namespace Filter {
 
 class Crosssmooth : public Inkscape::Extension::Internal::Filter::Filter {
 protected:
-       virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext);
+    virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext);
 
 public:
-       Crosssmooth ( ) : Filter() { };
-       virtual ~Crosssmooth ( ) { if (_filter != NULL) g_free((void *)_filter); return; }
-
-       static void init (void) {
-               Inkscape::Extension::build_from_mem(
-                       "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
-                               "<name>" N_("Cross-smooth, custom (morphology)") "</name>\n"
-                               "<id>org.inkscape.effect.filter.crosssmooth</id>\n"
-                        "<param name=\"type\" gui-text=\"" N_("Type:") "\" type=\"enum\">\n"
-                            "<_item value=\"edges\">Smooth edges</_item>\n"
-                            "<_item value=\"all\">Smooth all</_item>\n"
-                        "</param>\n"
-                        "<param name=\"blur\" gui-text=\"" N_("Blur:") "\" type=\"float\" min=\"0.01\" max=\"10\">5</param>\n"
-                               "<effect>\n"
-                                       "<object-type>all</object-type>\n"
-                                       "<effects-menu>\n"
-                                               "<submenu name=\"" N_("Filters") "\">\n"
-                                               "<submenu name=\"" N_("Experimental") "\"/>\n"
-                             "</submenu>\n"
-                                       "</effects-menu>\n"
-                                       "<menu-tip>" N_("Smooth edges and angles of shapes") "</menu-tip>\n"
-                               "</effect>\n"
-                       "</inkscape-extension>\n", new Crosssmooth());
-       };
+    Crosssmooth ( ) : Filter() { };
+    virtual ~Crosssmooth ( ) { if (_filter != NULL) g_free((void *)_filter); return; }
+
+    static void init (void) {
+        Inkscape::Extension::build_from_mem(
+            "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
+              "<name>" N_("Cross-smooth, custom (Morphology)") "</name>\n"
+              "<id>org.inkscape.effect.filter.crosssmooth</id>\n"
+              "<param name=\"type\" gui-text=\"" N_("Type:") "\" type=\"enum\">\n"
+                "<_item value=\"edges\">Smooth edges</_item>\n"
+                "<_item value=\"all\">Smooth all</_item>\n"
+              "</param>\n"
+              "<param name=\"blur\" gui-text=\"" N_("Blur:") "\" type=\"float\" min=\"0.01\" max=\"10\">5</param>\n"
+              "<effect>\n"
+                "<object-type>all</object-type>\n"
+                "<effects-menu>\n"
+                  "<submenu name=\"" N_("Filters") "\">\n"
+                    "<submenu name=\"" N_("Experimental") "\"/>\n"
+                  "</submenu>\n"
+                "</effects-menu>\n"
+                "<menu-tip>" N_("Smooth edges and angles of shapes") "</menu-tip>\n"
+              "</effect>\n"
+            "</inkscape-extension>\n", new Crosssmooth());
+    };
 
 };
 
 gchar const *
 Crosssmooth::get_filter_text (Inkscape::Extension::Extension * ext)
 {
-       if (_filter != NULL) g_free((void *)_filter);
+    if (_filter != NULL) g_free((void *)_filter);
 
     std::ostringstream blur;
     std::ostringstream c1in;
@@ -86,16 +86,16 @@ Crosssmooth::get_filter_text (Inkscape::Extension::Extension * ext)
         c1in << "SourceGraphic";
     }
 
-       _filter = g_strdup_printf(
-               "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" color-interpolation-filters=\"sRGB\" inkscape:label=\"Cross-smooth, custom\">\n"
-        "<feGaussianBlur stdDeviation=\"%s\" result=\"blur\" />\n"
-        "<feComposite in=\"%s\" in2=\"blur\" operator=\"atop\" result=\"composite1\" />\n"
-        "<feComposite in2=\"composite1\" operator=\"in\" result=\"composite2\" />\n"
-        "<feComposite in2=\"composite2\" operator=\"in\" result=\"composite3\" />\n"
-        "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10 \" result=\"colormatrix\" />\n"
+    _filter = g_strdup_printf(
+        "<filter xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\" color-interpolation-filters=\"sRGB\" inkscape:label=\"Cross-smooth, custom\">\n"
+          "<feGaussianBlur stdDeviation=\"%s\" result=\"blur\" />\n"
+          "<feComposite in=\"%s\" in2=\"blur\" operator=\"atop\" result=\"composite1\" />\n"
+          "<feComposite in2=\"composite1\" operator=\"in\" result=\"composite2\" />\n"
+          "<feComposite in2=\"composite2\" operator=\"in\" result=\"composite3\" />\n"
+          "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10 \" result=\"colormatrix\" />\n"
         "</filter>\n", blur.str().c_str(), c1in.str().c_str());
 
-       return _filter;
+    return _filter;
 }; /* Crosssmooth filter */
 
 }; /* namespace Filter */
@@ -103,5 +103,5 @@ Crosssmooth::get_filter_text (Inkscape::Extension::Extension * ext)
 }; /* namespace Extension */
 }; /* namespace Inkscape */
 
-/* Change the 'COLOR' below to be your file name */
+/* Change the 'MORPHOLOGY' below to be your file name */
 #endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_MORPHOLOGY_H__ */