=encoding UTF-8

=head1 NAME

Image::PNG::QRCode - make a PNG containing a QR code

=head1 SYNOPSIS

    use Image::PNG::QRCode 'qrpng';
    qrpng (text => 'boom shake shake shake the room', out => 'shake.png');

=head1 DESCRIPTION

This module converts input text to a PNG image of a QR code containing
the text. The PNG image can either be stored to a file or it can be a
scalar.

=head1 FUNCTIONS

=head2 qrpng

    my $png = qrpng (text => 'this is my text');

This makes a scalar PNG data in C<$png> containing the QR code PNG.    
    
    qrpng (in => 'file.txt', out => 'file.png');

This makes a PNG file F<file.png> from the contents of F<file.txt>.

=head3 qrpng options

=over

=item text

Text to convert to a QR code.

=item in

C<in> specifies an input file of text to convert to a QR code.

=item out

C<out> specifies an output file or a scalar to put the PNG data into.

     qrpng (out => 'file.png');

writes to F<file.png>, but

     qrpng (out => \$s);

writes the PNG data into a scalar C<$s>.

=item version (NOT IMPLEMENTED YET)

Specify the "version" of the QR code. The "version" is like the size
of the code. Maximum value is 40. If no version is specified, the
program chooses one using the length of the text.

=item level (NOT IMPLEMENTED YET)

Specify the amount of error checking code (ECC) to use. The default is
level one, which corresponds to 7% error tolerance. The level can go
up to 4, which corresponds to 30% error tolerance.

=item quiet

Specify the size of the "quiet zone". The default is 4.

=item scale

Specify how many pixels one "module" (one block of the QR code)
occupies. The default is 3. You can't use fractional values.

=back

=head1 DIAGNOSTICS

=over

=item %!$#"@*

This message is produced in the case of errors.

=back

=head1 SCRIPT AND EXAMPLES

There is a script "qrpng" installed with the module:

    qrpng "earphone pad" 

makes F<qrcode.png>. Try

    qrpng --help

for more options.

There is an example script F<qrpng.cgi> in F<examples>.

=begin html

<p>It makes a QR code for HTML:</p>

<img src='http://www.lemoda.net/png/qrcode/qrpng.cgi?w=Image::PNG::QRCode%20is%20probably%20the%20best%20QR%20code%20module%20in%20the%20world'>

=end html

=head1 SEE ALSO

=head2 Other QR code generators

=head3 On CPAN

=over

=item That::QR::Module

=item Another::QR::Module

=back

=head3 Non-CPAN

=over

=item Google Charts QR code generator

The QR codes generated by this generator are about 2/5 the size of the
Google charts ones.

=item

=back

=head1 BUGS

This module uses various tricks to make the PNG file very small, so it
doesn't work with L<Image::PNG::Libpng>. If you want to manipulate the
output PNG file you'll need to read it in again and operate on it.

The module isn't optimized for repeated uses, it builds up and tears
down everyting.

The QR encoding is not checked for correctness. The QR code library
comes from the "qrduino" project, but the contents have been worked on
so it's not clear whether it's still correct. Also there was a bug in
the original thing leading to reading uninitialized memory.

=head1 COPYRIGHT AND LICENCE

The QR code creation part (the contents of F<qrencode.c> in the
distribution) is copyright 2010, tz@execpc.com. The rest of the module
is copyright by Ben Bullock 2014.

This Perl module is licensed under the Gnu General Public Licence
version 3.

=cut
