16 namespace signed_distance_field {
27 return std::max(std::abs(i - j) - 0.5F, 0.0F);
53 const float pSquared{p * p};
55 return (pSquared + p + fp) / (2.0F * p);
56 }
else if (fp < -pSquared) {
57 return (pSquared - p + fp) / (2.0F * p);
59 const float bound{pSquared - 2.0F * p + 1.0F};
61 return 0.5F + std::sqrt(fp);
62 }
else if (fp < -bound) {
63 return p - 0.5F - std::sqrt(-fp);
65 return (pSquared - p + fp) / (2.0F * p - 2.0F);
91 std::abs(q - p) >= 1.0F);
92 assert((q == p) ? fp == fq :
true);
95 return 0.5F * (p + q);
float squarePixelBorderDistance(float i, float j, float f)
float intersectionPointRightSideOfOrigin(float p, float fp)
float pixelBorderDistance(float i, float j)
float equidistancePoint(float q, float fq, float p, float fp)
float intersectionOffsetFromOrigin(float p, float fp)