1
2#pragma once
3
4#include "Shape.h"
5#include "edge-selectors.h"
6
7namespace msdfgen {
8
9/// Simply selects the nearest contour.
10template <class EdgeSelector>
11class SimpleContourCombiner {
12
13public:
14 typedef EdgeSelector EdgeSelectorType;
15 typedef typename EdgeSelector::DistanceType DistanceType;
16
17 explicit SimpleContourCombiner(const Shape &shape);
18 void reset(const Point2 &p);
19 EdgeSelector & edgeSelector(int i);
20 DistanceType distance() const;
21
22private:
23 EdgeSelector shapeEdgeSelector;
24
25};
26
27/// Selects the nearest contour that actually forms a border between filled and unfilled area.
28template <class EdgeSelector>
29class OverlappingContourCombiner {
30
31public:
32 typedef EdgeSelector EdgeSelectorType;
33 typedef typename EdgeSelector::DistanceType DistanceType;
34
35 explicit OverlappingContourCombiner(const Shape &shape);
36 void reset(const Point2 &p);
37 EdgeSelector & edgeSelector(int i);
38 DistanceType distance() const;
39
40private:
41 Point2 p;
42 std::vector<int> windings;
43 std::vector<EdgeSelector> edgeSelectors;
44
45};
46
47}
48