summaryrefslogtreecommitdiffstats
path: root/src/trace/depixelize/inkscape-depixelize.h
blob: adeefdc1012092f7b7acb7d04a2b7be16200e019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 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_TRACE_DEPIXELIZE_H
#define INKSCAPE_TRACE_DEPIXELIZE_H

#include "trace/trace.h"
#include "3rdparty/libdepixelize/kopftracer2011.h" // Cannot move to source file due to nested class.

namespace Inkscape {
namespace Trace {
namespace Depixelize {

enum class TraceType
{
    VORONOI,
    BSPLINES
};

class DepixelizeTracingEngine final
    : public TracingEngine
{
public:
    DepixelizeTracingEngine() = default;
    DepixelizeTracingEngine(TraceType traceType, double curves, int islands, int sparsePixels, double sparseMultiplier, bool optimize);

    TraceResult trace(Glib::RefPtr<Gdk::Pixbuf> const &pixbuf, Async::Progress<double> &progress) override;
    Glib::RefPtr<Gdk::Pixbuf> preview(Glib::RefPtr<Gdk::Pixbuf> const &pixbuf) override;
    bool check_image_size(Geom::IntPoint const &size) const override;

private:
    ::Tracer::Kopf2011::Options params;
    TraceType traceType = TraceType::VORONOI;
};

} // namespace Depixelize
} // namespace Trace
} // namespace Inkscape

#endif // INKSCAPE_TRACE_DEPIXELIZE_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 :