File Coverage

lib/Panotools/Script/Line/Mode.pm
Criterion Covered Total %
statement 37 37 100.0
branch 13 26 50.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 58 73 79.4


line stmt bran cond sub pod time code
1             package Panotools::Script::Line::Mode;
2              
3 11     11   802 use strict;
  11         25  
  11         389  
4 11     11   59 use warnings;
  11         21  
  11         265  
5 11     11   5828 use Panotools::Script::Line;
  11         32  
  11         495  
6              
7 11     11   113 use vars qw /@ISA/;
  11         69  
  11         5159  
8             @ISA = qw /Panotools::Script::Line/;
9              
10             =head1 NAME
11              
12             Panotools::Script::Line::Mode - Panotools stitching mode
13              
14             =head1 SYNOPSIS
15              
16             Optional stitching modes are described by an 'm' line
17              
18             =head1 DESCRIPTION
19              
20             m i2
21              
22             g2.5 Set gamma value for internal computations (default 1.0)
23             See
24             This is especially useful in conjunction with the vignetting correction
25             by division
26              
27             i2 Set interpolator, See
28             one of:
29             0 - poly3 (default)
30             1 - spline16,
31             2 - spline36,
32             3 - sinc256,
33             4 - spline64,
34             5 - bilinear,
35             6 - nearest neighbor,
36             7 - sinc1024
37              
38             m2 Huber Sigma
39              
40             p0.001 Photometric Huber Sigma
41              
42             s1 Photometric Symmetric Error
43              
44             =cut
45              
46             sub _defaults
47             {
48 17     17   40 my $self = shift;
49 17         114 $self->{g} = 1.0;
50 17         54 $self->{i} = 0;
51 17         42 $self->{m} = 2;
52 17         100 $self->{p} = 0.00784314;
53             }
54              
55 26     26   70 sub _valid { return '^([fgimps])(.*)' }
56              
57             sub Identifier
58             {
59 12     12 0 775 my $self = shift;
60 12         98 return "m";
61             }
62              
63             sub Report
64             {
65 1     1 0 3 my $self = shift;
66 1         2 my @report;
67              
68 1         3 my $interpolator = 'UNKNOWN';
69 1 50       5 $interpolator = 'poly3' if $self->{i} == 0;
70 1 50       4 $interpolator = 'spline16' if $self->{i} == 1;
71 1 50       3 $interpolator = 'spline36' if $self->{i} == 2;
72 1 50       4 $interpolator = 'sinc256' if $self->{i} == 3;
73 1 50       4 $interpolator = 'spline64' if $self->{i} == 4;
74 1 50       4 $interpolator = 'bilinear' if $self->{i} == 5;
75 1 50       4 $interpolator = 'nearest neighbor' if $self->{i} == 6;
76 1 50       5 $interpolator = 'sinc1024' if $self->{i} == 7;
77              
78 1 50       14 push @report, ['Gamma', $self->{g}] if defined $self->{g};
79 1 50       7 push @report, ['Interpolator', $interpolator] if defined $self->{i};
80 1 50       7 push @report, ['Huber Sigma', $self->{m}] if defined $self->{m};
81 1 50       5 push @report, ['Photometric Huber Sigma', $self->{p}] if defined $self->{p};
82 1 50       3 push @report, ['Photometric Symmetric Error', $self->{s}] if defined $self->{s};
83 1         6 [@report];
84             }
85              
86             1;