|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
Records time-sampled cell state from a RelaxationGridBuffer into an Alembic archive. More...
#include <SpatialTransfer.hpp>
Collaboration diagram for MayaFlux::IO::RelaxationGridCapture:Public Types | |
| using | ToAttributes = std::function< std::vector< SpatialAttribute >(std::span< const uint8_t >)> |
Public Member Functions | |
| bool | is_capturing () const |
| RelaxationGridCapture & | operator= (const RelaxationGridCapture &)=delete |
| RelaxationGridCapture & | operator= (RelaxationGridCapture &&)=delete |
| RelaxationGridCapture (const RelaxationGridCapture &)=delete | |
| RelaxationGridCapture (RelaxationGridCapture &&)=delete | |
| RelaxationGridCapture (std::shared_ptr< Buffers::RelaxationGridBuffer > grid, std::string stream_name, float extent, ToAttributes to_attributes) | |
| bool | start (const std::string &filepath) |
| Open the archive. | |
| void | stop () |
| Close the archive. | |
| bool | write_snapshot (std::span< const uint8_t > bytes) |
| Write one snapshot as a sample, if currently capturing. | |
| ~RelaxationGridCapture () | |
Private Attributes | |
| std::shared_ptr< SpatialCache > | m_cache |
| std::shared_ptr< Buffers::RelaxationGridBuffer > | m_grid |
| std::vector< uint64_t > | m_ids |
| std::vector< glm::vec3 > | m_positions |
| std::string | m_stream_name |
| ToAttributes | m_to_attributes |
Records time-sampled cell state from a RelaxationGridBuffer into an Alembic archive.
RelaxationGridBuffer::snapshot_source() is a single-consumer BroadcastSource (its own doc: one coroutine per instance, a second listener silently displaces the first), so this class does not subscribe to it itself and never will: the caller keeps whatever Kriya::on_signal(grid->snapshot_source(), ...) listener it already has and calls write_snapshot() from inside that same callback. This also keeps RelaxationGridBuffer itself untouched; everything here works from its existing public accessors.
Positions and ids are fixed at construction via relaxation_grid_positions() and reused for every sample, matching that function's own guidance. Per-cell state format is rule-defined (a float, a uint32 automaton state, a vec2 reaction-diffusion pair, ...), so the caller supplies the one genuinely rule-specific piece: how to turn a snapshot's raw bytes into named attributes.
Definition at line 162 of file SpatialTransfer.hpp.