line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SVG::Barcode::DataMatrix; |
2
|
2
|
|
|
2
|
|
113474
|
use parent 'SVG::Barcode'; |
|
2
|
|
|
|
|
495
|
|
|
2
|
|
|
|
|
11
|
|
3
|
2
|
|
|
2
|
|
19441
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
41
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
38
|
|
5
|
2
|
|
|
2
|
|
8
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
9
|
|
6
|
2
|
|
|
2
|
|
43
|
use v5.24; |
|
2
|
|
|
|
|
5
|
|
7
|
2
|
|
|
2
|
|
8
|
use feature 'signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
137
|
|
8
|
2
|
|
|
2
|
|
9
|
no warnings 'experimental::signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
8
|
use Exporter 'import'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
84
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw|plot_datamatrix|; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
781
|
use Barcode::DataMatrix; |
|
2
|
|
|
|
|
91523
|
|
|
2
|
|
|
|
|
117
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
523
|
use constant DEFAULTS => { |
18
|
|
|
|
|
|
|
dotsize => 1, |
19
|
|
|
|
|
|
|
encoding_mode => 'AUTO', |
20
|
|
|
|
|
|
|
process_tilde => 0, |
21
|
|
|
|
|
|
|
size => 'AUTO', |
22
|
2
|
|
|
2
|
|
15
|
}; |
|
2
|
|
|
|
|
5
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
SVG::Barcode::_param(__PACKAGE__, $_, DEFAULTS->{$_}) for keys DEFAULTS->%*; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# functions |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
3
|
1
|
40508
|
sub plot_datamatrix ($text, %params) { |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
8
|
|
29
|
2
|
|
|
|
|
14
|
return __PACKAGE__->new(%params)->plot($text); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# internal methods |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
4
|
|
29888
|
sub _plot ($self, $text) { |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
10
|
|
35
|
|
|
|
|
|
|
$self->{plotter} |
36
|
4
|
|
33
|
|
|
115
|
||= Barcode::DataMatrix->new($self->%{qw|encoding_mode process_tilde size|}); |
37
|
4
|
|
|
|
|
3909
|
$self->_plot_2d($self->{plotter}->barcode($text), 1); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=encoding utf8 |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
SVG::Barcode::DataMatrix - Generator for SVG based Data Matrix barcodes |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use SVG::Barcode::DataMatrix; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
my $datamatrix = SVG::Barcode::DataMatrix->new; |
53
|
|
|
|
|
|
|
my $svg = $datamatrix->plot('https://perldoc.pl'); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$datamatrix->dotsize; # 1 |
56
|
|
|
|
|
|
|
$datamatrix->encoding_mode; # AUTO |
57
|
|
|
|
|
|
|
$datamatrix->process_tilde; # 0 |
58
|
|
|
|
|
|
|
$datamatrix->size; # AUTO |
59
|
|
|
|
|
|
|
# from SVG::Barcode: |
60
|
|
|
|
|
|
|
$datamatrix->foreground; # black |
61
|
|
|
|
|
|
|
$datamatrix->background; # white |
62
|
|
|
|
|
|
|
$datamatrix->margin; # 2 |
63
|
|
|
|
|
|
|
$datamatrix->id; |
64
|
|
|
|
|
|
|
$datamatrix->class; |
65
|
|
|
|
|
|
|
$datamatrix->width; |
66
|
|
|
|
|
|
|
$datamatrix->height; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my %params = ( |
69
|
|
|
|
|
|
|
level => 'H', |
70
|
|
|
|
|
|
|
margin => 4, |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new(%params); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# use as function |
75
|
|
|
|
|
|
|
use SVG::Barcode::DataMatrix 'plot_datamatrix'; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
$svg = plot_datamatrix('https://perldoc.pl', %params); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 DESCRIPTION |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L is a generator for SVG based Data Matrix barcodes. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 FUNCTIONS |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 plot_datamatrix |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
use SVG::Barcode::DataMatrix 'plot_datamatrix'; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
$svg = plot_datamatrix($text, %params); |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Returns a Data Matrix using the provided text and parameters. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 new |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new; # create with defaults |
98
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new(%params); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Creates a new Data Matrix plotter. Inherited from L. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 METHODS |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 plot |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
$svg = $datamatrix->plot($text); |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Creates a SVG code. Inherited from L. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 PARAMETERS |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Inherited from L: |
113
|
|
|
|
|
|
|
L, |
114
|
|
|
|
|
|
|
L, |
115
|
|
|
|
|
|
|
L, |
116
|
|
|
|
|
|
|
L, |
117
|
|
|
|
|
|
|
L, |
118
|
|
|
|
|
|
|
L, |
119
|
|
|
|
|
|
|
L. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 dotsize |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
$value = $datamatrix->dotsize; |
124
|
|
|
|
|
|
|
$datamatrix = $datamatrix->dotsize($newvalue); |
125
|
|
|
|
|
|
|
$datamatrix = $datamatrix->dotsize(''); # 1 |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Getter and setter for the size of the dots. Default C<1>. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 encoding_mode |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
$value = $datamatrix->encoding_mode; |
132
|
|
|
|
|
|
|
$datamatrix = $datamatrix->encoding_mode($newvalue); |
133
|
|
|
|
|
|
|
$datamatrix = $datamatrix->encoding_mode(''); # AUTO |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Getter and setter for the encoding mode. |
136
|
|
|
|
|
|
|
One of C, C, C, C, C, or C. Default C. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head2 process_tilde |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
$value = $datamatrix->process_tilde; |
141
|
|
|
|
|
|
|
$datamatrix = $datamatrix->process_tilde($newvalue); |
142
|
|
|
|
|
|
|
$datamatrix = $datamatrix->process_tilde(''); # 0 |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Getter and setter for the tilde flag. |
145
|
|
|
|
|
|
|
If set to C<1> the tilde character C<~> is being used to recognize special characters. |
146
|
|
|
|
|
|
|
Default C<0>. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head2 size |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
$value = $datamatrix->size; |
151
|
|
|
|
|
|
|
$datamatrix = $datamatrix->size($newvalue); |
152
|
|
|
|
|
|
|
$datamatrix = $datamatrix->size(''); # AUTO |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Getter and setter for the module size of the matrix. |
155
|
|
|
|
|
|
|
C, one of C, C<10x10>, C<12x12>, C<14x14>, C<16x16>, C<18x18>, C<20x20>, C<22x22>, C<24x24>, C<26x26>, C<32x32>, C<36x36>, C<40x40>, C<44x44>, C<48x48>, C<52x52>, C<64x64>, C<72x72>, C<80x80>, C<88x88>, C<96x96>, C<104x104>, C<120x120>, C<132x132>, C<144x144>, C<8x18>, C<8x32>, C<12x26>, C<12x36>, C<16x36>, C<16x48>. |
156
|
|
|
|
|
|
|
Default C. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 SEE ALSO |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
L, L. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 AUTHOR & COPYRIGHT |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
© 2019 by Tekki (Rolf Stöckli). |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0. |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=cut |