~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/extension/internal/bitmap/unsharpmask.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

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 "unsharpmask.h"
 
13
 
 
14
namespace Inkscape {
 
15
namespace Extension {
 
16
namespace Internal {
 
17
namespace Bitmap {
 
18
        
 
19
void
 
20
Unsharpmask::applyEffect(Magick::Image* image) {
 
21
        float amount = _amount / 100.0;
 
22
        image->unsharpmask(_radius, _sigma, amount, _threshold);
 
23
}
 
24
 
 
25
void
 
26
Unsharpmask::refreshParameters(Inkscape::Extension::Effect* module) {
 
27
        _radius = module->get_param_float("radius");
 
28
        _sigma = module->get_param_float("sigma");
 
29
        _amount = module->get_param_float("amount");
 
30
        _threshold = module->get_param_float("threshold");
 
31
}
 
32
 
 
33
#include "../clear-n_.h"
 
34
 
 
35
void
 
36
Unsharpmask::init(void)
 
37
{
 
38
        Inkscape::Extension::build_from_mem(
 
39
                "<inkscape-extension>\n"
 
40
                        "<name>" N_("Unsharp Mask") "</name>\n"
 
41
                        "<id>org.inkscape.effect.bitmap.unsharpmask</id>\n"
 
42
                        "<param name=\"radius\" gui-text=\"" N_("Radius") "\" type=\"float\" min=\"0.0\" max=\"50.0\">5.0</param>\n"
 
43
                        "<param name=\"sigma\" gui-text=\"" N_("Sigma") "\" type=\"float\" min=\"0.0\" max=\"50.0\">5.0</param>\n"
 
44
                        "<param name=\"amount\" gui-text=\"" N_("Amount") "\" type=\"float\" min=\"0.0\" max=\"100.0\">50.0</param>\n"
 
45
                        "<param name=\"threshold\" gui-text=\"" N_("Threshold") "\" type=\"float\" min=\"0.0\" max=\"50.0\">5.0</param>\n"
 
46
                        "<effect>\n"
 
47
                                "<object-type>all</object-type>\n"
 
48
                                "<effects-menu>\n"
 
49
                                        "<submenu name=\"" N_("Raster") "\" />\n"
 
50
                                "</effects-menu>\n"
 
51
                                "<menu-tip>" N_("Sharpen selected bitmap(s) using unsharp mask algorithms.") "</menu-tip>\n"
 
52
                        "</effect>\n"
 
53
                "</inkscape-extension>\n", new Unsharpmask());
 
54
}
 
55
 
 
56
}; /* namespace Bitmap */
 
57
}; /* namespace Internal */
 
58
}; /* namespace Extension */
 
59
}; /* namespace Inkscape */