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

◆ get_region_data()

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

Get data for a specific region.

Parameters
regionThe region to extract data from
Returns
std::vector<DataVariant> containing the region's data

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 288 of file VideoStreamContainer.cpp.

289{
290 std::shared_lock lock(m_data_mutex);
291
292 if (m_data.empty())
293 return {};
294
295 const auto* pixels = std::get_if<std::vector<uint8_t>>(&m_data[0]);
296 if (!pixels || pixels->empty())
297 return {};
298
299 const std::span<const uint8_t> src { pixels->data(), pixels->size() };
300
301 try {
302 return { extract_nd_region<uint8_t>(src, region, m_structure.dimensions) };
303 } catch (const std::exception& e) {
305 "VideoStreamContainer::get_region_data extraction failed — {}", e.what());
306 return {};
307 }
308}
#define MF_WARN(comp, ctx,...)
void lock() override
Acquire a lock for thread-safe access.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Kakshya::ContainerDataStructure::dimensions, MayaFlux::Journal::Kakshya, lock(), m_data, m_data_mutex, m_structure, and MF_WARN.

+ Here is the call graph for this function: