Skip to content

ludus::graphics::text::CoverageAtlas

Ludus Wiki · API overview · Browse API

Class

Bounded append-only CPU R8 atlas and cache. Single owner thread. Atlas coordinates never move until Reset; no implicit eviction or glyph fallback. Capacity errors are explicit and preserve the failed insertion. Publish creates immutable whole texture versions: callers retain earlier versions through prepared/GPU uses. This trades bounded old/new overlap for portable, auditable update hazards.

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

#include <ludus/graphics/text/coverage_atlas.hpp>
class ludus::graphics::text::CoverageAtlas final

Static fields

EXTENT

static constexpr foundation::uint32 ludus::graphics::text::CoverageAtlas::EXTENT = 256
Physical texels per axis; one fixed page, no mipmaps.

Related types: foundation::uint32

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

MAX_GLYPHS

static constexpr foundation::usize ludus::graphics::text::CoverageAtlas::MAX_GLYPHS = 512
Maximum independently cached sized glyphs, including whitespace.

Related types: foundation::usize

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Methods

CoverageAtlas

ludus::graphics::text::CoverageAtlas::CoverageAtlas() noexcept
Construct without allocation.

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

~CoverageAtlas

ludus::graphics::text::CoverageAtlas::~CoverageAtlas()
Release CPU shadows; published RHI texture owners are independent.

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Initialize

rhi::RasterStatus ludus::graphics::text::CoverageAtlas::Initialize() noexcept
Reserve the CPU page/cache once. Ready if already initialized.

Related types: rhi::RasterStatus

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Reset

void ludus::graphics::text::CoverageAtlas::Reset() noexcept
Clear cells and keys; callers must rebuild lists against newly published page.

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Find

rhi::RasterStatus ludus::graphics::text::CoverageAtlas::Find(GlyphKey key, AtlasGlyph &output) const noexcept
Find an exact key; NotReady on cache miss, preserving output.

Related types: rhi::RasterStatus · AtlasGlyph · GlyphKey

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Insert

rhi::RasterStatus ludus::graphics::text::CoverageAtlas::Insert(GlyphKey key, const foundation::uint8 *bytes, foundation::usize byteCount, foundation::uint32 width, foundation::uint32 height, foundation::int32 bearingLeft, foundation::int32 bearingTop, AtlasGlyph &output) noexcept
Copy normalized top-down tightly packed R8 coverage and signed bearings. byteCount must equal width*height; zero-area glyphs accept null/zero bytes. First insertion fixes that key's metrics/content. Repeated keys return it. Invalid data/capacity failure preserve output and the existing cache/page.

Related types: foundation::int32 · foundation::uint8 · foundation::usize · foundation::uint32 · rhi::RasterStatus · AtlasGlyph · GlyphKey

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Publish

rhi::RasterStatus ludus::graphics::text::CoverageAtlas::Publish(rhi::DeviceHandle device, rhi::TextureHandle &output) const noexcept
Copy the complete page into a new sampled R8 resource between frames. Null output required; Ready/Pending owns a version. GetStatus on the RHI texture polls native/browser validation. No old texture or atlas cell changes.

Related types: rhi::RasterStatus · rhi::DeviceHandle · rhi::TextureHandle

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

GlyphCount

foundation::usize ludus::graphics::text::CoverageAtlas::GlyphCount() const noexcept
Number of cached sized glyphs since Reset.

Related types: foundation::usize

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

OccupiedTexels

foundation::usize ludus::graphics::text::CoverageAtlas::OccupiedTexels() const noexcept
Texels occupied including filtering gutters; zero-area glyphs use none.

Related types: foundation::usize

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Coverage

const foundation::uint8 * ludus::graphics::text::CoverageAtlas::Coverage() const noexcept
Borrow complete top-down R8 shadow until insertion/reset/destruction.

Related types: foundation::uint8

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp