0fa966e09d1bc7921a4b16dbeaa7ef8a5b95501e
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 "contrast.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
19 void
20 Contrast::applyEffect(Magick::Image *image) {
21 // the contrast method's argument seems to be binary, so we perform it multiple times
22 // to get the desired level of effect
23 for (unsigned int i = 0; i < _sharpen; i ++)
24 image->contrast(1);
25 }
27 void
28 Contrast::refreshParameters(Inkscape::Extension::Effect *module) {
29 _sharpen = module->get_param_int("sharpen");
30 }
32 #include "../clear-n_.h"
34 void
35 Contrast::init(void)
36 {
37 Inkscape::Extension::build_from_mem(
38 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
39 "<name>" N_("Contrast") "</name>\n"
40 "<id>org.inkscape.effect.bitmap.contrast</id>\n"
41 "<param name=\"sharpen\" gui-text=\"" N_("Adjust:") "\" type=\"int\" min=\"0\" max=\"10\">0</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_("Increase or decrease contrast in bitmap(s)") "</menu-tip>\n"
48 "</effect>\n"
49 "</inkscape-extension>\n", new Contrast());
50 }
52 }; /* namespace Bitmap */
53 }; /* namespace Internal */
54 }; /* namespace Extension */
55 }; /* namespace Inkscape */