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/autotrace/inkscape-autotrace.h | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 src/trace/autotrace/inkscape-autotrace.h (limited to 'src/trace/autotrace/inkscape-autotrace.h') diff --git a/src/trace/autotrace/inkscape-autotrace.h b/src/trace/autotrace/inkscape-autotrace.h new file mode 100644 index 0000000..f12eb35 --- /dev/null +++ b/src/trace/autotrace/inkscape-autotrace.h @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * This is the C++ glue between Inkscape and Autotrace + *//* + * + * Authors: + * Marc Jeanmougin + * + * Copyright (C) 2018 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + * + * Autotrace is available at http://github.com/autotrace/autotrace. + * + */ + +#ifndef __INKSCAPE_AUTOTRACE_H__ +#define __INKSCAPE_AUTOTRACE_H__ + +#include "3rdparty/autotrace/autotrace.h" +#include + +namespace Inkscape { + +namespace Trace { + +namespace Autotrace { +enum TraceType { TRACE_CENTERLINE, TRACE_OUTLINE }; + +class AutotraceTracingEngine : public TracingEngine { + + public: + /** + * + */ + AutotraceTracingEngine(); + + /** + * + */ + ~AutotraceTracingEngine() override; + + + /** + * Sets/gets parameters + */ + // TODO + + /** + * 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; + + //private: + // autotrace_param_t *autotraceParams; + TraceType traceType; + at_fitting_opts_type *opts; + + //## do I invert at the end? + bool invert; + +}; // class AutotraceTracingEngine + + + +} // namespace Autotrace +} // namespace Trace +} // namespace Inkscape + + +#endif //__INKSCAPE_POTRACE_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