Code

e6a43b98054e6015c8b6eb3e9fe71362957b846a
[inkscape.git] / src / extension / internal / bitmap / threshold.cpp
1 /*
2  * Copyright (C) 2007 Authors:
3  *   Christopher Brown <audiere@gmail.com>
4  *   Ted Gould <ted@gould.cx>
5  *   
6  * Released under GNU GPL, read the file 'COPYING' for more information
7  */
9 #include "extension/effect.h"
10 #include "extension/system.h"
12 #include "threshold.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
18         
19 void
20 Threshold::applyEffect(Magick::Image* image) {
21         image->threshold(_threshold);
22 }
24 void
25 Threshold::refreshParameters(Inkscape::Extension::Effect* module) {
26         _threshold = module->get_param_float("threshold");
27 }
29 #include "../clear-n_.h"
31 void
32 Threshold::init(void)
33 {
34         Inkscape::Extension::build_from_mem(
35                 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
36 // TRANSLATORS: see http://docs.gimp.org/en/gimp-tool-threshold.html
37                         "<name>" N_("Threshold") "</name>\n"
38                         "<id>org.inkscape.effect.bitmap.threshold</id>\n"
39                         "<param name=\"threshold\" gui-text=\"" N_("Threshold:") "\" type=\"float\" min=\"-100.0\" max=\"100.0\"></param>\n"
40                         "<effect>\n"
41                                 "<object-type>all</object-type>\n"
42                                 "<effects-menu>\n"
43                                         "<submenu name=\"" N_("Raster") "\" />\n"
44                                 "</effects-menu>\n"
45                                 "<menu-tip>" N_("Threshold selected bitmap(s).") "</menu-tip>\n"
46                         "</effect>\n"
47                 "</inkscape-extension>\n", new Threshold());
48 }
50 }; /* namespace Bitmap */
51 }; /* namespace Internal */
52 }; /* namespace Extension */
53 }; /* namespace Inkscape */