Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
SdfGenerator.hpp File Reference

Signed distance field generation from an 8-bit alpha coverage bitmap. More...

#include "../core/Types.hpp"
Include dependency graph for SdfGenerator.hpp:
This graph shows which files directly or indirectly include this file:

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.

Detailed Description

Signed distance field generation from an 8-bit alpha coverage bitmap.

Used by the runtime dynamic glyph atlas: glyphs are rasterized to alpha via Canvas2D on the TS side, then converted to an SDF here so they stay crisp at any scale and support cheap outline/shadow in the shader. Pure (no GL / no emscripten) so it is unit-testable and portable.

Definition in file SdfGenerator.hpp.