From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/trace/depixelize/inkscape-depixelize.h | 100 +++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 src/trace/depixelize/inkscape-depixelize.h (limited to 'src/trace/depixelize/inkscape-depixelize.h') diff --git a/src/trace/depixelize/inkscape-depixelize.h b/src/trace/depixelize/inkscape-depixelize.h new file mode 100644 index 0000000..85f6509 --- /dev/null +++ b/src/trace/depixelize/inkscape-depixelize.h @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * This is the C++ glue between Inkscape and Potrace + * + * Copyright (C) 2019 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + * + * Potrace, the wonderful tracer located at http://potrace.sourceforge.net, + * is provided by the generosity of Peter Selinger, to whom we are grateful. + * + */ + +#ifndef __INKSCAPE_DEPIXTRACE_H__ +#define __INKSCAPE_DEPIXTRACE_H__ + +#include +#include "3rdparty/libdepixelize/kopftracer2011.h" + +struct GrayMap_def; +typedef GrayMap_def GrayMap; + +namespace Inkscape { + +namespace Trace { + +namespace Depixelize { + +enum TraceType + { + TRACE_VORONOI, + TRACE_BSPLINES + }; + + +class DepixelizeTracingEngine : public TracingEngine +{ + + public: + + /** + * + */ + DepixelizeTracingEngine(); + DepixelizeTracingEngine(TraceType traceType, double curves, int islands, int sparsePixels, double sparseMultiplier, bool optimize); + + /** + * + */ + ~DepixelizeTracingEngine() override; + + /** + * This is the working method of this implementing class, and all + * implementing classes. Take a GdkPixbuf, trace it, and + * return the path data that is compatible with the d="" attribute + * of an SVG element. + */ + std::vector trace( + Glib::RefPtr pixbuf) override; + + /** + * Abort the thread that is executing getPathDataFromPixbuf() + */ + void abort() override; + + /** + * + */ + Glib::RefPtr preview(Glib::RefPtr pixbuf); + + /** + * + */ + int keepGoing; + + ::Tracer::Kopf2011::Options *params; + TraceType traceType; + +};//class PotraceTracingEngine + + + +} // namespace Depixelize +} // namespace Trace +} // namespace Inkscape + + +#endif //__INKSCAPE_TRACE_H__ + + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : -- cgit v1.2.3