App::MathImage::Image::Base::LifeRLE -- game of life cellular grids in RLE format
use App::MathImage::Image::Base::LifeRLE; my $image = App::MathImage::Image::Base::LifeRLE->new (-width => 100, -height => 100); $image->rectangle (0,0, 99,99, 'b'); $image->xy (20,20, 'o'); $image->line (50,50, 70,70, 'o'); $image->line (50,50, 70,70, 'o'); $image->save ('/some/filename.rle');
App::MathImage::Image::Base::LifeRLE is a subclass of Image::Base::Text, but don't rely on more than Image::Base for now.
App::MathImage::Image::Base::LifeRLE
Image::Base::Text
Image::Base
Image::Base Image::Base::Text App::MathImage::Image::Base::LifeRLE
App::MathImage::Image::Base::LifeRLE extends Image::Base to create or update game of life RLE format files.
The colour names are " " (space), "b" or "." for background, and "o" for a set cell. For multi-state cells colours are numbers 0 to 255, with 0 being the background and 1 corresponding to "o".
$image = App::MathImage::Image::Base::LifeRLE->new (key=>value,...)
Create and return a new image object. A new image can be started with -width and -height,
-width
-height
$image = App::MathImage::Image::Base::LifeRLE->new (-width => 200, -height => 100);
Or an existing file can be read,
$image = App::MathImage::Image::Base::LifeRLE->new (-file => '/some/filename.rle');
$image->save ()
$image->save ($filename)
Save the image to a text file, either the current -file option, or set that option to $filename and save to there.
-file
$filename
The current code automatically chooses between "o/b" for a binary-only grid or "./A/B/etc" for multi-state. Perhaps there should be an option to force the multi-state format, or distinguish that from numbers used as colours.
Image::Base, Image::Base::Text
golly(6)
To install App::MathImage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MathImage
CPAN shell
perl -MCPAN -e shell install App::MathImage
For more information on module installation, please visit the detailed CPAN module installation guide.