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

◆ retarget()

Element & MayaFlux::Portal::Forma::Element::retarget ( Kinesis::AABB2D  region)

Move the element's output to a new NDC region.

The geometry-only half of a scroll reflow. Text from with_text() is laid out again into region; a texture from with_texture() has its quad rewritten there. No-op when buffer is null.

Parameters
regionNew NDC extent.

Definition at line 62 of file Element.cpp.

63{
64 if (!buffer)
65 return *this;
66
67 if (text_slice) {
68 text_slice->set_bounds(region);
69 return *this;
70 }
71
72 buffer.submit(Kinesis::textured_mesh_rect(region, k_single_texture_weight));
73 return *this;
74}
void submit(const std::vector< uint8_t > &bytes) const
Replace this target's geometry.
Definition Target.cpp:51
std::array< Kakshya::MeshVertex, 6 > textured_mesh_rect(Kinesis::AABB2D region, float weight, glm::vec3 color)
Generate a UV-mapped TRIANGLE_LIST quad (6 vertices, 2 triangles) from an AABB2D, as Kakshya::MeshVer...
FormaTarget buffer
Where this region's rendered output is written: a buffer of its own, or a slice of one it shares.
Definition Element.hpp:82
std::shared_ptr< internal::TextSlice > text_slice
Text drawn into the attached buffer by with_text().
Definition Element.hpp:89

References buffer, MayaFlux::Portal::Forma::FormaTarget::submit(), text_slice, and MayaFlux::Kinesis::textured_mesh_rect().

+ Here is the call graph for this function: