initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
47
thirdparty/msdfgen/core/contour-combiners.h
vendored
Normal file
47
thirdparty/msdfgen/core/contour-combiners.h
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include "edge-selectors.h"
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
/// Simply selects the nearest contour.
|
||||
template <class EdgeSelector>
|
||||
class SimpleContourCombiner {
|
||||
|
||||
public:
|
||||
typedef EdgeSelector EdgeSelectorType;
|
||||
typedef typename EdgeSelector::DistanceType DistanceType;
|
||||
|
||||
explicit SimpleContourCombiner(const Shape &shape);
|
||||
void reset(const Point2 &p);
|
||||
EdgeSelector &edgeSelector(int i);
|
||||
DistanceType distance() const;
|
||||
|
||||
private:
|
||||
EdgeSelector shapeEdgeSelector;
|
||||
|
||||
};
|
||||
|
||||
/// Selects the nearest contour that actually forms a border between filled and unfilled area.
|
||||
template <class EdgeSelector>
|
||||
class OverlappingContourCombiner {
|
||||
|
||||
public:
|
||||
typedef EdgeSelector EdgeSelectorType;
|
||||
typedef typename EdgeSelector::DistanceType DistanceType;
|
||||
|
||||
explicit OverlappingContourCombiner(const Shape &shape);
|
||||
void reset(const Point2 &p);
|
||||
EdgeSelector &edgeSelector(int i);
|
||||
DistanceType distance() const;
|
||||
|
||||
private:
|
||||
Point2 p;
|
||||
std::vector<int> windings;
|
||||
std::vector<EdgeSelector> edgeSelectors;
|
||||
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user