Type-erased single-element write.
Implementations copy from in into their storage at coords if type matches their native type, otherwise no-op. in points to a caller-owned buffer of exactly sizeof(native type) bytes.
Implements MayaFlux::Kakshya::NDDataContainer.
Definition at line 1097 of file TextureContainer.cpp.
1101{
1102 if (coords.empty() ||
m_data.empty())
1103 return;
1104
1105 const size_t layer = (
m_data.size() > 1) ?
static_cast<size_t>(coords[0]) : 0;
1106 if (layer >=
m_data.size() || coords.size() < (
m_data.size() > 1 ? 4U : 3U))
1107 return;
1108
1109 const size_t co = (
m_data.size() > 1) ? 1 : 0;
1110 const size_t idx = (coords[co] *
m_width + coords[co + 1]) *
m_channels + coords[co + 2];
1111
1113 std::visit([&](auto& vec) {
1114 using T =
typename std::decay_t<
decltype(vec)>::value_type;
1115 if (type != typeid(T) || idx >= vec.size())
1116 return;
1117 vec[idx] = *
static_cast<const T*
>(in);
1118 },
1120}
Memory::SeqlockArray m_slot_locks
std::vector< DataVariant > m_data