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 "modulate.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
19 void
20 Modulate::applyEffect(Magick::Image* image) {
21 float hue = (_hue + 180.0) / 180.0;
22 image->modulate(_brightness, _saturation, hue);
23 }
25 void
26 Modulate::refreshParameters(Inkscape::Extension::Effect* module) {
27 _brightness = module->get_param_float("brightness");
28 _saturation = module->get_param_float("saturation");
29 _hue = module->get_param_float("hue");
30 }
32 #include "../clear-n_.h"
34 void
35 Modulate::init(void)
36 {
37 Inkscape::Extension::build_from_mem(
38 "<inkscape-extension>\n"
39 "<name>" N_("Modulate") "</name>\n"
40 "<id>org.inkscape.effect.bitmap.modulate</id>\n"
41 "<param name=\"brightness\" gui-text=\"" N_("Brightness") "\" type=\"float\" min=\"0\" max=\"100\">1</param>\n"
42 "<param name=\"saturation\" gui-text=\"" N_("Saturation") "\" type=\"float\" min=\"0\" max=\"100\">1</param>\n"
43 "<param name=\"hue\" gui-text=\"" N_("Hue") "\" type=\"float\" min=\"-180\" max=\"180\">0</param>\n"
44 "<effect>\n"
45 "<object-type>all</object-type>\n"
46 "<effects-menu>\n"
47 "<submenu name=\"" N_("Raster") "\" />\n"
48 "</effects-menu>\n"
49 "<menu-tip>" N_("Modulate percent hue, saturation, and brightness of selected bitmap(s).") "</menu-tip>\n"
50 "</effect>\n"
51 "</inkscape-extension>\n", new Modulate());
52 }
54 }; /* namespace Bitmap */
55 }; /* namespace Internal */
56 }; /* namespace Extension */
57 }; /* namespace Inkscape */