The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Graphics::Potrace::Raster::Ascii - importer of ASCII images for Graphics::Potrace

VERSION

version 0.72

SYNOPSIS

   use Graphics::Potrace::Raster;
   my $bitmap = Graphics::Potrace::Raster->new();
   $bitmap->load(Ascii => filename => '/path/to/ascii.txt');

DESCRIPTION

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).

INTERFACE

All the methods in Graphics::Potrace::Raster::Imported are supported. In addition, the following method is provided:

empty_tester

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]).

AUTHOR

Flavio Poletti <polettix@cpan.org>

COPYRIGHT AND LICENSE

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.