Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca-ascii.H File Reference

Terminal and golden-test renderers for CA frames. More...

#include <concepts>
#include <cstddef>
#include <ostream>
#include <sstream>
#include <string>
#include <utility>
#include <ah-errors.H>
#include <ca-io.H>
#include <tpl_ca_concepts.H>
Include dependency graph for ca-ascii.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::CA::Ascii_Render_Options
 Options for textual CA rendering. More...
 
struct  Aleph::CA::Binary_ASCII_Palette< State >
 Default binary text palette. More...
 
struct  Aleph::CA::Binary_ANSI24_Palette< State >
 ANSI 24-bit colour palette for binary frames. More...
 
class  Aleph::CA::Ascii_Frame_Sink< Palette >
 Stream sink that writes textual frames to an output stream. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::CA
 

Functions

template<typename Lattice , typename Palette >
requires requires(Palette &&p, const typename Lattice::state_type &v) { { p(v) } -> std::convertible_to<std::string>; }
void Aleph::CA::render_ascii (std::ostream &out, const Lattice &frame, Palette &&palette, const Ascii_Render_Options &opts={})
 Render a rank-2 frame as text.
 
template<typename Lattice , typename Palette >
requires requires(Palette &&p, const typename Lattice::state_type &v) { { p(v) } -> std::convertible_to<std::string>; }
std::string Aleph::CA::render_ascii_string (const Lattice &frame, Palette &&palette, const Ascii_Render_Options &opts={})
 Return the text rendering of a rank-2 frame.
 
template<typename Lattice >
void Aleph::CA::render_ascii (std::ostream &out, const Lattice &frame, const Ascii_Render_Options &opts={})
 Render using the default binary ASCII palette.
 
template<typename Lattice >
std::string Aleph::CA::render_ascii_string (const Lattice &frame, const Ascii_Render_Options &opts={})
 Return a default binary ASCII rendering.
 
template<typename Palette >
 Aleph::CA::Ascii_Frame_Sink (std::ostream &, Palette, Ascii_Render_Options={}, bool=true) -> Ascii_Frame_Sink< Palette >
 

Detailed Description

Terminal and golden-test renderers for CA frames.

Provides a small textual renderer that is useful in CI, logs and examples that must work without a display server. ANSI escape output is opt-in through user palettes; the default binary palette is plain ASCII so snapshots remain portable.

Author
Leandro Rabindranath Leon

Definition in file ca-ascii.H.