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

◆ process_to_container() [2/2]

std::shared_ptr< Kakshya::TextureCollection > MayaFlux::Yantra::Vision::VisionWorkflow::process_to_container ( const std::vector< std::shared_ptr< Core::VKImage > > &  frames,
Kinesis::Vision::VisionQuery  query,
VisionExtractMode  extract,
Kakshya::TextureCollectionSpec  spec = {} 
)
static

Run query over frames in order and record what extract takes from each into a collection.

Null frames, and frames whose extraction gives no image, add no layer. A width or height of zero in spec takes the first frame's; its byte cap and ring are not used.

Returns
The filled collection, or null when frames holds no image.

Definition at line 574 of file VisionWorkflow.cpp.

579{
580 if (spec.width == 0 || spec.height == 0) {
581 const auto first = std::ranges::find_if(frames, [](const auto& image) { return image != nullptr; });
582 if (first == frames.end()) {
584 "VisionWorkflow::process_to_container: no frames to size the collection from");
585 return nullptr;
586 }
587 spec.width = (*first)->get_width();
588 spec.height = (*first)->get_height();
589 }
590
591 return record_frames(frames.size(),
592 [&frames](size_t i) { return frames[i]; },
593 nullptr, VisionMatrix::create(query, extract), spec);
594}
#define MF_WARN(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:47
static std::shared_ptr< ComputeMatrix > create()
Create a new ComputeMatrix instance.
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.

References MayaFlux::Journal::ComputeMatrix, MayaFlux::Kakshya::TextureCollectionSpec::height, image, MF_WARN, MayaFlux::Kakshya::TextureCollectionSpec::width, and MayaFlux::Journal::Yantra.