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

◆ get_frames_typed_as()

template<typename T >
template void MayaFlux::Kakshya::VideoStreamContainer::get_frames_typed_as< float > ( std::span< T >  output,
uint64_t  start_frame,
uint64_t  num_frames 
) const
private

Definition at line 621 of file VideoStreamContainer.cpp.

623{
624 const size_t elements_per_frame = get_frame_element_count();
625 const size_t required = static_cast<size_t>(num_frames) * elements_per_frame;
626
627 if (output.size() < required) {
628 error<std::runtime_error>(
631 std::source_location::current(),
632 "VideoStreamContainer::get_frames_typed_as: output buffer too small ({} < {})",
633 output.size(), required);
634 }
635
636 const size_t frame_bytes = get_frame_byte_size();
637
638 for (uint64_t i = 0; i < num_frames; ++i) {
639 auto bytes = get_frame_pixels(start_frame + i);
640 if (bytes.size() < frame_bytes)
641 continue;
642 std::memcpy(output.data() + i * elements_per_frame, bytes.data(), frame_bytes);
643 }
644}
std::shared_ptr< Core::VKImage > output
size_t get_frame_element_count() const
Elements in one frame: width * height * channels.
std::span< const uint8_t > get_frame_pixels(uint64_t frame_index) const
Get raw pixel data for a single frame as a byte span.
size_t get_frame_byte_size() const
Total byte size of one frame: width * height * bytes_per_pixel.
@ Runtime
General runtime operations (default fallback)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References get_frame_byte_size(), get_frame_element_count(), get_frame_pixels(), MayaFlux::Journal::Kakshya, output, and MayaFlux::Journal::Runtime.

Referenced by get_frames_impl().

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