1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (C) 2007 Authors:
4  *   Christopher Brown <audiere@gmail.com>
5  *   Ted Gould <ted@gould.cx>
6  *
7  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
8  */
9 
10 #include "extension/effect.h"
11 #include "extension/system.h"
12 
13 #include "implode.h"
14 #include <Magick++.h>
15 
16 namespace Inkscape {
17 namespace Extension {
18 namespace Internal {
19 namespace Bitmap {
20 
21 void
applyEffect(Magick::Image * image)22 Implode::applyEffect(Magick::Image* image) {
23 	image->implode(_factor);
24 }
25 
26 void
refreshParameters(Inkscape::Extension::Effect * module)27 Implode::refreshParameters(Inkscape::Extension::Effect* module) {
28 	_factor = module->get_param_float("factor");
29 }
30 
31 #include "../clear-n_.h"
32 
33 void
init()34 Implode::init()
35 {
36     // clang-format off
37     Inkscape::Extension::build_from_mem(
38         "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
39             "<name>" N_("Implode") "</name>\n"
40             "<id>org.inkscape.effect.bitmap.implode</id>\n"
41             "<param name=\"factor\" gui-text=\"" N_("Factor:") "\" type=\"float\" min=\"0\" max=\"100\">10</param>\n"
42             "<effect>\n"
43                 "<object-type>all</object-type>\n"
44                 "<effects-menu>\n"
45                     "<submenu name=\"" N_("Raster") "\" />\n"
46                 "</effects-menu>\n"
47                 "<menu-tip>" N_("Implode selected bitmap(s)") "</menu-tip>\n"
48             "</effect>\n"
49         "</inkscape-extension>\n", new Implode());
50     // clang-format on
51 }
52 
53 }; /* namespace Bitmap */
54 }; /* namespace Internal */
55 }; /* namespace Extension */
56 }; /* namespace Inkscape */
57