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 "adaptiveThreshold.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
19 void
20 AdaptiveThreshold::applyEffect(Magick::Image *image) {
21 image->adaptiveThreshold(_width, _height);
22 }
24 void
25 AdaptiveThreshold::refreshParameters(Inkscape::Extension::Effect *module) {
26 _width = module->get_param_int("width");
27 _height = module->get_param_int("height");
28 _offset = module->get_param_int("offset");
29 }
31 #include "../clear-n_.h"
33 void
34 AdaptiveThreshold::init(void)
35 {
36 Inkscape::Extension::build_from_mem(
37 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
38 "<name>" N_("Adaptive Threshold") "</name>\n"
39 "<id>org.inkscape.effect.bitmap.adaptiveThreshold</id>\n"
40 "<param name=\"width\" gui-text=\"" N_("Width:") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
41 "<param name=\"height\" gui-text=\"" N_("Height:") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
42 "<param name=\"offset\" gui-text=\"" N_("Offset:") "\" type=\"int\" min=\"0\" max=\"100\">0</param>\n"
43 "<effect>\n"
44 "<object-type>all</object-type>\n"
45 "<effects-menu>\n"
46 "<submenu name=\"" N_("Raster") "\" />\n"
47 "</effects-menu>\n"
48 "<menu-tip>" N_("Apply adaptive thresholding to selected bitmap(s)") "</menu-tip>\n"
49 "</effect>\n"
50 "</inkscape-extension>\n", new AdaptiveThreshold());
51 }
53 }; /* namespace Bitmap */
54 }; /* namespace Internal */
55 }; /* namespace Extension */
56 }; /* namespace Inkscape */