lib/Panotools/Script/Line/Mask.pm

filter: Statementstmt 100% 29 / 29 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 90.7% 39 / 43 CC 3 SCAR 4.7
CC
3
Cov
94%
Report
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« lib/Panotools/Makefile/Variable.pm ↑ Summary lib/Panotools/Script/Line/Control.pm »
1 package Panotools::Script::Line::Mask;
2  
3 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 10 ▶use Panotools::Script::Line;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 10 ▶use vars qw /@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 @ISA = qw /Panotools::Script::Line/;
9  
10 =head1 NAME
11  
12 Panotools::Script::Line::Mask - Image Mask
13  
14 =head1 SYNOPSIS
15  
16 Optional image masks are described by a 'k' line
17  
18 =head1 DESCRIPTION
19  
20 i2 Set image number this mask applies to
21  
22 t0 Type for mask:
23 0 - negative (exclude region)
24 1 - positive (include region)
25 2 - exclude region from all images in the same stack
26 3 - include region from all images in the same stack
27 4 - exclude region from all images with the same lens
28  
29 p"1262 2159 1402 2065 1468 2003" List of node coordinates
30 Coordinates are in pairs, at least three pairs are required
31  
32 =cut
33  
34 sub _defaults
35 4 ▶{
Subroutine _defaults: called CC=1 SCAR=0.0
36 4 my $self = shift;
37 }
38  
39 9 ▶sub _valid { return '^([itp])(.*)' }
Subroutine _valid: called CC=1 SCAR=0.0
40  
41 sub Identifier
42 1 ▶{
Subroutine Identifier: called CC=1 SCAR=0.0
Pod undocumented
43 1 my $self = shift;
44 1 return "k";
45 }
46  
47 sub Report
48 1 ▶{
Subroutine Report: called CC=3 SCAR=11.1
Pod undocumented
49 1 my $self = shift;
50 1 my @report;
51 1 ▶ return [] unless defined $self->{t};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"t"} 0 1 1
52 1 my $type = 'Negative';
53 1 ▶ $type = 'Positive' if $self->{t} == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"t"} == 1 0 1 1
54 1 my $nodes = $self->{p};
55 1 $nodes =~ s/(^"|"$)//;
56 1 my @nodes = split ' ', $nodes;
57  
58 1 push @report, ['Mask type', $type];
59 1 push @report, ['Nodes', scalar @nodes / 2];
60 1 [@report];
61 }
62  
63 10 1;
« lib/Panotools/Makefile/Variable.pm ↑ Summary lib/Panotools/Script/Line/Control.pm »