summaryrefslogtreecommitdiffstats
path: root/src/trace/potrace
diff options
context:
space:
mode:
authorAaron Spike <aaron@ekips.org>2006-06-13 01:43:48 +0000
committeracspike <acspike@users.sourceforge.net>2006-06-13 01:43:48 +0000
commitfba8dd39307b922bb440f2755e3901b80d0c3889 (patch)
treea46c92793b0b29d83665dd568d8e38e222a332c2 /src/trace/potrace
parentpatch [ 1504669 ] New win32 icon (diff)
downloadinkscape-fba8dd39307b922bb440f2755e3901b80d0c3889.tar.gz
inkscape-fba8dd39307b922bb440f2755e3901b80d0c3889.zip
patch [ 1503865 ] Siox performance patch
(bzr r1208)
Diffstat (limited to 'src/trace/potrace')
-rw-r--r--src/trace/potrace/inkscape-potrace.cpp26
-rw-r--r--src/trace/potrace/inkscape-potrace.h7
2 files changed, 21 insertions, 12 deletions
diff --git a/src/trace/potrace/inkscape-potrace.cpp b/src/trace/potrace/inkscape-potrace.cpp
index 12ffc551a..e18abb338 100644
--- a/src/trace/potrace/inkscape-potrace.cpp
+++ b/src/trace/potrace/inkscape-potrace.cpp
@@ -13,8 +13,10 @@
*
*/
+#include "inkscape-potrace.h"
+
#include <glibmm/i18n.h>
-#include <gtkmm/main.h>
+#include <gtkmm.h>
#include "trace/filterset.h"
#include "trace/imagemap-gdk.h"
@@ -27,7 +29,6 @@
#include "curve.h"
#include "bitmap.h"
-#include "inkscape-potrace.h"
static void updateGui()
@@ -326,17 +327,20 @@ filterIndexed(PotraceTracingEngine &engine, GdkPixbuf * pixbuf)
-GdkPixbuf *
-PotraceTracingEngine::preview(GdkPixbuf * pixbuf)
+Glib::RefPtr<Gdk::Pixbuf>
+PotraceTracingEngine::preview(Glib::RefPtr<Gdk::Pixbuf> thePixbuf)
{
+ GdkPixbuf *pixbuf = thePixbuf->gobj();
+
if ( traceType == TRACE_QUANT_COLOR ||
traceType == TRACE_QUANT_MONO )
{
IndexedMap *gm = filterIndexed(*this, pixbuf);
if (!gm)
- return NULL;
+ return Glib::RefPtr<Gdk::Pixbuf>(NULL);
- GdkPixbuf *newBuf = indexedMapToGdkPixbuf(gm);
+ Glib::RefPtr<Gdk::Pixbuf> newBuf =
+ Glib::wrap(indexedMapToGdkPixbuf(gm), false);
gm->destroy(gm);
@@ -346,9 +350,10 @@ PotraceTracingEngine::preview(GdkPixbuf * pixbuf)
{
GrayMap *gm = filter(*this, pixbuf);
if (!gm)
- return NULL;
+ return Glib::RefPtr<Gdk::Pixbuf>(NULL);
- GdkPixbuf *newBuf = grayMapToGdkPixbuf(gm);
+ Glib::RefPtr<Gdk::Pixbuf> newBuf =
+ Glib::wrap(grayMapToGdkPixbuf(gm), false);
gm->destroy(gm);
@@ -668,9 +673,12 @@ PotraceTracingEngine::traceQuant(GdkPixbuf * thePixbuf, int *nrPaths)
* of an SVG <path> element.
*/
TracingEngineResult *
-PotraceTracingEngine::trace(GdkPixbuf * thePixbuf, int *nrPaths)
+PotraceTracingEngine::trace(Glib::RefPtr<Gdk::Pixbuf> pixbuf,
+ int *nrPaths)
{
+ GdkPixbuf *thePixbuf = pixbuf->gobj();
+
//Set up for messages
keepGoing = 1;
diff --git a/src/trace/potrace/inkscape-potrace.h b/src/trace/potrace/inkscape-potrace.h
index 7a8d97b2e..0f257cb95 100644
--- a/src/trace/potrace/inkscape-potrace.h
+++ b/src/trace/potrace/inkscape-potrace.h
@@ -16,7 +16,7 @@
#ifndef __INKSCAPE_POTRACE_H__
#define __INKSCAPE_POTRACE_H__
-#include <glib.h>
+#include <gtkmm.h>
#include <trace/trace.h>
#include <trace/imagemap.h>
@@ -165,7 +165,8 @@ class PotraceTracingEngine : public TracingEngine
* return the path data that is compatible with the d="" attribute
* of an SVG <path> element.
*/
- virtual TracingEngineResult *trace(GdkPixbuf *pixbuf, int *nrPaths);
+ virtual TracingEngineResult *trace(Glib::RefPtr<Gdk::Pixbuf> pixbuf,
+ int *nrPaths);
/**
* Abort the thread that is executing getPathDataFromPixbuf()
@@ -175,7 +176,7 @@ class PotraceTracingEngine : public TracingEngine
/**
*
*/
- GdkPixbuf *preview(GdkPixbuf * pixbuf);
+ Glib::RefPtr<Gdk::Pixbuf> preview(Glib::RefPtr<Gdk::Pixbuf> pixbuf);
/**
*