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

◆ get_value_impl()

void MayaFlux::Kakshya::VideoStreamContainer::get_value_impl ( const std::vector< uint64_t > &  coords,
void *  out,
const std::type_info &  type 
) const
overrideprotectedvirtual

Type-erased single-element read.

Implementations copy the native element at coords into out if type matches their native type, otherwise no-op. out points to a caller-owned buffer of exactly sizeof(native type) bytes.

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 634 of file VideoStreamContainer.cpp.

638{
639 if (type != typeid(uint8_t) || coords.size() < 4)
640 return;
641
642 const uint64_t frame = coords[0];
643 const uint64_t y = coords[1];
644 const uint64_t x = coords[2];
645 const uint64_t c = coords[3];
646
647 if (frame >= m_num_frames || y >= m_height || x >= m_width || c >= m_channels)
648 return;
649
650 auto pixels = get_frame_pixels(frame);
651 if (pixels.empty())
652 return;
653
654 const size_t idx = (y * m_width + x) * m_channels + c;
655 if (idx >= pixels.size())
656 return;
657
658 *static_cast<uint8_t*>(out) = pixels[idx];
659}
const std::vector< float > * pixels
Definition Decoder.cpp:65
std::span< const uint8_t > get_frame_pixels(uint64_t frame_index) const
Get raw pixel data for a single frame as uint8_t span.

References get_frame_pixels(), m_channels, m_height, m_num_frames, m_width, and pixels.

+ Here is the call graph for this function: