Code

Extensions. Consistency fix and UI improvements (internal extensions and filters).
[inkscape.git] / src / extension / internal / bitmap / solarize.cpp
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 "solarize.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
18         
19 void
20 Solarize::applyEffect(Magick::Image* image) {
21     // Image Magick Quantum depth = 16
22     // 655.35 = (2^16 - 1) / 100
23         image->solarize(_factor * 655.35);
24 }
26 void
27 Solarize::refreshParameters(Inkscape::Extension::Effect* module) {
28         _factor = module->get_param_float("factor");
29 }
31 #include "../clear-n_.h"
33 void
34 Solarize::init(void)
35 {
36         Inkscape::Extension::build_from_mem(
37                 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
38                         "<name>" N_("Solarize") "</name>\n"
39                         "<id>org.inkscape.effect.bitmap.solarize</id>\n"
40                         "<param name=\"factor\" gui-text=\"" N_("Factor:") "\" type=\"float\" min=\"0\" max=\"100\">50</param>\n"
41                         "<effect>\n"
42                                 "<object-type>all</object-type>\n"
43                                 "<effects-menu>\n"
44                                         "<submenu name=\"" N_("Raster") "\" />\n"
45                                 "</effects-menu>\n"
46                                 "<menu-tip>" N_("Solarize selected bitmap(s), like overexposing photographic film.") "</menu-tip>\n"
47                         "</effect>\n"
48                 "</inkscape-extension>\n", new Solarize());
49 }
51 }; /* namespace Bitmap */
52 }; /* namespace Internal */
53 }; /* namespace Extension */
54 }; /* namespace Inkscape */