|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API void MayaFlux::Portal::Text::ink_quads | ( | const std::shared_ptr< Buffers::TextBuffer > & | target, |
| std::span< const GlyphQuad > | quads, | ||
| glm::vec4 | color, | ||
| GlyphAtlas * | atlas = nullptr |
||
| ) |
Rasterize a mutated quad span into an existing TextBuffer.
Clears the buffer's pixel region to target->get_background(), rasterizes quads via rasterize_quads(), and marks the buffer dirty for GPU upload. The scratch pixel buffer is thread-local and reused across calls, so no heap allocation occurs after the first call at a given buffer size.
Typical usage:
quads' UV coordinates are only meaningful against the atlas they were laid out from. atlas null (the default) resolves to whatever the TypeFaceFoundry default atlas is at this call, not at layout time: if something else has called set_default_font() since, or the atlas has grown, a held LayoutResult's quads will sample the wrong texture. Pass the same atlas the quads were laid out against explicitly whenever it might not still be the current default by the time this runs.
| target | TextBuffer to write into. Dimensions are read from the buffer. |
| quads | Quads produced by create_layout(), optionally mutated by the caller. |
| color | RGBA glyph color in [0, 1]. |
| atlas | Atlas the quads' UVs are relative to. Null selects the TypeFaceFoundry default at call time. |
Definition at line 311 of file InkPress.cpp.
References MayaFlux::Journal::API, color, MF_ERROR, pixels, MayaFlux::Journal::Portal, and rasterize_quads().
Here is the call graph for this function: