Inkscape
Vector Graphics Editor
adaptiveThreshold.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Copyright (C) 2007 Authors:
4 * Christopher Brown <audiere@gmail.com>
5 * Ted Gould <ted@gould.cx>
6 *
7 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
8 */
9
10#include "extension/effect.h"
11#include "extension/system.h"
12
13#include "adaptiveThreshold.h"
14#include <Magick++.h>
15
16namespace Inkscape {
17namespace Extension {
18namespace Internal {
19namespace Bitmap {
20
21void
23 image->adaptiveThreshold(_width, _height);
24}
25
26void
28 _width = module->get_param_int("width");
29 _height = module->get_param_int("height");
30 _offset = module->get_param_int("offset");
31}
32
33#include "../clear-n_.h"
34
35void
37{
38 // clang-format off
40 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
41 "<name>" N_("Adaptive Threshold") "</name>\n"
42 "<id>org.inkscape.effect.bitmap.adaptiveThreshold</id>\n"
43 "<param name=\"width\" gui-text=\"" N_("Width:") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
44 "<param name=\"height\" gui-text=\"" N_("Height:") "\" type=\"int\" min=\"-100\" max=\"100\">5</param>\n"
45 "<param name=\"offset\" gui-text=\"" N_("Offset:") "\" type=\"int\" min=\"0\" max=\"100\">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_("Apply adaptive thresholding to selected bitmap(s)") "</menu-tip>\n"
52 "</effect>\n"
53 "</inkscape-extension>\n", std::make_unique<AdaptiveThreshold>());
54 // clang-format on
55}
56
57}; /* namespace Bitmap */
58}; /* namespace Internal */
59}; /* namespace Extension */
60}; /* namespace Inkscape */
Effects are extensions that take a document and do something to it in place.
Definition: effect.h:39
int get_param_int(char const *name) const
Gets a parameter identified by name with the integer placed in value.
Definition: extension.cpp:662
virtual unsigned image(Inkscape::Extension::Print *, unsigned char *, unsigned int, unsigned int, unsigned int, Geom::Affine const &, SPStyle const *)
void refreshParameters(Inkscape::Extension::Effect *module) override
std::unique_ptr< Magick::Image > image
Definition: imagemagick.cpp:40
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
Definition: system.cpp:471
CMYK to sRGB conversion routines.