line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SVG::Barcode::DataMatrix; |
2
|
2
|
|
|
2
|
|
110951
|
use parent 'SVG::Barcode'; |
|
2
|
|
|
|
|
533
|
|
|
2
|
|
|
|
|
9
|
|
3
|
2
|
|
|
2
|
|
19485
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
33
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
46
|
|
5
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
6
|
2
|
|
|
2
|
|
56
|
use v5.24; |
|
2
|
|
|
|
|
6
|
|
7
|
2
|
|
|
2
|
|
9
|
use feature 'signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
132
|
|
8
|
2
|
|
|
2
|
|
8
|
no warnings 'experimental::signatures'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
9
|
use Exporter 'import'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
70
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw|plot_datamatrix|; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
770
|
use Barcode::DataMatrix; |
|
2
|
|
|
|
|
88913
|
|
|
2
|
|
|
|
|
114
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
473
|
use constant DEFAULTS => { |
18
|
|
|
|
|
|
|
dotsize => 1, |
19
|
|
|
|
|
|
|
encoding_mode => 'AUTO', |
20
|
|
|
|
|
|
|
process_tilde => 0, |
21
|
|
|
|
|
|
|
size => 'AUTO', |
22
|
2
|
|
|
2
|
|
15
|
}; |
|
2
|
|
|
|
|
15
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
SVG::Barcode::_param(__PACKAGE__, $_, DEFAULTS->{$_}) for keys DEFAULTS->%*; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# functions |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
3
|
1
|
40400
|
sub plot_datamatrix ($text, %params) { |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
5
|
|
29
|
2
|
|
|
|
|
16
|
return __PACKAGE__->new(%params)->plot($text); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# internal methods |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
4
|
|
31130
|
sub _plot ($self, $text) { |
|
4
|
|
|
|
|
18
|
|
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
10
|
|
35
|
|
|
|
|
|
|
$self->{plotter} |
36
|
4
|
|
33
|
|
|
84
|
||= Barcode::DataMatrix->new($self->%{qw|encoding_mode process_tilde size|}); |
37
|
4
|
|
|
|
|
3576
|
$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
|
|
|
|
|
|
|
$datamatrix->scale; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
my %params = ( |
70
|
|
|
|
|
|
|
level => 'H', |
71
|
|
|
|
|
|
|
margin => 4, |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new(%params); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# use as function |
76
|
|
|
|
|
|
|
use SVG::Barcode::DataMatrix 'plot_datamatrix'; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$svg = plot_datamatrix('https://perldoc.pl', %params); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 DESCRIPTION |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
L is a generator for SVG based Data Matrix barcodes. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 FUNCTIONS |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 plot_datamatrix |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
use SVG::Barcode::DataMatrix 'plot_datamatrix'; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
$svg = plot_datamatrix($text, %params); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Returns a Data Matrix using the provided text and parameters. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 new |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new; # create with defaults |
99
|
|
|
|
|
|
|
$datamatrix = SVG::Barcode::DataMatrix->new(%params); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Creates a new Data Matrix plotter. Inherited from L. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 METHODS |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 plot |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
$svg = $datamatrix->plot($text); |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Creates a SVG code. Inherited from L. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 PARAMETERS |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Inherited from L: |
114
|
|
|
|
|
|
|
L, |
115
|
|
|
|
|
|
|
L, |
116
|
|
|
|
|
|
|
L, |
117
|
|
|
|
|
|
|
L, |
118
|
|
|
|
|
|
|
L, |
119
|
|
|
|
|
|
|
L, |
120
|
|
|
|
|
|
|
L, |
121
|
|
|
|
|
|
|
L. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 dotsize |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
$value = $datamatrix->dotsize; |
126
|
|
|
|
|
|
|
$datamatrix = $datamatrix->dotsize($newvalue); |
127
|
|
|
|
|
|
|
$datamatrix = $datamatrix->dotsize(''); # 1 |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Getter and setter for the size of the dots. Default C<1>. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 encoding_mode |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
$value = $datamatrix->encoding_mode; |
134
|
|
|
|
|
|
|
$datamatrix = $datamatrix->encoding_mode($newvalue); |
135
|
|
|
|
|
|
|
$datamatrix = $datamatrix->encoding_mode(''); # AUTO |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Getter and setter for the encoding mode. |
138
|
|
|
|
|
|
|
One of C, C, C, C, C, or C. Default C. |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head2 process_tilde |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
$value = $datamatrix->process_tilde; |
143
|
|
|
|
|
|
|
$datamatrix = $datamatrix->process_tilde($newvalue); |
144
|
|
|
|
|
|
|
$datamatrix = $datamatrix->process_tilde(''); # 0 |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Getter and setter for the tilde flag. |
147
|
|
|
|
|
|
|
If set to C<1> the tilde character C<~> is being used to recognize special characters. |
148
|
|
|
|
|
|
|
Default C<0>. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 size |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
$value = $datamatrix->size; |
153
|
|
|
|
|
|
|
$datamatrix = $datamatrix->size($newvalue); |
154
|
|
|
|
|
|
|
$datamatrix = $datamatrix->size(''); # AUTO |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Getter and setter for the module size of the matrix. |
157
|
|
|
|
|
|
|
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>. |
158
|
|
|
|
|
|
|
Default C. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 SEE ALSO |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
L, L. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 AUTHOR & COPYRIGHT |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
© 2019 by Tekki (Rolf Stöckli). |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |