line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Image::Compare::THRESHOLD; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
35
|
use warnings; |
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
186
|
|
4
|
8
|
|
|
8
|
|
22
|
use strict; |
|
8
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
124
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
20
|
use base qw/Image::Compare::Comparator/; |
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
1134
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub setup { |
9
|
5
|
|
|
5
|
1
|
7
|
my $self = shift; |
10
|
5
|
|
|
|
|
29
|
$self->SUPER::setup(@_); |
11
|
|
|
|
|
|
|
# Default to true, we will return 0 if we run into trouble later. |
12
|
5
|
|
|
|
|
36
|
$self->{result} = 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub accumulate { |
16
|
24
|
|
|
24
|
1
|
23
|
my $self = shift; |
17
|
24
|
|
|
|
|
53
|
my $diff = $self->color_distance(@_); |
18
|
24
|
100
|
|
|
|
55
|
if ($diff > $self->{args}) { |
19
|
6
|
|
|
|
|
7
|
$self->{result} = 0; |
20
|
6
|
|
|
|
|
15
|
return 1; |
21
|
|
|
|
|
|
|
} |
22
|
18
|
|
|
|
|
44
|
return undef; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get_result { |
26
|
5
|
|
|
5
|
1
|
8
|
my $self = shift; |
27
|
5
|
|
|
|
|
22
|
return $self->{result}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |