MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_text()

void MayaFlux::Portal::Forma::Element::set_text ( std::string_view  text,
std::optional< Portal::Text::PressParams params 
)

Re-composite text into the retained GPU texture.

No-op when texture is null (element was not constructed via with_text()). Calls Portal::Text::repress(VKImage&, ...) which updates the image in-place. Rebinds the texture after repress in case repress reallocated the VKImage.

Parameters
textNew UTF-8 string.
paramsPressParams. Defaults apply when omitted.

Definition at line 68 of file Element.cpp.

69{
70 if (!texture)
71 return;
72
73 if (!params.has_value())
74 params = Portal::Text::PressParams {};
75
76 Portal::Text::repress(texture, text, *params);
77 if (buffer)
78 buffer->bind_texture(0, texture);
79}
bool repress(const std::shared_ptr< Buffers::TextBuffer > &target, std::string_view text, glm::vec4 color, RedrawPolicy policy)
Re-composite a UTF-8 string into an existing TextBuffer.
Definition InkPress.cpp:316
std::shared_ptr< Core::VKImage > texture
Optional GPU texture to bind to the attached buffer. Used for.
Definition Element.hpp:75
std::shared_ptr< Buffers::FormaBuffer > buffer
Buffer whose rendered output occupies this region.
Definition Element.hpp:72

References buffer, MayaFlux::Portal::Text::repress(), and texture.

+ Here is the call graph for this function: