Code

2 new filters sent by Chrisdesign
authorJucaBlues <JucaBlues@users.sourceforge.net>
Sat, 31 May 2008 18:25:47 +0000 (18:25 +0000)
committerJucaBlues <JucaBlues@users.sourceforge.net>
Sat, 31 May 2008 18:25:47 +0000 (18:25 +0000)
(http://chrisdesign.wordpress.com/filter-effects/)

src/extension/internal/filter/CMakeLists.txt
src/extension/internal/filter/emboss.h [new file with mode: 0644]
src/extension/internal/filter/filter-all.cpp
src/extension/internal/filter/melt.h [new file with mode: 0644]

index f619dd5c7312395626a117c59fa2e991c3403e08..ec76a902e7d8a70f0b9038fff304ed2e7fe13c2c 100644 (file)
@@ -5,6 +5,7 @@ clouds.h
 crystal.h
 cutout.h
 drop-shadow.h
+emboss.h
 etched-glass.h
 filter-all.cpp
 filter.cpp
@@ -16,6 +17,7 @@ ink-bleed.h
 jelly-bean.h
 jigsaw-piece.h
 leopard-fur.h
+melt.h
 metal.h
 motion-blur.h
 oil-slick.h
diff --git a/src/extension/internal/filter/emboss.h b/src/extension/internal/filter/emboss.h
new file mode 100644 (file)
index 0000000..ec47224
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_EMBOSS_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_EMBOSS_H__
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *   Filter designed by Chrisdesign (http://chrisdesign.wordpress.com/filter-effects/)
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Emboss : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("emboss",     /* ID -- should be unique */
+                           N_("Emboss"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Emboss effect"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur result=\"result0\" in=\"SourceAlpha\" stdDeviation=\"1.01\" />\n"
+                        "<feOffset stdDeviation=\"0.40000000000000002\" result=\"result3\" in=\"result0\" dy=\"2\" dx=\"2\" />\n"
+                        "<feSpecularLighting specularExponent=\"35\" specularConstant=\"1.05\" surfaceScale=\"0.75\" lighting-color=\"rgb(217,217,217)\" result=\"result1\" in=\"result0\">\n"
+                        "<fePointLight z=\"20000\" y=\"-10000\" x=\"-5000\" />\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite operator=\"in\" result=\"result2\" in=\"result1\" in2=\"SourceAlpha\" />\n"
+                        "<feComposite k3=\"0.99999999999999989\" k2=\"0.99999999999999989\" operator=\"arithmetic\" result=\"result4\" in=\"SourceGraphic\" />\n"
+                        "<feMerge><feMergeNode in=\"result3\" />\n"
+                        "<feMergeNode in=\"result4\" />\n"
+                        "</feMerge>\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_EMBOSS_H__ */
index 08bef9f742e019bba137dc9dc75ba3dc8cc7534d..6f0208a0bfa0f33081fe8d2511797c116774aa02 100644 (file)
@@ -14,6 +14,7 @@
 #include "crystal.h"
 #include "cutout.h"
 #include "drop-shadow.h"
+#include "emboss.h"
 #include "etched-glass.h"
 #include "fire.h"
 #include "frost.h"
@@ -21,6 +22,7 @@
 #include "jelly-bean.h"
 #include "jigsaw-piece.h"
 #include "leopard-fur.h"
+#include "melt.h"
 #include "metal.h"
 #include "motion-blur.h"
 #include "oil-slick.h"
@@ -50,6 +52,7 @@ Filter::filters_all (void )
        Crystal::init();
        Cutout::init();
        DropShadow::init();
+       Emboss::init();
        EtchedGlass::init();
        Fire::init();
        Frost::init();
@@ -57,6 +60,7 @@ Filter::filters_all (void )
        JellyBean::init();
        JigsawPiece::init();
        LeopardFur::init();
+       Melt::init();
        Metal::init();
        MotionBlur::init();
        OilSlick::init();
diff --git a/src/extension/internal/filter/melt.h b/src/extension/internal/filter/melt.h
new file mode 100644 (file)
index 0000000..d6372c1
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_MELT_H__
+#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_MELT_H__
+/*
+ * Copyright (C) 2008 Authors:
+ *   Ted Gould <ted@gould.cx>
+ *   Filter designed by Chrisdesign (http://chrisdesign.wordpress.com/filter-effects/)
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#include "filter.h"
+
+namespace Inkscape {
+namespace Extension {
+namespace Internal {
+namespace Filter {
+
+class Melt : public Inkscape::Extension::Internal::Filter::Filter {
+public:
+       static void init (void) {
+               filter_init("melt",     /* ID -- should be unique */
+                           N_("Melt"), /* Name in the menus, should have a N_() around it for translation */
+                           N_("Melt effect"),
+                                                    /* Menu tooltip to help users understand the name.  Should also have a N_() */
+                                       "<filter>\n"
+                        "<feGaussianBlur stdDeviation=\"10\" in=\"SourceGraphic\" result=\"result0\" />\n"
+                        "<feTurbulence result=\"result1\" numOctaves=\"8\" seed=\"488\" baseFrequency=\"0.012000000000000004\" />\n"
+                        "<feComposite in=\"result0\" in2=\"result1\" operator=\"in\" result=\"result2\" />\n"
+                        "<feSpecularLighting in=\"result2\" specularExponent=\"100.40000000000001\" specularConstant=\"3.9400000000000004\" result=\"result4\">\n"
+                        "<feDistantLight azimuth=\"225\" elevation=\"62\" />\n"
+                        "</feSpecularLighting>\n"
+                        "<feComposite operator=\"atop\" in=\"result4\" in2=\"result2\" />\n"
+                        "<feConvolveMatrix order=\"5 5\" kernelMatrix=\"0 0 0 0 0 0 0 -1 0 0 0 -1 5 -1 0 0 0 -1 0 0 0 0 0 0 1\" />\n"
+                                       "</filter>\n");
+                                                /* The XML of the filter that should be added.  There
+                                                 * should be a <svg:filter> surrounding what you'd like
+                                                 * to be added with this effect. */
+       };
+};
+
+}; /* namespace Filter */
+}; /* namespace Internal */
+}; /* namespace Extension */
+}; /* namespace Inkscape */
+
+#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_MELT_H__ */