|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Sink that buffers frames and writes an animated GIF on flush. More...
#include <ca-gif.H>
Public Member Functions | |
| Gif_Frame_Sink (std::filesystem::path path, Mapper mapper, GIF_Write_Options opts={}) | |
| Build a GIF frame sink. | |
| template<typename Lattice > | |
| void | accept (const std::size_t step, const Lattice &frame) |
| Collect one frame. | |
| void | flush () const |
| Write the animated GIF. | |
| std::size_t | size () const noexcept |
| Return buffered frame count. | |
Private Attributes | |
| std::filesystem::path | path_ |
| Mapper | mapper_ |
| GIF_Write_Options | opts_ {} |
| Array< ca_gif_detail::Frame > | frames_ |
Sink that buffers frames and writes an animated GIF on flush.
| Mapper | invocable state_type -> RGB8. |
|
inline |
|
inline |
Collect one frame.
| Lattice | rank-2 lattice type. |
| [in] | step | simulation step, accepted for interface symmetry. |
| [in] | frame | frame to collect. |
Definition at line 359 of file ca-gif.H.
References Aleph::CA::Lattice< Storage, Boundary >::at(), Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::ca_gif_detail::Frame::height, Aleph::CA::Gif_Frame_Sink< Mapper >::mapper_, Aleph::CA::ca_gif_detail::Frame::pixels, r, Aleph::CA::Lattice< Storage, Boundary >::rank, Aleph::CA::Lattice< Storage, Boundary >::size(), and Aleph::CA::ca_gif_detail::Frame::width.
Referenced by TEST().
|
inline |
Write the animated GIF.
| std::runtime_error | on file or stream failure. |
Definition at line 383 of file ca-gif.H.
References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), out, and Aleph::CA::write_gif().
|
inlinenoexcept |
Return buffered frame count.
Definition at line 395 of file ca-gif.H.
References Aleph::Array< T >::size().
|
private |
|
private |
Definition at line 339 of file ca-gif.H.
Referenced by Aleph::CA::Gif_Frame_Sink< Mapper >::accept().
|
private |
|
private |