|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Sink that writes a self-contained HTML playback file. More...
#include <ca-html-player.H>
Public Member Functions | |
| HTML_Player_Frame_Sink (std::filesystem::path path, Mapper mapper, HTML_Player_Options opts={}) | |
| Build an HTML player sink. | |
| template<typename Lattice > | |
| void | accept (const std::size_t step, const Lattice &frame) |
| Append one frame to the embedded trajectory. | |
| void | flush () const |
| Write the final self-contained HTML file. | |
| std::size_t | size () const noexcept |
| Return collected frame count. | |
Private Attributes | |
| std::filesystem::path | path_ |
| Mapper | mapper_ |
| HTML_Player_Options | opts_ {} |
| Array< ca_html_detail::Frame > | frames_ |
Sink that writes a self-contained HTML playback file.
| Mapper | invocable state_type -> RGB8. |
Definition at line 133 of file ca-html-player.H.
|
inline |
Build an HTML player sink.
| [in] | path | output .html file. |
| [in] | mapper | state-to-RGB mapper. |
| [in] | opts | player options. |
Definition at line 146 of file ca-html-player.H.
|
inline |
Append one frame to the embedded trajectory.
| Lattice | rank-2 lattice type. |
| [in] | step | simulation step. |
| [in] | frame | frame to collect. |
Definition at line 158 of file ca-html-player.H.
References Aleph::CA::Lattice< Storage, Boundary >::at(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::HTML_Player_Frame_Sink< Mapper >::frames_, Aleph::CA::ca_html_detail::Frame::height, Aleph::CA::HTML_Player_Frame_Sink< Mapper >::mapper_, Aleph::CA::ca_html_detail::Frame::pixels, r, Aleph::CA::Lattice< Storage, Boundary >::rank, Aleph::CA::Lattice< Storage, Boundary >::size(), Aleph::CA::ca_html_detail::Frame::step, and Aleph::CA::ca_html_detail::Frame::width.
Referenced by TEST().
|
inline |
Write the final self-contained HTML file.
| std::runtime_error | on file or stream failure. |
Definition at line 179 of file ca-html-player.H.
References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::HTML_Player_Options::cell_size, Aleph::CA::HTML_Player_Options::fps, Aleph::CA::HTML_Player_Frame_Sink< Mapper >::frames_, Aleph::CA::ca_html_detail::html_escape(), Aleph::CA::HTML_Player_Frame_Sink< Mapper >::opts_, out, Aleph::CA::HTML_Player_Frame_Sink< Mapper >::path_, Aleph::CA::HTML_Player_Options::show_grid, Aleph::CA::HTML_Player_Options::title, and Aleph::CA::ca_html_detail::write_frame_json().
|
inlinenoexcept |
Return collected frame count.
Definition at line 217 of file ca-html-player.H.
|
private |
Definition at line 138 of file ca-html-player.H.
Referenced by Aleph::CA::HTML_Player_Frame_Sink< Mapper >::accept(), and Aleph::CA::HTML_Player_Frame_Sink< Mapper >::flush().
|
private |
Definition at line 136 of file ca-html-player.H.
Referenced by Aleph::CA::HTML_Player_Frame_Sink< Mapper >::accept().
|
private |
Definition at line 137 of file ca-html-player.H.
Referenced by Aleph::CA::HTML_Player_Frame_Sink< Mapper >::flush().
|
private |
Definition at line 135 of file ca-html-player.H.
Referenced by Aleph::CA::HTML_Player_Frame_Sink< Mapper >::flush().