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

Path-pattern sink that writes one PNG file per accepted frame. More...

#include <ca-png.H>

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

Public Member Functions

 Png_Frame_Sink (std::filesystem::path path_pattern, Mapper mapper, const std::size_t zero_pad=6)
 Build a PNG frame sink.
 
template<typename Lattice >
void accept (const std::size_t step, const Lattice &frame)
 Write one PNG frame.
 

Static Public Member Functions

static void flush ()
 PNG frames are written eagerly; this is a no-op.
 

Private Attributes

std::filesystem::path pattern_
 
Mapper mapper_
 
std::size_t zero_pad_ = 6
 

Detailed Description

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

Path-pattern sink that writes one PNG file per accepted frame.

The path pattern may contain {step} or {}; the placeholder is replaced with a zero-padded step number. Parent directories are created lazily before each write.

Template Parameters
Mapperinvocable state_type -> RGB8.

Definition at line 240 of file ca-png.H.

Constructor & Destructor Documentation

◆ Png_Frame_Sink()

template<typename Mapper >
Aleph::CA::Png_Frame_Sink< Mapper >::Png_Frame_Sink ( std::filesystem::path  path_pattern,
Mapper  mapper,
const std::size_t  zero_pad = 6 
)
inline

Build a PNG frame sink.

Parameters
[in]path_patternoutput path pattern.
[in]mapperstate-to-RGB mapper.
[in]zero_padminimum width for {step}.

Definition at line 252 of file ca-png.H.

Member Function Documentation

◆ accept()

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

◆ flush()

template<typename Mapper >
static void Aleph::CA::Png_Frame_Sink< Mapper >::flush ( )
inlinestatic

PNG frames are written eagerly; this is a no-op.

Definition at line 273 of file ca-png.H.

Member Data Documentation

◆ mapper_

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

Definition at line 243 of file ca-png.H.

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

◆ pattern_

template<typename Mapper >
std::filesystem::path Aleph::CA::Png_Frame_Sink< Mapper >::pattern_
private

Definition at line 242 of file ca-png.H.

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

◆ zero_pad_

template<typename Mapper >
std::size_t Aleph::CA::Png_Frame_Sink< Mapper >::zero_pad_ = 6
private

Definition at line 244 of file ca-png.H.

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


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