Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Binary_Cell_Pattern Struct Reference

Binary pattern shared by RLE, plaintext and Life formats. More...

#include <ca-io.H>

Collaboration diagram for Aleph::CA::Binary_Cell_Pattern:
[legend]

Public Attributes

ca_size_t width = 0
 number of columns
 
ca_size_t height = 0
 number of rows
 
ca_index_t origin_row = 0
 original row offset before normalisation
 
ca_index_t origin_col = 0
 original column offset before normalisation
 
std::string rule
 optional rule string, e.g. B3/S23
 
std::string name
 optional pattern name
 
Array< std::string > comments
 format comments without marker prefixes
 
Array< Coord_Vec< 2 > > alive
 live cells as {row, col}
 

Detailed Description

Binary pattern shared by RLE, plaintext and Life formats.

Coordinates in alive are normalised to the pattern rectangle: {0,0} is the top-left cell, height counts rows and width counts columns. origin_row / origin_col preserve the source coordinate origin for Life 1.05 / 1.06 files, whose coordinates may be negative.

Complexity
O(number of live cells) storage.

Definition at line 103 of file ca-io.H.

Member Data Documentation

◆ alive

Array<Coord_Vec<2> > Aleph::CA::Binary_Cell_Pattern::alive

◆ comments

Array<std::string> Aleph::CA::Binary_Cell_Pattern::comments

format comments without marker prefixes

Definition at line 111 of file ca-io.H.

Referenced by Aleph::CA::read_life_105(), Aleph::CA::read_life_106(), Aleph::CA::read_plaintext(), Aleph::CA::read_rle(), and TEST().

◆ height

ca_size_t Aleph::CA::Binary_Cell_Pattern::height = 0

◆ name

std::string Aleph::CA::Binary_Cell_Pattern::name

optional pattern name

Definition at line 110 of file ca-io.H.

Referenced by Aleph::CA::read_rle(), and TEST().

◆ origin_col

ca_index_t Aleph::CA::Binary_Cell_Pattern::origin_col = 0

original column offset before normalisation

Definition at line 108 of file ca-io.H.

Referenced by Aleph::CA::ca_io_detail::finalise_absolute_pattern(), TEST(), and TEST().

◆ origin_row

ca_index_t Aleph::CA::Binary_Cell_Pattern::origin_row = 0

original row offset before normalisation

Definition at line 107 of file ca-io.H.

Referenced by Aleph::CA::ca_io_detail::finalise_absolute_pattern(), TEST(), and TEST().

◆ rule

std::string Aleph::CA::Binary_Cell_Pattern::rule

optional rule string, e.g. B3/S23

Definition at line 109 of file ca-io.H.

Referenced by Aleph::CA::read_rle(), TEST(), and TEST().

◆ width

ca_size_t Aleph::CA::Binary_Cell_Pattern::width = 0

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