Inkscape
Vector Graphics Editor
raise.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 "raise.h"
14#include <Magick++.h>
15
16namespace Inkscape {
17namespace Extension {
18namespace Internal {
19namespace Bitmap {
20
21void
22Raise::applyEffect(Magick::Image* image) {
23 Magick::Geometry geometry(_width, _height, 0, 0);
24 image->raise(geometry, _raisedFlag);
25}
26
27void
29 _width = module->get_param_int("width");
30 _height = module->get_param_int("height");
31 _raisedFlag = module->get_param_bool("raisedFlag");
32}
33
34#include "../clear-n_.h"
35
36void
38{
39 // clang-format off
41 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
42 "<name>" N_("Raise") "</name>\n"
43 "<id>org.inkscape.effect.bitmap.raise</id>\n"
44 "<param name=\"width\" gui-text=\"" N_("Width:") "\" type=\"int\" min=\"0\" max=\"800\">6</param>\n"
45 "<param name=\"height\" gui-text=\"" N_("Height:") "\" type=\"int\" min=\"0\" max=\"800\">6</param>\n"
46 "<param name=\"raisedFlag\" gui-text=\"" N_("Raised") "\" type=\"bool\">false</param>\n"
47 "<effect>\n"
48 "<object-type>all</object-type>\n"
49 "<effects-menu>\n"
50 "<submenu name=\"" N_("Raster") "\" />\n"
51 "</effects-menu>\n"
52 "<menu-tip>" N_("Alter lightness the edges of selected bitmap(s) to create a raised appearance") "</menu-tip>\n"
53 "</effect>\n"
54 "</inkscape-extension>\n", std::make_unique<Raise>());
55 // clang-format on
56}
57
58}; /* namespace Bitmap */
59}; /* namespace Internal */
60}; /* namespace Extension */
61}; /* 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
bool get_param_bool(char const *name) const
Gets a parameter identified by name with the bool placed in value.
Definition: extension.cpp:634
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
Definition: raise.cpp:28
void applyEffect(Magick::Image *image) override
Definition: raise.cpp:22
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.