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 "shade.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
19 void
20 Shade::applyEffect(Magick::Image* image) {
21 image->shade(_azimuth, _elevation, _colorShading);
22 }
24 void
25 Shade::refreshParameters(Inkscape::Extension::Effect* module) {
26 _azimuth = module->get_param_float("azimuth");
27 _elevation = module->get_param_float("elevation");
28 _colorShading = module->get_param_bool("colorShading");
29 }
31 #include "../clear-n_.h"
33 void
34 Shade::init(void)
35 {
36 Inkscape::Extension::build_from_mem(
37 "<inkscape-extension>\n"
38 "<name>" N_("Shade") "</name>\n"
39 "<id>org.inkscape.effect.bitmap.shade</id>\n"
40 "<param name=\"azimuth\" gui-text=\"" N_("Azimuth") "\" type=\"float\" min=\"-180\" max=\"180\">30</param>\n"
41 "<param name=\"elevation\" gui-text=\"" N_("Elevation") "\" type=\"float\" min=\"-180\" max=\"180\">30</param>\n"
42 "<param name=\"colorShading\" gui-text=\"" N_("Colored Shading") "\" type=\"bool\">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 Shade Effect") "</menu-tip>\n"
49 "</effect>\n"
50 "</inkscape-extension>\n", new Shade());
51 }
53 }; /* namespace Bitmap */
54 }; /* namespace Internal */
55 }; /* namespace Extension */
56 }; /* namespace Inkscape */