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

◆ get_frames()

void MayaFlux::Kakshya::TextureContainer::get_frames ( std::span< double >  output,
uint64_t  start_frame,
uint64_t  num_frames 
) const
overridevirtual

Copy a range of pixel rows into output as normalized doubles.

Rows [start_frame, start_frame + num_frames) are written sequentially. Each uint8_t sample is normalized to [0.0, 1.0]. Rows beyond the image height are skipped silently.

Parameters
outputDestination buffer. Must hold at least num_frames * width * channels doubles.
start_frameFirst row index.
num_framesNumber of rows to copy.

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 469 of file TextureContainer.cpp.

471{
472 std::shared_lock lock(m_data_mutex);
473 if (m_data.empty())
474 return;
475
476 const size_t row_elems = static_cast<size_t>(m_width) * m_channels;
477 size_t out_idx = 0;
478
479 for (uint64_t r = start_frame; r < start_frame + num_frames && r < m_height; ++r) {
480 const size_t offset = static_cast<size_t>(r) * row_elems;
481 for (size_t i = 0; i < row_elems && out_idx < output.size(); ++i, ++out_idx)
482 output[out_idx] = read_normalized_at(m_data[0], m_format, offset + i);
483 }
484}
void lock() override
Acquire a lock for thread-safe access.
Portal::Graphics::ImageFormat m_format