=encoding utf-8 =head1 NAME =begin original Imager::QRCode - Generate QR Code with Imager using libqrencode =end original Imager::QRCode - libqrencodeを使って Imagerで QRコード生成. =head1 SYNOPSIS use Imager::QRCode; my $qrcode = Imager::QRCode->new( size => 2, margin => 2, version => 1, level => 'M', casesensitive => 1, lightcolor => Imager::Color->new(255, 255, 255), darkcolor => Imager::Color->new(0, 0, 0), ); my $img = $qrcode->plot("blah blah"); $img->write(file => "qrcode.gif"); # or instance method use Imager::QRCode qw(plot_qrcode); my $img = plot_qrcode("blah blah", \%params); $img->write(file => "qrcode.gif"); =head1 DESCRIPTION =begin original This module allows you to generate QR Code with Imager. This module use libqrencode '2.0.0' and above. =end original このモジュールは Imagerでの QRコード生成を可能にします. このモジュールは libqrencode '2.0.0'以上を利用します. =head1 METHODS =begin original =over 4 =item new $qrcode = Imager::QRCode->new(%params); The C constructor method instantiates a new Imager::QRCode object. C accepts the following parameters. =over 4 =item * C - Horizontal and vertical size of module(dot). Default is 4. =item * C - Margin size of QR Code. Default is 3. =item * C - Error collectin level. Valid values are 'M', 'L', 'Q' or 'H'. Default is 'L'. =item * C - Version of the symbol. If specify '0', this module chooses the minimum version for the input data. Default is '0'. =item * C - Encoding mode. Valid values are 'numerical', 'alpha-numerical', '8-bit' or 'kanji'. Default is '8-bit'. If not give C then should be given C. If 'kanji' is given, characters will be encoded as Shift-JIS characters. If '8-bit' is given, all of non-alpha-numerical characters will be encoded as is. If you want to embed UTF-8 string, choose '8-bit'. =item * C - If your application is case-sensitive using 8-bit characters, set to '1'. Default is '0'. =back =item plot($text) $img = $qrcode->plot("blah blah"); Create a new QR Code image. This method returns Imager object ploted QR Code with the given text. =back =end original =over 4 =item new $qrcode = Imager::QRCode->new(%params); Cコンストラクタメソッドは Imager::QRCodeオブジェクトを生成します. Cは以下のパラメータを受け取ることができます. =over 4 =item * C - モジュール(ドット)の水平方向, 垂直方向のサイズ. デフォルトは 4. =item * C - QRコードのマージンサイズ. デフォルトは 3. =item * C - エラー訂正レベル. 'M', 'L', 'Q', 'H'のいずれか. デフォルトは 'L'. =item * C - シンボルのバージョン. もし '0'を指定した場合, このモジュールは 入力データに必要となる最低限のバージョンを選択します. デフォルトは '0'. =item * C - 符号化モード. 'numerical', 'alpha-numerical', '8-bit', 'kanji'のいずれかの 値となります. デフォルトは '8-bit'. Cを指定しない場合, Cを指定すべきです. kanji'を指定した場合, 文字列は Shift_JISでエンコードされていることを想定します. '8-bit'を指定した場合は, アルファベット・数字以外の文字はそのまま扱います. UTF-8文字列を埋め込みたい場合は, '8-bit'を選択します. =item * C - もし 8-bit文字列の大文字小文字を区別するのであれば 1を設定します. デフォルトは 0. =back =item plot($text) $img = $qrcode->plot("blah blah"); QRコードイメージを作成します. このメソッドは与えられた文字列を QRコードに描画した Imagerオブジェクトを返します. =back =head1 INSTANT METHODS =begin original =over 4 =item plot_qrcode($text, \%params) Instant method. C<$text> is input text. C<%params> is same paramater as C. =back =end original =over 4 =item plot_qrcode($text, \%params) インスタントメソッド. C<$text>は入力テキスト. C<%params>は Cに渡すパラメータと 同様のものになります. =back =head1 SEE ALSO C, C, C =head1 AUTHOR Yoshiki KURIHARA C<< >> =head1 THANKS Tokuhiro Matsuno =head1 LICENCE AND COPYRIGHT Copyright (c) 2011, Yoshiki KURIHARA C<< >>. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L.