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 "sample.h"
14 namespace Inkscape {
15 namespace Extension {
16 namespace Internal {
17 namespace Bitmap {
19 void
20 Sample::applyEffect(Magick::Image* image) {
21 Magick::Geometry geometry(_width, _height, 0, 0);
22 image->sample(geometry);
23 }
25 void
26 Sample::refreshParameters(Inkscape::Extension::Effect* module) {
27 _width = module->get_param_int("width");
28 _height = module->get_param_int("height");
29 }
31 #include "../clear-n_.h"
33 void
34 Sample::init(void)
35 {
36 Inkscape::Extension::build_from_mem(
37 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
38 "<name>" N_("Resample") "</name>\n"
39 "<id>org.inkscape.effect.bitmap.sample</id>\n"
40 "<param name=\"width\" gui-text=\"" N_("Width:") "\" type=\"int\" min=\"0\" max=\"6400\">100</param>\n"
41 "<param name=\"height\" gui-text=\"" N_("Height:") "\" type=\"int\" min=\"0\" max=\"6400\">100</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_("Alter the resolution of selected image by resizing it to the given pixel size") "</menu-tip>\n"
48 "</effect>\n"
49 "</inkscape-extension>\n", new Sample());
50 }
52 }; /* namespace Bitmap */
53 }; /* namespace Internal */
54 }; /* namespace Extension */
55 }; /* namespace Inkscape */