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

◆ write_snapshot()

bool MayaFlux::IO::RelaxationGridCapture::write_snapshot ( std::span< const uint8_t >  bytes)

Write one snapshot as a sample, if currently capturing.

Parameters
bytesOne generation's raw cell state, exactly what the caller's own snapshot_source() listener received.
Returns
True if not currently capturing (a no-op still succeeds) or the sample was written; false if to_attributes() or SpatialCache::write() fails.

Definition at line 204 of file SpatialTransfer.cpp.

205{
206 if (!m_cache) {
207 return true;
208 }
209
210 return m_cache->write(m_stream_name,
211 SpatialSample {
213 .positions = m_positions,
214 .ids = m_ids,
215 .attributes = m_to_attributes(bytes) });
216}
std::shared_ptr< SpatialCache > m_cache

References m_cache, m_ids, m_positions, m_stream_name, m_to_attributes, MayaFlux::Portal::Graphics::POINT_LIST, and MayaFlux::IO::SpatialSample::topology.