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

◆ row_pixel_dims()

MAYAFLUX_API glm::uvec2 MayaFlux::Portal::Forma::row_pixel_dims ( const std::shared_ptr< Core::Window > &  window,
float  x_min,
float  x_max,
float  row_h 
)

Convert an NDC row rect into integer pixel dimensions.

Clamps width to at least 1 pixel and height to at least the default atlas pixel size to avoid degenerate textures.

Parameters
windowTarget window for pixel dimension calculation.
x_minLeft edge in NDC.
x_maxRight edge in NDC.
row_hRow height in NDC units.

Definition at line 57 of file QueryUtils.cpp.

60{
61 const auto& ws = window->get_state();
62 const auto w = static_cast<uint32_t>(
63 (x_max - x_min) * 0.5F * static_cast<float>(ws.current_width));
64 const auto h = static_cast<uint32_t>(
65 row_h * 0.5F * static_cast<float>(ws.current_height));
66 auto atlas = Text::TypeFaceFoundry::instance().get_default_glyph_atlas();
67 if (!atlas) {
68 error<std::runtime_error>(Journal::Component::Portal, Journal::Context::Runtime,
69 std::source_location::current(),
70 "Failed to get default glyph atlas for row pixel dimension calculation");
71 }
72 const uint32_t min_h = atlas->pixel_size();
73 return { std::max(w, 1U), std::max(h, min_h) };
74}
uint32_t h
Definition InkPress.cpp:28

References MayaFlux::Portal::Text::TypeFaceFoundry::get_default_glyph_atlas(), h, MayaFlux::Portal::Text::TypeFaceFoundry::instance(), MayaFlux::Journal::Portal, and MayaFlux::Journal::Runtime.

Referenced by MayaFlux::Portal::Forma::Inspector::buffer(), MayaFlux::Portal::Forma::Inspector::buffer_manager(), MayaFlux::Portal::Forma::Inspector::event(), MayaFlux::Portal::Forma::Inspector::event_manager(), MayaFlux::Portal::Forma::Inspector::inspect_modulator_tree(), MayaFlux::Portal::Forma::Inspector::inspect_task(), MayaFlux::Portal::Forma::Inspector::node(), MayaFlux::Portal::Forma::Inspector::node_graph_manager(), MayaFlux::Portal::Forma::Inspector::node_network(), MayaFlux::Portal::Forma::Inspector::root_audio_buffer(), MayaFlux::Portal::Forma::Inspector::root_audio_buffer(), MayaFlux::Portal::Forma::Inspector::root_graphics_buffer(), MayaFlux::Portal::Forma::Inspector::root_node(), MayaFlux::Portal::Forma::Inspector::scheduler(), and MayaFlux::Portal::Forma::Inspector::tasks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: