line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Imager::QRCode; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
40893
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
84
|
|
4
|
3
|
|
|
3
|
|
9
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
52
|
|
5
|
3
|
|
|
3
|
|
9
|
use base qw(Exporter); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
243
|
|
6
|
3
|
|
|
3
|
|
14
|
use vars qw(@ISA $VERSION @EXPORT_OK); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
187
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
@EXPORT_OK = qw(plot_qrcode); |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
10
|
use Carp qw(croak); |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
153
|
|
11
|
3
|
|
|
3
|
|
2275
|
use Imager 0.55; |
|
3
|
|
|
|
|
93351
|
|
|
3
|
|
|
|
|
19
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
BEGIN { |
14
|
3
|
|
|
3
|
|
270
|
$VERSION = '0.035'; |
15
|
|
|
|
|
|
|
eval { |
16
|
3
|
|
|
|
|
21
|
require XSLoader; |
17
|
3
|
|
|
|
|
1334
|
XSLoader::load('Imager::QRCode', $VERSION); |
18
|
3
|
|
|
|
|
544
|
1; |
19
|
3
|
50
|
|
|
|
5
|
} or do { |
20
|
0
|
|
|
|
|
0
|
require DynaLoader; |
21
|
0
|
|
|
|
|
0
|
push @ISA, 'DynaLoader'; |
22
|
0
|
|
|
|
|
0
|
bootstrap Imager::QRCode $VERSION; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
8
|
|
|
8
|
1
|
2725
|
my $class = shift; |
28
|
8
|
50
|
|
|
|
37
|
my $params = scalar ref $_[0] eq 'HASH' ? $_[0] : { @_ }; |
29
|
8
|
|
|
|
|
19
|
return bless { params => $params }, $class; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub plot { |
33
|
8
|
|
|
8
|
1
|
6132
|
my ( $self, $text ) = @_; |
34
|
8
|
50
|
|
|
|
18
|
defined $text or croak 'Not enough arguments for plot()'; |
35
|
8
|
|
|
|
|
5671
|
return _imager( _plot($text, $self->{params}) ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub plot_qrcode { |
39
|
0
|
|
|
0
|
1
|
0
|
my ( $text, $params ) = @_; |
40
|
0
|
0
|
|
|
|
0
|
defined $text or croak 'Not enough arguments for plot()'; |
41
|
0
|
0
|
0
|
|
|
0
|
$params ||= {} if !$params || ref $params ne 'HASH'; |
|
|
|
0
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
return _imager( _plot( $text, $params ) ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _imager { |
46
|
6
|
|
|
6
|
|
11
|
my $raw = shift; |
47
|
6
|
50
|
|
|
|
22
|
ref $raw eq 'Imager::ImgRaw' or croak "_imager() argument must be Imager::ImgRaw"; |
48
|
6
|
|
|
|
|
26
|
my $img = Imager->new; |
49
|
6
|
|
|
|
|
98
|
$img->{IMG} = $raw; |
50
|
6
|
|
|
|
|
19
|
return $img; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
54
|
|
|
|
|
|
|
__END__ |