Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Gif_Frame_Sink< Mapper > Class Template Reference

Sink that buffers frames and writes an animated GIF on flush. More...

#include <ca-gif.H>

Collaboration diagram for Aleph::CA::Gif_Frame_Sink< Mapper >:
[legend]

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_
 

Detailed Description

template<typename Mapper>
class Aleph::CA::Gif_Frame_Sink< Mapper >

Sink that buffers frames and writes an animated GIF on flush.

Template Parameters
Mapperinvocable state_type -> RGB8.

Definition at line 336 of file ca-gif.H.

Constructor & Destructor Documentation

◆ Gif_Frame_Sink()

template<typename Mapper >
Aleph::CA::Gif_Frame_Sink< Mapper >::Gif_Frame_Sink ( std::filesystem::path  path,
Mapper  mapper,
GIF_Write_Options  opts = {} 
)
inline

Build a GIF frame sink.

Parameters
[in]pathoutput GIF path.
[in]mapperstate-to-RGB mapper.
[in]optsGIF options.

Definition at line 349 of file ca-gif.H.

Member Function Documentation

◆ accept()

template<typename Mapper >
template<typename Lattice >
void Aleph::CA::Gif_Frame_Sink< Mapper >::accept ( const std::size_t  step,
const Lattice &  frame 
)
inline

◆ flush()

template<typename Mapper >
void Aleph::CA::Gif_Frame_Sink< Mapper >::flush ( ) const
inline

Write the animated GIF.

Exceptions
std::runtime_erroron 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().

◆ size()

template<typename Mapper >
std::size_t Aleph::CA::Gif_Frame_Sink< Mapper >::size ( ) const
inlinenoexcept

Return buffered frame count.

Returns
number of collected frames.

Definition at line 395 of file ca-gif.H.

References Aleph::Array< T >::size().

Member Data Documentation

◆ frames_

Definition at line 341 of file ca-gif.H.

◆ mapper_

template<typename Mapper >
Mapper Aleph::CA::Gif_Frame_Sink< Mapper >::mapper_
private

Definition at line 339 of file ca-gif.H.

Referenced by Aleph::CA::Gif_Frame_Sink< Mapper >::accept().

◆ opts_

Definition at line 340 of file ca-gif.H.

◆ path_

template<typename Mapper >
std::filesystem::path Aleph::CA::Gif_Frame_Sink< Mapper >::path_
private

Definition at line 338 of file ca-gif.H.


The documentation for this class was generated from the following file: