MayaFlux 1.0.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< DataVariant >.

Definition at line 158 of file WindowContainer.cpp.

159{
160 std::vector<DataVariant> result;
161
163 if (m_processed_data.empty())
164 return;
165 const auto* src = std::get_if<std::vector<uint8_t>>(&m_processed_data[0]);
166 if (!src || src->empty())
167 return;
168
169 const std::span<const uint8_t> src_span { src->data(), src->size() };
170 const auto& dims = m_structure.dimensions;
171
172 for (const auto& [name, group] : m_region_groups) {
173 for (const auto& r : group.regions) {
174 if (!regions_intersect(r, region))
175 continue;
176 try {
177 result.emplace_back(extract_nd_region<uint8_t>(src_span, r, dims));
178 } catch (const std::exception& e) {
180 "WindowContainer::get_region_data extraction failed : {}", e.what());
181 }
182 }
183 }
184 });
185 return result;
186}
#define MF_WARN(comp, ctx,...)
const uint32_t * src
std::string name
Definition VKDevice.cpp:123
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:268

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

+ Here is the call graph for this function: