Path: blob/master/thirdparty/msdfgen/core/contour-combiners.h
9903 views
1#pragma once23#include "Shape.h"4#include "edge-selectors.h"56namespace msdfgen {78/// Simply selects the nearest contour.9template <class EdgeSelector>10class SimpleContourCombiner {1112public:13typedef EdgeSelector EdgeSelectorType;14typedef typename EdgeSelector::DistanceType DistanceType;1516explicit SimpleContourCombiner(const Shape &shape);17void reset(const Point2 &p);18EdgeSelector &edgeSelector(int i);19DistanceType distance() const;2021private:22EdgeSelector shapeEdgeSelector;2324};2526/// Selects the nearest contour that actually forms a border between filled and unfilled area.27template <class EdgeSelector>28class OverlappingContourCombiner {2930public:31typedef EdgeSelector EdgeSelectorType;32typedef typename EdgeSelector::DistanceType DistanceType;3334explicit OverlappingContourCombiner(const Shape &shape);35void reset(const Point2 &p);36EdgeSelector &edgeSelector(int i);37DistanceType distance() const;3839private:40Point2 p;41std::vector<int> windings;42std::vector<EdgeSelector> edgeSelectors;4344};4546}474849