|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Path-pattern sink that writes one SVG file per accepted frame. More...
#include <ca-svg.H>
Public Member Functions | |
| Svg_Frame_Sink (std::filesystem::path path_pattern, Palette palette, SVG_Render_Options opts={}, const std::size_t zero_pad=6) | |
| Build an SVG frame sink. | |
| template<typename Lattice > | |
| void | accept (const std::size_t step, const Lattice &frame) |
| Write one SVG frame using the default dead state. | |
| template<typename Lattice > | |
| void | accept (const std::size_t step, const Lattice &frame, const typename Lattice::state_type &dead_state) |
| Write one SVG frame, threading the lattice-specific dead state. | |
Static Public Member Functions | |
| static void | flush () |
| SVG frames are written eagerly; this is a no-op. | |
Private Attributes | |
| std::filesystem::path | pattern_ |
| Palette | palette_ |
| SVG_Render_Options | opts_ {} |
| std::size_t | zero_pad_ = 6 |
Path-pattern sink that writes one SVG file per accepted frame.
| Palette | invocable state_type -> RGB8. |
|
inline |
|
inline |
Write one SVG frame using the default dead state.
Equivalent to calling the (step, frame, dead_state) overload with typename Lattice::state_type{}. Use the explicit overload when opts.omit_dead_cells is true and the lattice's dead state is not the default-constructed value.
| Lattice | 2D lattice type. |
| [in] | step | simulation step. |
| [in] | frame | frame to write. |
| std::runtime_error | on file open or stream write failure. |
| std::filesystem::filesystem_error | if the parent directory cannot be created. |
Definition at line 401 of file ca-svg.H.
References Aleph::CA::Svg_Frame_Sink< Palette >::accept().
Referenced by Aleph::CA::Svg_Frame_Sink< Palette >::accept(), and TEST().
|
inline |
Write one SVG frame, threading the lattice-specific dead state.
Use this overload to ensure opts.omit_dead_cells skips the intended state value rather than the default-constructed one.
| Lattice | 2D lattice type. |
| [in] | step | simulation step. |
| [in] | frame | frame to write. |
| [in] | dead_state | state skipped when opts.omit_dead_cells is true. |
| std::runtime_error | on file open or stream write failure. |
| std::filesystem::filesystem_error | if the parent directory cannot be created. |
Definition at line 420 of file ca-svg.H.
References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::format_step_path(), Aleph::CA::Svg_Frame_Sink< Palette >::opts_, out, Aleph::CA::Svg_Frame_Sink< Palette >::palette_, Aleph::CA::Svg_Frame_Sink< Palette >::pattern_, Aleph::CA::render_lattice_svg(), and Aleph::CA::Svg_Frame_Sink< Palette >::zero_pad_.
|
inlinestatic |
|
private |
Definition at line 368 of file ca-svg.H.
Referenced by Aleph::CA::Svg_Frame_Sink< Palette >::accept().
|
private |
Definition at line 367 of file ca-svg.H.
Referenced by Aleph::CA::Svg_Frame_Sink< Palette >::accept().
|
private |
Definition at line 366 of file ca-svg.H.
Referenced by Aleph::CA::Svg_Frame_Sink< Palette >::accept().
|
private |
Definition at line 369 of file ca-svg.H.
Referenced by Aleph::CA::Svg_Frame_Sink< Palette >::accept().