~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/extension/internal/bitmap/adaptiveThreshold.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
8
 
 
9
#include "extension/effect.h"
 
10
#include "extension/system.h"
 
11
 
 
12
#include "adaptiveThreshold.h"
 
13
 
 
14
namespace Inkscape {
 
15
namespace Extension {
 
16
namespace Internal {
 
17
namespace Bitmap {
 
18
        
 
19
void
 
20
AdaptiveThreshold::applyEffect(Magick::Image *image) {
 
21
        image->adaptiveThreshold(_width, _height);
 
22
}
 
23
 
 
24
void
 
25
AdaptiveThreshold::refreshParameters(Inkscape::Extension::Effect *module) {     
 
26
        _width = module->get_param_int("width");
 
27
        _height = module->get_param_int("height");
 
28
        _offset = module->get_param_int("offset");
 
29
}
 
30
 
 
31
#include "../clear-n_.h"
 
32
 
 
33
void
 
34
AdaptiveThreshold::init(void)
 
35
{
 
36
        Inkscape::Extension::build_from_mem(
 
37
                "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
 
38
                        "<name>" N_("Adaptive Threshold") "</name>\n"
 
39
                        "<id>org.inkscape.effect.bitmap.adaptiveThreshold</id>\n"
 
40
                        "<param name=\"width\" gui-text=\"" N_("Width") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
 
41
                        "<param name=\"height\" gui-text=\"" N_("Height") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
 
42
                        "<param name=\"offset\" gui-text=\"" N_("Offset") "\" type=\"int\" min=\"0\" max=\"100\">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 adaptive thresholding to selected bitmap(s).") "</menu-tip>\n"
 
49
                        "</effect>\n"
 
50
                "</inkscape-extension>\n", new AdaptiveThreshold());
 
51
}
 
52
 
 
53
}; /* namespace Bitmap */
 
54
}; /* namespace Internal */
 
55
}; /* namespace Extension */
 
56
}; /* namespace Inkscape */