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

◆ get_region_data()

std::vector< DataVariant > MayaFlux::Kakshya::WindowContainer::get_region_data ( const Region region) const
overridevirtual

Extract data for all regions across all region groups that spatially intersect region.

Crops from the last full-surface readback — no GPU work. Returns empty if no readback has been performed yet.

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 153 of file WindowContainer.cpp.

154{
155 std::vector<DataVariant> result;
156
158 if (m_processed_data.empty())
159 return;
160 const auto* src = std::get_if<std::vector<uint8_t>>(&m_processed_data[0]);
161 if (!src || src->empty())
162 return;
163
164 const std::span<const uint8_t> src_span { src->data(), src->size() };
165 const auto& dims = m_structure.dimensions;
166
167 for (const auto& [name, group] : m_region_groups) {
168 for (const auto& r : group.regions) {
169 if (!regions_intersect(r, region))
170 continue;
171 try {
172 result.emplace_back(extract_nd_region<uint8_t>(src_span, r, dims));
173 } catch (const std::exception& e) {
175 "WindowContainer::get_region_data extraction failed : {}", e.what());
176 }
177 }
178 }
179 });
180 return result;
181}
#define MF_WARN(comp, ctx,...)
std::vector< DataVariant > m_processed_data
std::unordered_map< std::string, RegionGroup > m_region_groups
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
bool regions_intersect(const Region &r1, const Region &r2) noexcept
Test whether two N-dimensional regions overlap on every shared axis.
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
Definition SeqLock.hpp:222

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Kakshya::ContainerDataStructure::dimensions, MayaFlux::Journal::Kakshya, m_data_lock, m_processed_data, m_region_groups, m_structure, MF_WARN, and MayaFlux::Kakshya::regions_intersect().

+ Here is the call graph for this function: