pixelartdialog.cpp revision 09460560682aaf5c0b5ac1600aef2432a6b49f8d
/**
* @file
* Pixel art tracing settings dialog - implementation.
*/
/* Authors:
* Bob Jamison <rjamison@titan.com>
* Stéphane Gimenez <dev@gim.name>
* VinÃcius dos Santos Oliveira <vini.ipsmaker@gmail.com>
* Other dudes from The Inkscape Organization
*
* Copyright (C) 2004-2013 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "pixelartdialog.h"
#include <gtkmm/radiobutton.h>
#include "ui/widget/spinbutton.h"
#include "desktop.h"
#include "desktop-tracker.h"
#include "message-stack.h"
#include "selection.h"
#include "preferences.h"
#include "sp-image.h"
#include "display/cairo-utils.h"
#include "libdepixelize/kopftracer2011.h"
#include <algorithm>
#include "document.h"
#include "xml/document.h"
#include "svg/svg-color.h"
#include "color.h"
#include "svg/css-ostringstream.h"
#include "document-undo.h"
#ifdef HAVE_OPENMP
#include <omp.h>
#endif // HAVE_OPENMP
namespace Inkscape {
namespace UI {
namespace Dialog {
template<class T>
{
#ifdef LIBDEPIXELIZE_ENABLE_CPP11
#else
T ret;
return ret;
#endif // LIBDEPIXELIZE_ENABLE_CPP11
}
/**
* A dialog for adjusting pixel art -> vector tracing parameters
*/
class PixelArtDialogImpl : public PixelArtDialog
{
public:
private:
//############ Events
void responseCallback(int response_id);
//############ UI Logic
void vectorize();
void setDefaults();
void updatePreview();
bool ignorePreview;
bool pendingPreview;
//############ UI
};
{
}
{
}
ignorePreview(false),
pendingPreview(false)
{
// Heuristics
{
{
char const *str = _("Favors connections that are part of foreground color");
}
{
char const *str = _("The heuristic computed vote will be multiplied by this value");
}
}
// Output
{
}
// Buttons
{
//## The OK button
if (mainCancelButton) {
mainCancelButton->set_sensitive(false);
}
}
setDefaults();
desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &PixelArtDialogImpl::setTargetDesktop) );
}
{
if (response_id == GTK_RESPONSE_OK) {
vectorize();
} else if (response_id == GTK_RESPONSE_CANCEL) {
// TODO
} else if (response_id == GTK_RESPONSE_HELP) {
setDefaults();
} else {
hide();
return;
}
}
{
#ifdef HAVE_OPENMP
#else
1,
#endif // HAVE_OPENMP
1, 256);
return options;
}
void PixelArtDialogImpl::vectorize()
{
char *msg = _("Select an <b>image</b> to trace");
return;
}
bool found = false;
continue;
found = true;
}
if ( !found ) {
char *msg = _("Select an <b>image</b> to trace");
return;
}
_("Trace pixel art"));
// Flush pending updates
}
{
if ( voronoiRadioButton.get_active() ) {
} else {
}
{
{
gchar b[64];
sp_svg_write_color(b, sizeof(b),
}
{
}
}
}
{
+ ')').c_str());
}
}
void PixelArtDialogImpl::setDefaults()
{
ignorePreview = true;
ignorePreview = false;
if ( pendingPreview )
}
void PixelArtDialogImpl::updatePreview()
{
if ( ignorePreview ) {
pendingPreview = true;
return;
}
// TODO: update preview
pendingPreview = false;
}
/**
* Factory method. Use this to create a new PixelArtDialog
*/
{
return *dialog;
}
{
}
} //namespace Dialog
} //namespace UI
} //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:fileencoding=utf-8:textwidth=99 :