diff options
Diffstat (limited to 'src')
34 files changed, 1552 insertions, 42 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 5fdb47835..6614604ff 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -19,6 +19,12 @@ #include <extension/input.h> #include <extension/effect.h> +#include "selection.h" +#include "desktop.h" +#include "desktop-handles.h" +#include "ui/view/view.h" +#include "util/glib-list-iterators.h" + namespace Inkscape { namespace Extension { namespace Implementation { @@ -91,8 +97,21 @@ Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc* } /* Implementation::save */ Gtk::Widget * -Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View */*view*/, sigc::signal<void> * /*changeSignal*/, ImplementationDocumentCache * /*docCache*/) { - return module->autogui(NULL, NULL); +Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * docCache) { + if (module->param_visible_count() == 0) return NULL; + + SPDocument * current_document = view->doc(); + + using Inkscape::Util::GSListConstIterator; + GSListConstIterator<SPItem *> selected = + sp_desktop_selection((SPDesktop *)view)->itemList(); + Inkscape::XML::Node * first_select = NULL; + if (selected != NULL) { + const SPItem * item = *selected; + first_select = SP_OBJECT_REPR(item); + } + + return module->autogui(current_document, first_select, changeSignal); } /* Implementation::prefs_effect */ void diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 67e351496..4eeb3f27f 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -540,38 +540,6 @@ Script::prefs_output(Inkscape::Extension::Output *module) return module->autogui(NULL, NULL); } - - -/** - \return A dialog for preferences - \brief A stub funtion right now - \param module Module who's preferences need getting - - This function should really do something, right now it doesn't. -*/ -Gtk::Widget * -Script::prefs_effect( Inkscape::Extension::Effect *module, - Inkscape::UI::View::View *view, - sigc::signal<void> * changeSignal, - ImplementationDocumentCache * /*docCache*/ ) -{ - SPDocument * current_document = view->doc(); - - using Inkscape::Util::GSListConstIterator; - GSListConstIterator<SPItem *> selected = - sp_desktop_selection((SPDesktop *)view)->itemList(); - Inkscape::XML::Node * first_select = NULL; - if (selected != NULL) { - const SPItem * item = *selected; - first_select = SP_OBJECT_REPR(item); - } - - return module->autogui(current_document, first_select, changeSignal); -} - - - - /** \return A new document that has been opened \brief This function uses a filename that is put in, and calls diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index c2a717a04..226a6beb2 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -87,13 +87,6 @@ public: virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); - /** - * - */ - virtual Gtk::Widget *prefs_effect(Inkscape::Extension::Effect *module, - Inkscape::UI::View::View * view, - sigc::signal<void> * changeSignal, - ImplementationDocumentCache * docCache); /** * diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 97179f3d8..a1d88d7ec 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -98,6 +98,8 @@ #include "internal/bitmap/wave.h" #endif /* WITH_IMAGE_MAGICK */ +#include "internal/filter/filter.h" + extern gboolean inkscape_app_use_gui( Inkscape::Application const *app ); namespace Inkscape { @@ -230,6 +232,8 @@ init() Internal::Bitmap::Wave::init(); #endif /* WITH_IMAGE_MAGICK */ + Internal::Filter::Filter::filters_all(); + /* Load search path for extensions */ if (Inkscape::Extension::Extension::search_path.size() == 0) { diff --git a/src/extension/internal/Makefile_insert b/src/extension/internal/Makefile_insert index 8fcbfc31c..bca2b0a6d 100644 --- a/src/extension/internal/Makefile_insert +++ b/src/extension/internal/Makefile_insert @@ -137,5 +137,9 @@ extension_internal_libinternal_a_SOURCES = \ extension/internal/latex-pstricks-out.cpp \ extension/internal/latex-pstricks-out.h \ $(extension_internal_libwpg) \ - $(extension_internal_image_magick_sources) + $(extension_internal_image_magick_sources) \ + \ + extension/internal/filter/filter-all.cpp \ + extension/internal/filter/filter.cpp \ + extension/internal/filter/filter.h diff --git a/src/extension/internal/filter/BUILD_YOUR_OWN b/src/extension/internal/filter/BUILD_YOUR_OWN new file mode 100644 index 000000000..ba6ca5a43 --- /dev/null +++ b/src/extension/internal/filter/BUILD_YOUR_OWN @@ -0,0 +1,2 @@ +This directory contains filter effects. They're designed to be simle. +Very, very simple. Here is how to build your own. diff --git a/src/extension/internal/filter/apparition.h b/src/extension/internal/filter/apparition.h new file mode 100644 index 000000000..b6f00add5 --- /dev/null +++ b/src/extension/internal/filter/apparition.h @@ -0,0 +1,44 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__ +/* Change the 'APPARITION' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Apparition : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("apparition", /* ID -- should be unique */ + N_("Apparition"), /* Name in the menus, should have a N_() around it for translation */ + N_("I'm not sure what this word means"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feMorphology result=\"result0\" in=\"SourceGraphic\" radius=\"4\"/>\n" + "<feGaussianBlur stdDeviation=\"9.2439050131926113\" in=\"result0\"/>\n" + "<feComposite in=\"SourceGraphic\" operator=\"in\"/>\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 */ + +/* Change the 'APPARITION' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_APPARITION_H__ */ diff --git a/src/extension/internal/filter/bloom.h b/src/extension/internal/filter/bloom.h new file mode 100644 index 000000000..f161edf2f --- /dev/null +++ b/src/extension/internal/filter/bloom.h @@ -0,0 +1,55 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__ +/* Change the 'BLOOM' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Bloom : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("bloom", /* ID -- should be unique */ + N_("Bloom"), /* Name in the menus, should have a N_() around it for translation */ + N_("Not sure, nobody tell me these things"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feGaussianBlur stdDeviation=\"2.1526428571428569\" in=\"SourceAlpha\" result=\"result1\"/>\n" + "<feSpecularLighting surfaceScale=\"5\" specularConstant=\"2\" specularExponent=\"18.063876651982376\" result=\"result0\">\n" + "<feDistantLight elevation=\"24\" azimuth=\"225\"/>\n" + "</feSpecularLighting>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result6\"/>\n" + "<feMorphology operator=\"dilate\" radius=\"5.7142857142857144\"/>\n" + "<feGaussianBlur stdDeviation=\"5.7237142857142853\" result=\"result11\"/>\n" + "<feDiffuseLighting in=\"result1\" diffuseConstant=\"2.0099999999999998\" result=\"result3\" surfaceScale=\"5\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"25\"/>\n" + "</feDiffuseLighting>\n" + "<feBlend blend=\"normal\" in2=\"SourceGraphic\" in=\"result3\" mode=\"multiply\" result=\"result7\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\" in=\"result7\"/>\n" + "<feBlend blend=\"normal\" in=\"result6\" mode=\"lighten\" result=\"result9\"/>\n" + "<feComposite in=\"result11\"/>\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 */ + +/* Change the 'BLOOM' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_BLOOM_H__ */ diff --git a/src/extension/internal/filter/clouds.h b/src/extension/internal/filter/clouds.h new file mode 100644 index 000000000..a057dd644 --- /dev/null +++ b/src/extension/internal/filter/clouds.h @@ -0,0 +1,46 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__ +/* Change the 'CLOUDS' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Clouds : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("clouds", /* ID -- should be unique */ + N_("Clouds"), /* Name in the menus, should have a N_() around it for translation */ + N_("Yes, more descriptions"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence type=\"fractalNoise\" baseFrequency=\"0.040293040293040296 0.10695970695970697\" numOctaves=\"3\"/>\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -2.7\" result=\"result0\"/>\n" + "<feFlood flood-color=\"rgb(255,255,255)\" flood-opacity=\"1\"/>\n" + "<feComposite in2=\"result0\" operator=\"in\"/>\n" + "<feComposite in2=\"SourceGraphic\" operator=\"atop\"/>\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 */ + +/* Change the 'CLOUDS' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CLOUDS_H__ */ diff --git a/src/extension/internal/filter/crystal.h b/src/extension/internal/filter/crystal.h new file mode 100644 index 000000000..05922a23a --- /dev/null +++ b/src/extension/internal/filter/crystal.h @@ -0,0 +1,56 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__ +/* Change the 'CRYSTAL' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Crystal : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("crystal", /* ID -- should be unique */ + N_("Crystal"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist, insert data here"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feBlend mode=\"multiply\" in2=\"BackgroundImage\" blend=\"normal\" in=\"SourceGraphic\" result=\"result0\"/>\n" + "<feGaussianBlur stdDeviation=\"3.7133333333333329\" in=\"SourceAlpha\" result=\"result1\"/>\n" + "<feSpecularLighting specularExponent=\"128\" specularConstant=\"1.7636684303350969\" surfaceScale=\"3\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"45\"/>\n" + "</feSpecularLighting>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result3\"/>\n" + "<feSpecularLighting in=\"result1\" specularExponent=\"128\" specularConstant=\"3.5273368606701938\" surfaceScale=\"-5\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"32\"/>\n" + "</feSpecularLighting>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result2\"/>\n" + "<feMerge>\n" + "<feMergeNode inkscape:collect=\"always\" in=\"result0\"/>\n" + "<feMergeNode inkscape:collect=\"always\" in=\"result3\"/>\n" + "<feMergeNode inkscape:collect=\"always\" in=\"result2\"/>\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 */ + +/* Change the 'CRYSTAL' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CRYSTAL_H__ */ diff --git a/src/extension/internal/filter/cutout.h b/src/extension/internal/filter/cutout.h new file mode 100644 index 000000000..7a48eca9a --- /dev/null +++ b/src/extension/internal/filter/cutout.h @@ -0,0 +1,44 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__ +/* Change the 'CUTOUT' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Cutout : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("cutout", /* ID -- should be unique */ + N_("Coutout"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist text"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feGaussianBlur stdDeviation=\"4.2312137203166218\" in=\"SourceAlpha\"/>\n" + "<feOffset dx=\"5\" dy=\"5\" />\n" + "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\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 */ + +/* Change the 'CUTOUT' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_CUTOUT_H__ */ diff --git a/src/extension/internal/filter/drop-shadow.h b/src/extension/internal/filter/drop-shadow.h new file mode 100644 index 000000000..b19adffa2 --- /dev/null +++ b/src/extension/internal/filter/drop-shadow.h @@ -0,0 +1,81 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__ +/* Change the 'DROP_SHADOW' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +#include "extension/internal/clear-n_.h" +#include "extension/system.h" +#include "extension/extension.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class DropShadow : public Inkscape::Extension::Internal::Filter::Filter { + int myvar; +protected: + virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext); + +public: + DropShadow ( ) : Filter() { }; + //virtual ~DropShadow ( ) { if (_filter != NULL) g_free(_filter); return; } + + static void init (void) { + Inkscape::Extension::build_from_mem( + "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n" + "<name>" N_("Drop Shadow") "</name>\n" + "<id>org.inkscape.effect.filter.drop-shadow</id>\n" + "<param name=\"blur\" gui-text=\"" N_("Amount of Blur") "\" type=\"float\" min=\"0.0\" max=\"50.0\">2.0</param>\n" + "<param name=\"xoffset\" gui-text=\"" N_("Horizontal Offset") "\" type=\"float\" min=\"-50.0\" max=\"50.0\">4.0</param>\n" + "<param name=\"yoffset\" gui-text=\"" N_("Vertical Offset") "\" type=\"float\" min=\"-50.0\" max=\"50.0\">4.0</param>\n" + "<effect>\n" + "<object-type>all</object-type>\n" + "<effects-menu>\n" + "<submenu name=\"" N_("Filter") "\" />\n" + "</effects-menu>\n" + "<menu-tip>" N_("I hate text") "</menu-tip>\n" + "</effect>\n" + "</inkscape-extension>\n", new DropShadow()); + }; + +}; + +gchar const * +DropShadow::get_filter_text (Inkscape::Extension::Extension * ext) +{ + if (_filter != NULL) g_free((void *)_filter); + + float blur = ext->get_param_float("blur"); + float x = ext->get_param_float("xoffset"); + float y = ext->get_param_float("yoffset"); + + _filter = g_strdup_printf( + "<filter>\n" + "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"%f\" result=\"blur\"/>\n" + "<feOffset in=\"blur\" dx=\"%f\" dy=\"%f\" result=\"offsetBlur\"/>\n" + "<feMerge>\n" + "<feMergeNode in=\"offsetBlur\"/>\n" + "<feMergeNode in=\"SourceGraphic\"/>\n" + "</feMerge>\n" + "</filter>\n", blur, x, y); + + return _filter; +}; + +}; /* namespace Filter */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ + +/* Change the 'DROP_SHADOW' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_DROP_SHADOW_H__ */ diff --git a/src/extension/internal/filter/etched-glass.h b/src/extension/internal/filter/etched-glass.h new file mode 100644 index 000000000..a28804286 --- /dev/null +++ b/src/extension/internal/filter/etched-glass.h @@ -0,0 +1,44 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__ +/* Change the 'ETCHED_GLASS' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class EtchedGlass : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("etched-glass", /* ID -- should be unique */ + N_("Etched Glass"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist text"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feGaussianBlur stdDeviation=\"6.3056666666666654\" in=\"BackgroundImage\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n" + "<feBlend blend=\"normal\" in2=\"SourceGraphic\" mode=\"multiply\"/>\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 */ + +/* Change the 'ETCHED_GLASS' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ETCHED_GLASS_H__ */ diff --git a/src/extension/internal/filter/filter-all.cpp b/src/extension/internal/filter/filter-all.cpp new file mode 100644 index 000000000..917730e2c --- /dev/null +++ b/src/extension/internal/filter/filter-all.cpp @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "filter.h" + +/* Put your filter here */ +#include "apparition.h" +#include "bloom.h" +#include "clouds.h" +#include "crystal.h" +#include "cutout.h" +#include "drop-shadow.h" +#include "etched-glass.h" +#include "fire.h" +#include "frost.h" +#include "ink-bleed.h" +#include "jelly-bean.h" +#include "jigsaw-piece.h" +#include "leopard-fur.h" +#include "metal.h" +#include "motion-blur.h" +#include "oil-slick.h" +#include "patterned-glass.h" +#include "ridged-border.h" +#include "ripple.h" +#include "roughen.h" +#include "rubber-stamp.h" +#include "sepia.h" +#include "snow.h" +#include "speckle.h" +#include "zebra.h" + + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + + +void +Filter::filters_all (void ) +{ + Apparition::init(); + Bloom::init(); + Clouds::init(); + Crystal::init(); + Cutout::init(); + DropShadow::init(); + EtchedGlass::init(); + Fire::init(); + Frost::init(); + InkBleed::init(); + JellyBean::init(); + JigsawPiece::init(); + LeopardFur::init(); + Metal::init(); + MotionBlur::init(); + OilSlick::init(); + PatternedGlass::init(); + RidgedBorder::init(); + Ripple::init(); + Roughen::init(); + RubberStamp::init(); + Sepia::init(); + Snow::init(); + Speckle::init(); + Zebra::init(); + + return; +} + +}; /* namespace Filter */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp new file mode 100644 index 000000000..e87290ab4 --- /dev/null +++ b/src/extension/internal/filter/filter.cpp @@ -0,0 +1,164 @@ +/* + * Authors: + * Ted Gould <ted@gould.cx> + * + * Copyright (C) 2008 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "desktop.h" +#include "selection.h" +#include "document-private.h" +#include "sp-item.h" +#include "util/glib-list-iterators.h" +#include "extension/extension.h" +#include "extension/effect.h" +#include "extension/system.h" +#include "xml/repr.h" +#include "xml/simple-node.h" +#include "xml/attribute-record.h" + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +Filter::Filter() : + Inkscape::Extension::Implementation::Implementation(), + _filter(NULL) { + return; +} + +Filter::Filter(gchar const * filter) : + Inkscape::Extension::Implementation::Implementation(), + _filter(filter) { + return; +} + +Filter::~Filter (void) { + if (_filter != NULL) { + _filter = NULL; + } + + return; +} + +bool +Filter::load (Inkscape::Extension::Extension *module) +{ + return true; +} + +Inkscape::Extension::Implementation::ImplementationDocumentCache * +Filter::newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc) +{ + return NULL; +} + +gchar const * +Filter::get_filter_text (Inkscape::Extension::Extension * ext) +{ + return _filter; +} + +Inkscape::XML::Document * +Filter::get_filter (Inkscape::Extension::Extension * ext) { + gchar const * filter = get_filter_text(ext); + return sp_repr_read_mem(filter, strlen(filter), NULL); +} + +void +Filter::merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc) +{ + if (from == NULL) return; + + // copy attributes + for ( Inkscape::Util::List<Inkscape::XML::AttributeRecord const> iter = from->attributeList() ; + iter ; ++iter ) { + gchar const * attr = g_quark_to_string(iter->key); + //printf("Attribute List: %s\n", attr); + if (!strcmp(attr, "id")) continue; // nope, don't copy that one! + to->setAttribute(attr, from->attribute(attr)); + } + + // for each child call recursively + for (Inkscape::XML::Node * from_child = from->firstChild(); + from_child != NULL ; from_child = from_child->next()) { + Glib::ustring name = "svg:"; + name += from_child->name(); + + Inkscape::XML::Node * to_child = doc->createElement(name.c_str()); + to->appendChild(to_child); + merge_filters(to_child, from_child, doc); + } + + return; +} + +void +Filter::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache) +{ + //printf("Calling filter effect\n"); + Inkscape::Selection * selection = ((SPDesktop *)document)->selection; + + using Inkscape::Util::GSListConstIterator; + // TODO need to properly refcount the items, at least + std::list<SPItem *> items; + items.insert<GSListConstIterator<SPItem *> >(items.end(), selection->itemList(), NULL); + + Inkscape::XML::Document * xmldoc = sp_document_repr_doc(document->doc()); + Inkscape::XML::Node * defsrepr = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(document->doc())); + + for(std::list<SPItem *>::iterator item = items.begin(); + item != items.end(); item++) { + SPItem * spitem = *item; + Inkscape::XML::Node * node = SP_OBJECT_REPR(spitem); + + SPCSSAttr * css = sp_repr_css_attr(node, "style"); + gchar const * filter = sp_repr_css_property(css, "filter", NULL); + + if (filter == NULL) { + Inkscape::XML::Node * newfilterroot = xmldoc->createElement("svg:filter"); + defsrepr->appendChild(newfilterroot); + Glib::ustring url = "url(#"; url += newfilterroot->attribute("id"); url += ")"; + + merge_filters(newfilterroot, get_filter(module)->root(), xmldoc); + + sp_repr_css_set_property(css, "filter", url.c_str()); + sp_repr_css_set(node, css, "style"); + } + } + + return; +} + +#include "extension/internal/clear-n_.h" + +void +Filter::filter_init (gchar const * id, gchar const * name, gchar const * tip, gchar const * filter) +{ + gchar * xml_str = g_strdup_printf( + "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n" + "<name>%s</name>\n" + "<id>org.inkscape.effect.filter.%s</id>\n" + "<effect>\n" + "<object-type>all</object-type>\n" + "<effects-menu>\n" + "<submenu name=\"" N_("Filter") "\" />\n" + "</effects-menu>\n" + "<menu-tip>%s</menu-tip>\n" + "</effect>\n" + "</inkscape-extension>\n", name, id, tip); + Inkscape::Extension::build_from_mem(xml_str, new Filter::Filter(filter)); + g_free(xml_str); + return; +} + +}; /* namespace Filter */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ + diff --git a/src/extension/internal/filter/filter.h b/src/extension/internal/filter/filter.h new file mode 100644 index 000000000..851beb833 --- /dev/null +++ b/src/extension/internal/filter/filter.h @@ -0,0 +1,48 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include <glibmm/i18n.h> + +#include "extension/implementation/implementation.h" +#include "extension/extension-forward.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Filter : public Inkscape::Extension::Implementation::Implementation { +protected: + gchar const * _filter; + virtual gchar const * get_filter_text (Inkscape::Extension::Extension * ext); + +private: + Inkscape::XML::Document * get_filter (Inkscape::Extension::Extension * ext); + void merge_filters (Inkscape::XML::Node * to, Inkscape::XML::Node * from, Inkscape::XML::Document * doc); + +public: + Filter(); + Filter(gchar const * filter); + virtual ~Filter(); + + bool load(Inkscape::Extension::Extension *module); + Inkscape::Extension::Implementation::ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc); + void effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * docCache); + + static void filter_init(gchar const * id, gchar const * name, gchar const * tip, gchar const * filter); + static void filters_all(void); +}; + +}; /* namespace Filter */ +}; /* namespace Internal */ +}; /* namespace Extension */ +}; /* namespace Inkscape */ + +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FILTER_H__ */ diff --git a/src/extension/internal/filter/fire.h b/src/extension/internal/filter/fire.h new file mode 100644 index 000000000..7816f19bb --- /dev/null +++ b/src/extension/internal/filter/fire.h @@ -0,0 +1,54 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__ +/* Change the 'FIRE' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Fire : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("fire", /* ID -- should be unique */ + N_("Fire"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist on fire"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter x=\"-0.080000000000000029\" height=\"1.3900000000000001\" width=\"1.21\" y=\"-0.22000000000000008\">\n" + "<feMorphology operator=\"dilate\" radius=\"2.4128686327077746\" result=\"result1\"/>\n" + "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.0900804289544236 0.027882037533512066\"/>\n" + "<feColorMatrix values=\"2 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0\" result=\"result2\" type=\"matrix\"/>\n" + "<feDisplacementMap in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"10.319410319410318\" result=\"result4\"/>\n" + "<feFlood flood-color=\"rgb(255,159,54)\" flood-opacity=\"1\" result=\"result3\"/>\n" + "<feMorphology in=\"result4\" result=\"result7\" radius=\"3.755868544600939\"/>\n" + "<feGaussianBlur stdDeviation=\"2.3571830985915487\" in=\"result7\" result=\"result7\"/>\n" + "<feComposite operator=\"in\" in=\"result3\" in2=\"result4\" result=\"result5\"/>\n" + "<feComposite in2=\"result7\" operator=\"out\"/>\n" + "<feOffset dx=\"-4.5\" dy=\"-7\" result=\"result6\"/>\n" + "<feGaussianBlur stdDeviation=\"4.8352546916890073\" result=\"result7\"/>\n" + "<feComposite in2=\"result6\" in=\"SourceGraphic\"/>\n" + "<feComposite in2=\"result7\"/>\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 */ + +/* Change the 'FIRE' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FIRE_H__ */ diff --git a/src/extension/internal/filter/frost.h b/src/extension/internal/filter/frost.h new file mode 100644 index 000000000..9c5dcb25a --- /dev/null +++ b/src/extension/internal/filter/frost.h @@ -0,0 +1,50 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__ +/* Change the 'FROST' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Frost : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("frost", /* ID -- should be unique */ + N_("Frost"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist text"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence baseFrequency=\"0.14299516908212559\" numOctaves=\"5\" type=\"fractalNoise\" />\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n" + "<feMorphology result=\"result3\" radius=\"2.6570048309178742\" operator=\"dilate\" />\n" + "<feTurbulence baseFrequency=\"0.12077294685990339\" numOctaves=\"2\" />\n" + "<feDisplacementMap result=\"result4\" scale=\"10.044642857142858\" yChannelSelector=\"A\" xChannelSelector=\"R\" in=\"result3\" />\n" + "<feFlood flood-color=\"rgb(255,255,255)\" flood-opacity=\"1\"/>\n" + "<feComposite in2=\"result4\" operator=\"in\" result=\"result2\"/>\n" + "<feComposite in2=\"SourceGraphic\" operator=\"over\" in=\"result2\" />\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 */ + +/* Change the 'FROST' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_FROST_H__ */ diff --git a/src/extension/internal/filter/ink-bleed.h b/src/extension/internal/filter/ink-bleed.h new file mode 100644 index 000000000..6168b38e7 --- /dev/null +++ b/src/extension/internal/filter/ink-bleed.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__ +/* Change the 'INK_BLEED' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class InkBleed : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("ink-bleed", /* ID -- should be unique */ + N_("InkBleed"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist Text"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feGaussianBlur stdDeviation=\"1.3291292875989447\" in=\"SourceGraphic\" result=\"result1\"/>\n" + "<feTurbulence baseFrequency=\"0.033773087071240104\" numOctaves=\"4\" result=\"result0\"/>\n" + "<feDisplacementMap in2=\"result0\" in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"19.612590799031477\" result=\"result2\"/>\n" + "<feColorMatrix result=\"result3\" values=\"2 0 0 0 0 0 2 0 0 0 0 0 2 0 0 0 0 0 0.7 0\"/>\n" + "<feGaussianBlur stdDeviation=\"1.0653034300791555\" in=\"SourceGraphic\" result=\"result4\"/>\n" + "<feComposite in2=\"result3\" in=\"result4\"/>\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 */ + +/* Change the 'INK_BLEED' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_INK_BLEED_H__ */ diff --git a/src/extension/internal/filter/jelly-bean.h b/src/extension/internal/filter/jelly-bean.h new file mode 100644 index 000000000..d063ac900 --- /dev/null +++ b/src/extension/internal/filter/jelly-bean.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__ +/* Change the 'JELLY_BEAN' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class JellyBean : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("jelly-bean", /* ID -- should be unique */ + N_("Jelly Bean"), /* Name in the menus, should have a N_() around it for translation */ + N_("Mmmm, yummy."), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feColorMatrix in=\"SourceGraphic\" result=\"result0\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.85 0\"/>\n" + "<feGaussianBlur stdDeviation=\"7.0222857142857134\" in=\"SourceAlpha\"/>\n" + "<feSpecularLighting specularExponent=\"7.971360381861575\" specularConstant=\"0.80000000000000004\" surfaceScale=\"10\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"17\"/>\n" + "</feSpecularLighting>\n" + "<feComposite in2=\"result0\" operator=\"atop\"/>\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 */ + +/* Change the 'JELLY_BEAN' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_JELLY_BEAN_H__ */ diff --git a/src/extension/internal/filter/jigsaw-piece.h b/src/extension/internal/filter/jigsaw-piece.h new file mode 100644 index 000000000..654c1e051 --- /dev/null +++ b/src/extension/internal/filter/jigsaw-piece.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__ +/* Change the 'JIGSAW_PIECE' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class JigsawPiece : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("jigsaw-piece", /* ID -- should be unique */ + N_("JigsawPiece"), /* Name in the menus, should have a N_() around it for translation */ + N_("It's a puzzle, no hints"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feSpecularLighting specularExponent=\"18.527845036319611\" specularConstant=\"2\" surfaceScale=\"1\" in=\"SourceAlpha\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"30\"/>\n" + "</feSpecularLighting>\n" + "<feComposite in2=\"SourceGraphic\" operator=\"atop\" result=\"result0\"/>\n" + "<feMorphology operator=\"dilate\" in=\"SourceAlpha\" result=\"result1\" radius=\"2\"/>\n" + "<feComposite in2=\"result1\" in=\"result0\"/>\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 */ + +/* Change the 'JIGSAW_PIECE' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_JIGSAW_PIECE_H__ */ diff --git a/src/extension/internal/filter/leopard-fur.h b/src/extension/internal/filter/leopard-fur.h new file mode 100644 index 000000000..7e160c0a2 --- /dev/null +++ b/src/extension/internal/filter/leopard-fur.h @@ -0,0 +1,61 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__ +/* Change the 'LEOPARD_FUR' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class LeopardFur : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("leopard-fur", /* ID -- should be unique */ + N_("Leopard Fur"), /* Name in the menus, should have a N_() around it for translation */ + N_("Purrrr, quiet the kitty is sleeping"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence baseFrequency=\"0.14299516908212559\" numOctaves=\"5\" type=\"fractalNoise\"/>\n" + "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 -3.45\"/>\n" + "<feComposite result=\"result3\" in2=\"SourceAlpha\" operator=\"in\"/>\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 6 0\"/>\n" + "<feMorphology result=\"result3\" radius=\"1.8181818181818181\" operator=\"dilate\"/>\n" + "<feGaussianBlur result=\"result3\" stdDeviation=\"1\"/>\n" + "<feGaussianBlur stdDeviation=\"2.7287613293051356\"/>\n" + "<feComposite in2=\"result3\" result=\"result1\" operator=\"out\"/>\n" + "<feColorMatrix result=\"result3\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0\"/>\n" + "<feFlood result=\"result2\" flood-opacity=\"1\" flood-color=\"rgb(209,151,45)\" />\n" + "<feComposite operator=\"in\" in=\"result2\" in2=\"SourceGraphic\" />\n" + "<feComposite in=\"result3\" result=\"result3\" operator=\"atop\" />\n" + "<feGaussianBlur stdDeviation=\"7.1521428571428558\" in=\"SourceAlpha\"/>\n" + "<feDiffuseLighting diffuseConstant=\"1.9197207678883073\" surfaceScale=\"10.600706713780937\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"48\"/>\n" + "</feDiffuseLighting>\n" + "<feBlend blend=\"normal\" in2=\"result3\" mode=\"multiply\" result=\"result3\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\" result=\"result3\"/>\n" + "<feTurbulence baseFrequency=\"0.10577777777777778\" numOctaves=\"3\" />\n" + "<feDisplacementMap scale=\"4.5454545454545459\" yChannelSelector=\"G\" xChannelSelector=\"R\" in=\"result3\"/>\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 */ + +/* Change the 'LEOPARD_FUR' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_LEOPARD_FUR_H__ */ diff --git a/src/extension/internal/filter/metal.h b/src/extension/internal/filter/metal.h new file mode 100644 index 000000000..b0d41a1af --- /dev/null +++ b/src/extension/internal/filter/metal.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__ +/* Change the 'METAL' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Metal : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("metal", /* ID -- should be unique */ + N_("Metal"), /* Name in the menus, should have a N_() around it for translation */ + N_("Iron Man vector objects"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feColorMatrix result=\"result1\" in=\"SourceGraphic\" type=\"saturate\" values=\"0.369458\"/>\n" + "<feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"7.0222857142857134\"/>\n" + "<feSpecularLighting surfaceScale=\"10\" specularConstant=\"3.8834951456310676\" specularExponent=\"7.971360381861575\">\n" + "<feDistantLight elevation=\"17\" azimuth=\"225\" />\n" + "</feSpecularLighting>\n" + "<feComposite operator=\"atop\" in2=\"result1\"/>\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 */ + +/* Change the 'METAL' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_METAL_H__ */ diff --git a/src/extension/internal/filter/motion-blur.h b/src/extension/internal/filter/motion-blur.h new file mode 100644 index 000000000..85a5df4b8 --- /dev/null +++ b/src/extension/internal/filter/motion-blur.h @@ -0,0 +1,42 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__ +/* Change the 'MOTION_BLUR' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class MotionBlur : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("motion-blur", /* ID -- should be unique */ + N_("Motion Blur"), /* Name in the menus, should have a N_() around it for translation */ + N_("Hmm, fast vectors"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feGaussianBlur stdDeviation=\"5 0.01\" in=\"SourceGraphic\"/>\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 */ + +/* Change the 'MOTION_BLUR' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_MOTION_BLUR_H__ */ diff --git a/src/extension/internal/filter/oil-slick.h b/src/extension/internal/filter/oil-slick.h new file mode 100644 index 000000000..cc24aca07 --- /dev/null +++ b/src/extension/internal/filter/oil-slick.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__ +/* Change the 'OIL_SLICK' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class OilSlick : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("oil-slick", /* ID -- should be unique */ + N_("OilSlick"), /* Name in the menus, should have a N_() around it for translation */ + N_("Ooops! Slippery!"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence type=\"fractalNoise\" numOctaves=\"5\" baseFrequency=\"0.14299516908212559\"/>\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 5 -3\"/>\n" + "<feMorphology operator=\"dilate\" radius=\"2.6570048309178742\" result=\"result3\"/>\n" + "<feTurbulence numOctaves=\"2\" baseFrequency=\"0.12077294685990339\"/>\n" + "<feDisplacementMap in=\"result3\" xChannelSelector=\"R\" yChannelSelector=\"A\" scale=\"18.526785714285715\" result=\"result4\"/>\n" + "<feComposite in=\"result4\" operator=\"atop\" in2=\"SourceGraphic\"/>\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 */ + +/* Change the 'OIL_SLICK' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_OIL_SLICK_H__ */ diff --git a/src/extension/internal/filter/patterned-glass.h b/src/extension/internal/filter/patterned-glass.h new file mode 100644 index 000000000..0ded94a81 --- /dev/null +++ b/src/extension/internal/filter/patterned-glass.h @@ -0,0 +1,45 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__ +/* Change the 'PATTERNED_GLASS' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class PatternedGlass : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("patterned-glass", /* ID -- should be unique */ + N_("PatternedGlass"), /* Name in the menus, should have a N_() around it for translation */ + N_("Doesn't work, bug"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.10861423220973783\"/>\n" + "<feDisplacementMap in=\"BackgroundImage\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"11.795774647887324\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\n" + "<feBlend blend=\"normal\" in=\"SourceGraphic\" mode=\"multiply\"/>\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 */ + +/* Change the 'PATTERNED_GLASS' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_PATTERNED_GLASS_H__ */ diff --git a/src/extension/internal/filter/ridged-border.h b/src/extension/internal/filter/ridged-border.h new file mode 100644 index 000000000..855f36b36 --- /dev/null +++ b/src/extension/internal/filter/ridged-border.h @@ -0,0 +1,49 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__ +/* Change the 'RIDGED_BORDER' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class RidgedBorder : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("ridged-border", /* ID -- should be unique */ + N_("Ridged Border"), /* Name in the menus, should have a N_() around it for translation */ + N_("Artist text"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feMorphology in=\"SourceAlpha\" radius=\"4.2857142857142856\"/>\n" + "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\n" + "<feGaussianBlur stdDeviation=\"1.2003571428571427\" result=\"result0\"/>\n" + "<feDiffuseLighting diffuseConstant=\"1\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"66\"/>\n" + "</feDiffuseLighting>\n" + "<feBlend blend=\"normal\" in2=\"SourceGraphic\" mode=\"multiply\"/>\n" + "<feComposite in2=\"SourceAlpha\" operator=\"in\"/>\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 */ + +/* Change the 'RIDGED_BORDER' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIDGED_BORDER_H__ */ diff --git a/src/extension/internal/filter/ripple.h b/src/extension/internal/filter/ripple.h new file mode 100644 index 000000000..39bef1e0f --- /dev/null +++ b/src/extension/internal/filter/ripple.h @@ -0,0 +1,44 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__ +/* Change the 'RIPPLE' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Ripple : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("ripple", /* ID -- should be unique */ + N_("Ripple"), /* Name in the menus, should have a N_() around it for translation */ + N_("You're 80% water"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence baseFrequency=\"0.001904761904761905 0.10666666666666667\" numOctaves=\"1\"/>\n" + "<feColorMatrix values=\"2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0.5\"/>\n" + "<feDisplacementMap in=\"SourceGraphic\" scale=\"14.317180616740089\" xChannelSelector=\"R\" yChannelSelector=\"A\"/>\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 */ + +/* Change the 'RIPPLE' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RIPPLE_H__ */ diff --git a/src/extension/internal/filter/roughen.h b/src/extension/internal/filter/roughen.h new file mode 100644 index 000000000..421c2e60c --- /dev/null +++ b/src/extension/internal/filter/roughen.h @@ -0,0 +1,43 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__ +/* Change the 'ROUGHEN' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Roughen : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("roughen", /* ID -- should be unique */ + N_("Roughen"), /* Name in the menus, should have a N_() around it for translation */ + N_("Like Brad Pitt's stubble"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence baseFrequency=\"0.040000000000000001\" in=\"SourceAlpha\" type=\"turbulence\" seed=\"0\" numOctaves=\"3\"/>\n" + "<feDisplacementMap in=\"SourceGraphic\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"6.6339066339066335\" numOctaves=\"2\"/>\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 */ + +/* Change the 'ROUGHEN' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ROUGHEN_H__ */ diff --git a/src/extension/internal/filter/rubber-stamp.h b/src/extension/internal/filter/rubber-stamp.h new file mode 100644 index 000000000..429beb618 --- /dev/null +++ b/src/extension/internal/filter/rubber-stamp.h @@ -0,0 +1,49 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__ +/* Change the 'RUBBER_STAMP' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class RubberStamp : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("rubber-stamp", /* ID -- should be unique */ + N_("RubberStamp"), /* Name in the menus, should have a N_() around it for translation */ + N_("Use this to forge your passport"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence type=\"fractalNoise\" numOctaves=\"4\" baseFrequency=\"0.064033264033264037\" in=\"SourceGraphic\" result=\"result1\"/>\n" + "<feGaussianBlur stdDeviation=\"4.8612668463611852\" in=\"SourceAlpha\"/>\n" + "<feComposite in=\"SourceAlpha\" operator=\"out\"/>\n" + "<feComposite in2=\"result1\"/>\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -9\" numOctaves=\"3\" result=\"result1\"/>\n" + "<feComposite in=\"SourceGraphic\" operator=\"in\" result=\"result1\"/>\n" + "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.03231597845601436\"/>\n" + "<feDisplacementMap in=\"result1\" xChannelSelector=\"R\" yChannelSelector=\"G\" scale=\"4.0609137055837561\"/>\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 */ + +/* Change the 'RUBBER_STAMP' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_RUBBER_STAMP_H__ */ diff --git a/src/extension/internal/filter/sepia.h b/src/extension/internal/filter/sepia.h new file mode 100644 index 000000000..1472bb543 --- /dev/null +++ b/src/extension/internal/filter/sepia.h @@ -0,0 +1,42 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__ +/* Change the 'SEPIA' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Sepia : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("sepia", /* ID -- should be unique */ + N_("Sepia"), /* Name in the menus, should have a N_() around it for translation */ + N_("Turn all the colors to be sepia tones"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feColorMatrix values=\"0.14 0.45 0.05 0 0 0.12 0.39 0.04 0 0 0.08 0.28 0.03 0 0 0 0 0 1 0\" />\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 */ + +/* Change the 'SEPIA' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SEPIA_H__ */ diff --git a/src/extension/internal/filter/snow.h b/src/extension/internal/filter/snow.h new file mode 100644 index 000000000..0b99cbc86 --- /dev/null +++ b/src/extension/internal/filter/snow.h @@ -0,0 +1,53 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__ +/* Change the 'SNOW' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Snow : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("snow", /* ID -- should be unique */ + N_("Snow"), /* Name in the menus, should have a N_() around it for translation */ + N_("When the weather outside is frightening..."), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feConvolveMatrix order=\"3 3\" kernelMatrix=\"1 1 1 0 0 0 -1 -1 -1\" preserveAlpha=\"false\" divisor=\"3\"/>\n" + "<feMorphology operator=\"dilate\" radius=\"1 3.2345013477088949\"/>\n" + "<feGaussianBlur stdDeviation=\"1.6270889487870621\" result=\"result0\"/>\n" + "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0\" result=\"result1\"/>\n" + "<feOffset dx=\"0\" dy=\"1\" result=\"result5\"/>\n" + "<feDiffuseLighting in=\"result0\" diffuseConstant=\"2.2613065326633168\" surfaceScale=\"1\">\n" + "<feDistantLight azimuth=\"225\" elevation=\"32\"/>\n" + "</feDiffuseLighting>\n" + "<feComposite in2=\"result1\" operator=\"in\" result=\"result2\"/>\n" + "<feColorMatrix values=\"0.4 0 0 0 0.6 0 0.4 0 0 0.6 0 0 0 0 1 0 0 0 1 0\" result=\"result4\"/>\n" + "<feComposite in2=\"result5\" in=\"result4\"/>\n" + "<feComposite in2=\"SourceGraphic\"/>\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 */ + +/* Change the 'SNOW' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SNOW_H__ */ diff --git a/src/extension/internal/filter/speckle.h b/src/extension/internal/filter/speckle.h new file mode 100644 index 000000000..b0a9733e2 --- /dev/null +++ b/src/extension/internal/filter/speckle.h @@ -0,0 +1,47 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__ +/* Change the 'SPECKLE' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Speckle : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("speckle", /* ID -- should be unique */ + N_("Speckle"), /* Name in the menus, should have a N_() around it for translation */ + N_("You look cute with speckles"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feTurbulence type=\"fractalNoise\" baseFrequency=\"0.20952380952380956\" numOctaves=\"1\" result=\"result1\"/>\n" + "<feColorMatrix type=\"luminanceToAlpha\" in=\"SourceGraphic\" result=\"result0\"/>\n" + "<feColorMatrix result=\"result2\" values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.8 0\"/>\n" + "<feComposite in2=\"result2\" operator=\"over\" in=\"result1\"/>\n" + "<feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -14\"/>\n" + "<feComposite in=\"SourceGraphic\" operator=\"out\"/>\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 */ + +/* Change the 'SPECKLE' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_SPECKLE_H__ */ diff --git a/src/extension/internal/filter/zebra.h b/src/extension/internal/filter/zebra.h new file mode 100644 index 000000000..0292808e4 --- /dev/null +++ b/src/extension/internal/filter/zebra.h @@ -0,0 +1,45 @@ +#ifndef __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__ +#define __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__ +/* Change the 'ZEBRA' above to be your file name */ + +/* + * Copyright (C) 2008 Authors: + * Ted Gould <ted@gould.cx> + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ +/* ^^^ Change the copyright to be you and your e-mail address ^^^ */ + +#include "filter.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { +namespace Filter { + +class Zebra : public Inkscape::Extension::Internal::Filter::Filter { +public: + static void init (void) { + filter_init("zebra", /* ID -- should be unique */ + N_("Zebra Stripes"), /* Name in the menus, should have a N_() around it for translation */ + N_("Paint your object with zebra stripes"), + /* Menu tooltip to help users understand the name. Should also have a N_() */ + "<filter>\n" + "<feColorMatrix type=\"matrix\" values=\"0.15 0.3 0.05 0 0.5 0.15 0.3 0.05 0 0.5 0.15 0.3 0.05 0 0.5 0 0 0 1 0\" result=\"result0\"/>\n" + "<feTurbulence numOctaves=\"1\" baseFrequency=\"0.078388278388278387 0.012454212454212455\"/>\n" + "<feColorMatrix values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 -0.8\"/>\n" + "<feComposite in2=\"result0\" operator=\"atop\"/>\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 */ + +/* Change the 'ZEBRA' below to be your file name */ +#endif /* __INKSCAPE_EXTENSION_INTERNAL_FILTER_ZEBRA_H__ */ |
