#pragma once #include "Shape.h" #include "edge-selectors.h" namespace msdfgen { /// Simply selects the nearest contour. template class SimpleContourCombiner { public: typedef EdgeSelector EdgeSelectorType; typedef typename EdgeSelector::DistanceType DistanceType; explicit SimpleContourCombiner(const Shape &shape); void reset(const Point2 &p); void setContourEdgeSelection(int i, const EdgeSelector &edgeSelector); DistanceType distance() const; private: EdgeSelector shapeEdgeSelector; }; /// Selects the nearest contour that actually forms a border between filled and unfilled area. template class OverlappingContourCombiner { public: typedef EdgeSelector EdgeSelectorType; typedef typename EdgeSelector::DistanceType DistanceType; explicit OverlappingContourCombiner(const Shape &shape); void reset(const Point2 &p); void setContourEdgeSelection(int i, const EdgeSelector &edgeSelector); DistanceType distance() const; private: std::vector windings; std::vector edgeSelectors; EdgeSelector shapeEdgeSelector; EdgeSelector innerEdgeSelector; EdgeSelector outerEdgeSelector; }; }