Graphics::Potrace::Raster::Ascii - importer of ASCII images for Graphics::Potrace
version 0.1.0_03
use Graphics::Potrace::Raster; my $bitmap = Graphics::Potrace::Raster->new(); $bitmap->load(Ascii => filename => '/path/to/ascii.txt');
This class is an importer for Graphics::Potrace. It derives from Graphics::Potrace::Raster::Importer, so see it for generic methods. In particular, this class overrides "load_handle" in order to provide means to load a raster image from an ASCII file.
The ASCII file is considered to contain a matrix of characters that will be treated as blanks (by default dots, spaces and zeroes) or filled ones (any other character). You can set your "idea" of what an empty pixel is by means of "empty_tester" (which you can set in the constructor as well).
All the methods in Graphics::Potrace::Raster::Imported are supported. In addition, the following method is provided:
Accessor to an internal variable for setting a regular expression to be used to check whether a pixel is empty or not. By default it is the regular expression (?-imxs:[. 0]).
(?-imxs:[. 0])
Flavio Poletti <polettix@cpan.org>
Copyright (C) 2011 by Flavio Poletti polettix@cpan.org.
This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install Graphics::Potrace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graphics::Potrace
CPAN shell
perl -MCPAN -e shell install Graphics::Potrace
For more information on module installation, please visit the detailed CPAN module installation guide.