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

◆ buffer()

InspectResult MayaFlux::Portal::Forma::Inspector::buffer ( const std::shared_ptr< Buffers::Buffer > &  buf,
Surface &  surface,
LayoutCursor &  cursor,
float  x_min = -0.95F,
float  x_max = 0.95F,
float  row_h = 0.05F,
int  depth = 0 
)

Inspect a single Buffer: default processor and full processing chain.

Header is the buffer's dynamic type name. Body rows expose the default processor type, then preprocessor, each indexed chain processor, postprocessor, and final processor. Absent slots show "-".

Definition at line 20 of file BufferQuery.cpp.

25{
26 if (!buf)
27 return {};
28
29 const float ind = x_min + static_cast<float>(depth) * k_inspect_indent;
30 const std::string header_label = Reflect::short_dynamic_type_name(*buf);
31
32 std::vector<EntrySpec> entrys {
33 EntrySpec {
34 .label = "default_proc",
35 .reader = [buf] {
36 auto p = buf->get_default_processor();
37 return p ? std::string(Reflect::short_dynamic_type_name(*p)) : "-";
38 },
39 },
40 };
41
42 auto chain = buf->get_processing_chain();
43 if (chain) {
44 auto pre = chain->get_preprocessor(buf);
45 entrys.push_back(EntrySpec {
46 .label = "pre",
47 .reader = [pre] {
48 return pre ? std::string(Reflect::short_dynamic_type_name(*pre)) : "-";
49 },
50 });
51
52 const auto& processors = chain->get_processors(buf);
53 for (size_t i = 0; i < processors.size(); ++i) {
54 auto p = processors[i];
55 entrys.push_back(EntrySpec {
56 .label = "chain[" + std::to_string(i) + "]",
57 .reader = [p] {
58 return p ? std::string(Reflect::short_dynamic_type_name(*p)) : "-";
59 },
60 });
61 }
62
63 auto post = chain->get_postprocessor(buf);
64 entrys.push_back(EntrySpec {
65 .label = "post",
66 .reader = [post] {
67 return post ? std::string(Reflect::short_dynamic_type_name(*post)) : "-";
68 },
69 });
70
71 auto final_p = chain->get_final_processor(buf);
72 entrys.push_back(EntrySpec {
73 .label = "final",
74 .reader = [final_p] {
75 return final_p ? std::string(Reflect::short_dynamic_type_name(*final_p)) : "-";
76 },
77 });
78 }
79
80 auto hbuf = make_header_buffer(surface.window());
81 auto rbufs = make_row_buffers(surface.window(), entrys.size());
82 auto group = make_entry_group(entrys, header_label, std::move(hbuf), rbufs,
83 surface, cursor, ind, x_max, row_h, false);
84
85 InspectResult result;
86 result.group = std::move(group);
87 return result;
88}
BufferProcessingChain * chain
uint32_t depth
std::shared_ptr< Buffers::FormaBuffer > make_header_buffer(const std::shared_ptr< Core::Window > &window) const
A "text"-slotted buffer, registered with the BufferManager.
Definition Inspector.cpp:11
std::vector< EntryBuffer > make_row_buffers(const std::shared_ptr< Core::Window > &window, size_t count) const
count row targets, slices of one "text"-slotted buffer, for make_entry_group's rows.
Definition Inspector.cpp:24
EntryGroup make_entry_group(std::span< const EntrySpec > entrys, std::string_view header_label, FormaTarget header_buf, std::span< const EntryBuffer > row_bufs, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h, bool initially_open)
Construct a collapsible header followed by N entry rows under it.
Definition Entry.cpp:104
constexpr float k_inspect_indent
std::string short_dynamic_type_name(const T &obj) noexcept
Returns the unqualified dynamic type name of obj.
Definition TypeInfo.hpp:95

References chain, depth, MayaFlux::Portal::Forma::InspectResult::group, MayaFlux::Portal::Forma::k_inspect_indent, MayaFlux::Portal::Forma::EntrySpec::label, MayaFlux::Portal::Forma::make_entry_group(), make_header_buffer(), make_row_buffers(), MayaFlux::Reflect::short_dynamic_type_name(), and MayaFlux::Portal::Forma::Surface::window().

Referenced by MayaFlux::Portal::Forma::inspect().

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