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

◆ get_value_impl()

void MayaFlux::Kakshya::TextureContainer::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< DataVariant >.

Definition at line 1089 of file TextureContainer.cpp.

1093{
1094 if (coords.empty() || m_data.empty())
1095 return;
1096
1097 const size_t layer = (m_data.size() > 1) ? static_cast<size_t>(coords[0]) : 0;
1098 if (layer >= m_data.size() || coords.size() < (m_data.size() > 1 ? 4U : 3U))
1099 return;
1100
1101 ensure_cpu(static_cast<uint32_t>(layer));
1102
1103 const size_t co = (m_data.size() > 1) ? 1 : 0;
1104 const size_t idx = (coords[co] * m_width + coords[co + 1]) * m_channels + coords[co + 2];
1105
1106 seqlock_read_void(m_slot_locks[layer], 8, [&] {
1107 std::visit([&](const auto& vec) {
1108 using T = typename std::decay_t<decltype(vec)>::value_type;
1109 if (type != typeid(T) || idx >= vec.size())
1110 return;
1111 *static_cast<T*>(out) = vec[idx];
1112 },
1113 m_data[layer]);
1114 });
1115}
std::vector< float > * out
std::vector< glm::ivec3 > coords
Definition VDBWriter.cpp:25
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
void ensure_cpu(uint32_t layer) const
Download a GPU-held layer into m_data before a CPU read.
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

References coords, ensure_cpu(), m_channels, m_data, m_slot_locks, m_width, out, and type.

+ Here is the call graph for this function: