bluredge.cpp revision 7791797492aed22ddeede22d237fbdc996c0d31b
/**
\file bluredge.cpp
A plug-in to add an effect to blur the edges of an object.
*/
/*
* Authors:
* Ted Gould <ted@gould.cx>
*
* Copyright (C) 2005 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "desktop.h"
#include "selection.h"
#include "prefs-utils.h"
#include "path-chemistry.h"
#include "sp-item.h"
#include "util/glib-list-iterators.h"
#include "bluredge.h"
namespace Inkscape {
namespace Extension {
namespace Internal {
/**
\brief A function to allocated anything -- just an example here
\param module Unused
\return Whether the load was sucessful
*/
bool
{
// std::cout << "Hey, I'm Blur Edge, I'm loading!" << std::endl;
return TRUE;
}
/**
\brief This actually blurs the edge.
\param module The effect that was called (unused)
\param document What should be edited.
*/
void
{
// TODO need to properly refcount the items, at least
/** \todo Need to figure out how to get from XML::Node to SPItem */
/* new_items.push_back(); */
double orig_opacity = sp_repr_css_double_property(sp_repr_css_attr(SP_OBJECT_REPR(spitem), "style"), "opacity", 1.0);
char opacity_string[64];
orig_opacity / (steps));
for (int i = 0; i < steps; i++) {
if (offset < 0.0) {
/* Doing an inset here folks */
offset *= -1.0;
} else if (offset == 0.0) {
} else {
}
}
}
return;
}
{
}
#include "clear-n_.h"
void
{
"<inkscape-extension>\n"
"<id>org.inkscape.effect.bluredge</id>\n"
"<param name=\"blur-width\" gui-text=\"" N_("Blur Width") "\" type=\"float\" min=\"1.0\" max=\"50.0\">1.0</param>\n"
"<param name=\"num-steps\" gui-text=\"" N_("Number of Steps") "\" type=\"int\" min=\"5\" max=\"100\">11</param>\n"
"<effect>\n"
"<object-type>all</object-type>\n"
"<effects-menu>\n"
"</effects-menu>\n"
"</effect>\n"
"</inkscape-extension>\n" , new BlurEdge());
return;
}
}; /* namespace Internal */
}; /* namespace Extension */
}; /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :