|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Exact signed distance field from an antialiased coverage bitmap. More...

Go to the source code of this file.
Namespaces | |
| namespace | esengine |
| namespace | esengine::text |
Functions | |
| void | esengine::text::sdfFromAlpha (const u8 *alpha, u8 *out, u32 width, u32 height, f32 spread) |
| Signed distance field from an antialiased alpha coverage bitmap. | |
Exact signed distance field from an antialiased coverage bitmap.
Felzenszwalb–Huttenlocher separable squared-distance transform with coverage-derived fractional seeds (tiny-sdf lineage): a partially covered texel seeds the transform with (0.5 − α)², placing the edge at sub-texel accuracy so magnified glyphs stay smooth. Interior and exterior fields are subtracted for the signed distance; the 1D transform is exact and O(n), and skips the sites that cannot change a byte of the result (see edt1d).
Definition in file SdfGenerator.cpp.