line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lego::From::PNG::View::JSON; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
873
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
116
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
BEGIN { |
7
|
1
|
|
|
1
|
|
15
|
$Lego::From::PNG::VERSION = '0.03'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
456
|
use parent qw(Lego::From::PNG::View); |
|
1
|
|
|
|
|
298
|
|
|
1
|
|
|
|
|
8
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
89
|
use Data::Debug; |
|
1
|
|
|
|
|
26
|
|
|
1
|
|
|
|
|
63
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
10
|
use JSON; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub print { |
17
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
18
|
0
|
0
|
|
|
|
|
my %args = ref $_[0] eq 'HASH' ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return JSON->new->utf8->pretty->encode( \%args ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=pod |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Lego::From::PNG::View::JSON - Format data returned from Lego::From::PNG |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
use Lego::From::PNG; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $object = Lego::From::PNG->new({ filename => 'my_png.png' }); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$object->process(view => 'JSON'); # Data is returned as JSON |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Class to returned processed data in JSON format |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 USAGE |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 new |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Usage : ->new() |
46
|
|
|
|
|
|
|
Purpose : Returns Lego::From::PNG::View::JSON object |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Returns : Lego::From::PNG::View::JSON object |
49
|
|
|
|
|
|
|
Argument : |
50
|
|
|
|
|
|
|
Throws : |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Comment : |
53
|
|
|
|
|
|
|
See Also : |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 print |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Usage : ->print({}) or ->print(key1 => val1, key2 => val2) |
58
|
|
|
|
|
|
|
Purpose : Returns JSON formated data (in utf8 and pretty format) |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Returns : Returns JSON formated data (in utf8 and pretty format) |
61
|
|
|
|
|
|
|
Argument : |
62
|
|
|
|
|
|
|
Throws : |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Comment : |
65
|
|
|
|
|
|
|
See Also : |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 BUGS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SUPPORT |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Travis Chase |
75
|
|
|
|
|
|
|
CPAN ID: GAUDEON |
76
|
|
|
|
|
|
|
gaudeon@cpan.org |
77
|
|
|
|
|
|
|
https://github.com/gaudeon/Lego-From-Png |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 COPYRIGHT |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This program is free software licensed under the... |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The MIT License |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The full text of the license can be found in the |
86
|
|
|
|
|
|
|
LICENSE file included with this module. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 SEE ALSO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
perl(1). |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |