#include "MSDFErrorCorrection.h"
#include <cstring>
#include "arithmetics.hpp"
#include "equation-solver.h"
#include "EdgeColor.h"
#include "bitmap-interpolation.hpp"
#include "edge-selectors.h"
#include "contour-combiners.h"
#include "ShapeDistanceFinder.h"
#include "generator-config.h"
namespace msdfgen {
#define ARTIFACT_T_EPSILON …
#define PROTECTION_RADIUS_TOLERANCE …
#define CLASSIFIER_FLAG_CANDIDATE …
#define CLASSIFIER_FLAG_ARTIFACT …
MSDFGEN_PUBLIC const double ErrorCorrectionConfig::defaultMinDeviationRatio = …;
MSDFGEN_PUBLIC const double ErrorCorrectionConfig::defaultMinImproveRatio = …;
class BaseArtifactClassifier { … };
template <template <typename> class ContourCombiner, int N>
class ShapeDistanceChecker { … };
MSDFErrorCorrection::MSDFErrorCorrection() { … }
MSDFErrorCorrection::MSDFErrorCorrection(const BitmapRef<byte, 1> &stencil, const Projection &projection, double range) : … { … }
void MSDFErrorCorrection::setMinDeviationRatio(double minDeviationRatio) { … }
void MSDFErrorCorrection::setMinImproveRatio(double minImproveRatio) { … }
void MSDFErrorCorrection::protectCorners(const Shape &shape) { … }
static bool edgeBetweenTexelsChannel(const float *a, const float *b, int channel) { … }
static int edgeBetweenTexels(const float *a, const float *b) { … }
static void protectExtremeChannels(byte *stencil, const float *msd, float m, int mask) { … }
template <int N>
void MSDFErrorCorrection::protectEdges(const BitmapConstRef<float, N> &sdf) { … }
void MSDFErrorCorrection::protectAll() { … }
static float interpolatedMedian(const float *a, const float *b, double t) { … }
static float interpolatedMedian(const float *a, const float *l, const float *q, double t) { … }
static bool isArtifact(bool isProtected, double axSpan, double bxSpan, float am, float bm, float xm) { … }
template <class ArtifactClassifier>
static bool hasLinearArtifactInner(const ArtifactClassifier &artifactClassifier, float am, float bm, const float *a, const float *b, float dA, float dB) { … }
template <class ArtifactClassifier>
static bool hasDiagonalArtifactInner(const ArtifactClassifier &artifactClassifier, float am, float dm, const float *a, const float *l, const float *q, float dA, float dBC, float dD, double tEx0, double tEx1) { … }
template <class ArtifactClassifier>
static bool hasLinearArtifact(const ArtifactClassifier &artifactClassifier, float am, const float *a, const float *b) { … }
template <class ArtifactClassifier>
static bool hasDiagonalArtifact(const ArtifactClassifier &artifactClassifier, float am, const float *a, const float *b, const float *c, const float *d) { … }
template <int N>
void MSDFErrorCorrection::findErrors(const BitmapConstRef<float, N> &sdf) { … }
template <template <typename> class ContourCombiner, int N>
void MSDFErrorCorrection::findErrors(const BitmapConstRef<float, N> &sdf, const Shape &shape) { … }
template <int N>
void MSDFErrorCorrection::apply(const BitmapRef<float, N> &sdf) const { … }
BitmapConstRef<byte, 1> MSDFErrorCorrection::getStencil() const { … }
template void MSDFErrorCorrection::protectEdges(const BitmapConstRef<float, 3> &sdf);
template void MSDFErrorCorrection::protectEdges(const BitmapConstRef<float, 4> &sdf);
template void MSDFErrorCorrection::findErrors(const BitmapConstRef<float, 3> &sdf);
template void MSDFErrorCorrection::findErrors(const BitmapConstRef<float, 4> &sdf);
template void MSDFErrorCorrection::findErrors<SimpleContourCombiner>(const BitmapConstRef<float, 3> &sdf, const Shape &shape);
template void MSDFErrorCorrection::findErrors<SimpleContourCombiner>(const BitmapConstRef<float, 4> &sdf, const Shape &shape);
template void MSDFErrorCorrection::findErrors<OverlappingContourCombiner>(const BitmapConstRef<float, 3> &sdf, const Shape &shape);
template void MSDFErrorCorrection::findErrors<OverlappingContourCombiner>(const BitmapConstRef<float, 4> &sdf, const Shape &shape);
template void MSDFErrorCorrection::apply(const BitmapRef<float, 3> &sdf) const;
template void MSDFErrorCorrection::apply(const BitmapRef<float, 4> &sdf) const;
}