MayaFlux 0.5.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 739 of file WindowContainer.cpp.

740{
742 const uint64_t h = m_structure.get_height();
743 if (start_frame >= h || output.empty() || m_processed_data.empty()) {
744 std::ranges::fill(output, uint8_t { 0 });
745 return;
746 }
747
748 const auto* pixels = std::get_if<std::vector<uint8_t>>(&m_processed_data[0]);
749 if (!pixels || pixels->empty()) {
750 std::ranges::fill(output, uint8_t { 0 });
751 return;
752 }
753
754 const uint64_t row_elems = m_structure.get_width() * m_structure.get_channel_count();
755 const uint64_t frames_to_copy = std::min(num_frames, h - start_frame);
756 const uint64_t elems_to_copy = std::min(frames_to_copy * row_elems, static_cast<uint64_t>(output.size()));
757 const uint64_t src_offset = start_frame * row_elems;
758
759 std::copy_n(pixels->begin() + static_cast<std::ptrdiff_t>(src_offset),
760 static_cast<std::ptrdiff_t>(elems_to_copy),
761 output.begin());
762
763 if (elems_to_copy < output.size())
764 std::fill(output.begin() + static_cast<std::ptrdiff_t>(elems_to_copy), output.end(), uint8_t { 0 });
765 });
766}
const std::vector< float > * pixels
Definition Decoder.cpp:65
uint32_t h
Definition InkPress.cpp:28
std::shared_ptr< Core::VKImage > output
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:222
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, output, and pixels.

Referenced by get_frames_impl().

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