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

◆ get_value_impl()

void MayaFlux::Kakshya::WindowContainer::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 768 of file WindowContainer.cpp.

772{
773 if (type != typeid(uint8_t) || coords.size() < 3)
774 return;
775
776 const uint64_t w = m_structure.get_width();
777 const uint64_t c = m_structure.get_channel_count();
778 const uint64_t idx = (coords[0] * w + coords[1]) * c + coords[2];
779
781 if (m_processed_data.empty())
782 return;
783 const auto* pixels = std::get_if<std::vector<uint8_t>>(&m_processed_data[0]);
784 if (!pixels || idx >= pixels->size())
785 return;
786 *static_cast<uint8_t*>(out) = (*pixels)[idx];
787 });
788}
const std::vector< float > * pixels
Definition Decoder.cpp:65
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_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 pixels.