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

◆ get_frames_typed()

void MayaFlux::Kakshya::WindowContainer::get_frames_typed ( std::span< uint8_t >  output,
uint64_t  start_frame,
uint64_t  num_frames 
) const
private

Definition at line 707 of file WindowContainer.cpp.

708{
710 const uint64_t h = m_structure.get_height();
711 if (start_frame >= h || output.empty() || m_processed_data.empty()) {
712 std::ranges::fill(output, uint8_t { 0 });
713 return;
714 }
715
716 const auto* pixels = std::get_if<std::vector<uint8_t>>(&m_processed_data[0]);
717 if (!pixels || pixels->empty()) {
718 std::ranges::fill(output, uint8_t { 0 });
719 return;
720 }
721
722 const uint64_t row_elems = m_structure.get_width() * m_structure.get_channel_count();
723 const uint64_t frames_to_copy = std::min(num_frames, h - start_frame);
724 const uint64_t elems_to_copy = std::min(frames_to_copy * row_elems, static_cast<uint64_t>(output.size()));
725 const uint64_t src_offset = start_frame * row_elems;
726
727 std::copy_n(pixels->begin() + static_cast<std::ptrdiff_t>(src_offset),
728 static_cast<std::ptrdiff_t>(elems_to_copy),
729 output.begin());
730
731 if (elems_to_copy < output.size())
732 std::fill(output.begin() + static_cast<std::ptrdiff_t>(elems_to_copy), output.end(), uint8_t { 0 });
733 });
734}
const std::vector< float > * pixels
Definition Decoder.cpp:48
uint32_t h
Definition InkPress.cpp:29
std::vector< DataVariant > m_processed_data
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
static uint64_t get_height(const std::vector< DataDimension > &dimensions)
Extract height from image/video dimensions.
static uint64_t get_channel_count(const std::vector< DataDimension > &dimensions)
Extract channel count from dimensions.
static uint64_t get_width(const std::vector< DataDimension > &dimensions)
Extract width from image/video dimensions.

References MayaFlux::Kakshya::ContainerDataStructure::get_channel_count(), MayaFlux::Kakshya::ContainerDataStructure::get_height(), MayaFlux::Kakshya::ContainerDataStructure::get_width(), h, m_data_lock, m_processed_data, m_structure, and pixels.

Referenced by get_frames_impl().

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