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

Dependency-free PNG frame sink for cellular automata. More...

#include <array>
#include <concepts>
#include <cstdint>
#include <filesystem>
#include <fstream>
#include <ostream>
#include <string>
#include <ah-errors.H>
#include <tpl_array.H>
#include <ca-frame-stream.H>
#include <ca-io.H>
#include <tpl_ca_concepts.H>
Include dependency graph for ca-png.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::CA::Png_Frame_Sink< Mapper >
 Path-pattern sink that writes one PNG file per accepted frame. More...
 

Namespaces

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

Functions

void Aleph::CA::ca_png_detail::append_be32 (Array< std::uint8_t > &out, const std::uint32_t value)
 
void Aleph::CA::ca_png_detail::write_be32 (std::ostream &out, const std::uint32_t value)
 
std::uint32_t Aleph::CA::ca_png_detail::crc32 (const std::uint8_t *data, const std::size_t n)
 
std::uint32_t Aleph::CA::ca_png_detail::adler32 (const Array< std::uint8_t > &data)
 
Array< std::uint8_t > Aleph::CA::ca_png_detail::zlib_store (const Array< std::uint8_t > &raw)
 
void Aleph::CA::ca_png_detail::write_chunk (std::ostream &out, const char type[4], const Array< std::uint8_t > &payload)
 
template<typename Lattice , typename Mapper >
requires requires(Mapper &&m, const typename Lattice::state_type &v) { { m(v) } -> std::convertible_to<RGB8>; }
void Aleph::CA::write_png (std::ostream &out, const Lattice &frame, Mapper &&mapper)
 Write a rank-2 frame as an 8-bit RGB PNG image.
 
template<typename Lattice >
void Aleph::CA::write_png (std::ostream &out, const Lattice &frame)
 Write a frame as PNG using the default binary RGB mapper.
 
template<typename Mapper >
 Aleph::CA::Png_Frame_Sink (std::filesystem::path, Mapper, std::size_t=6) -> Png_Frame_Sink< Mapper >
 

Detailed Description

Dependency-free PNG frame sink for cellular automata.

The writer emits standards-compliant 8-bit RGB PNG files using PNG filter type 0 and zlib stored blocks. This keeps the backend header-only and avoids a build-time dependency while still producing files accepted by browsers, image viewers and scientific notebooks.

Author
Leandro Rabindranath Leon

Definition in file ca-png.H.