lib/Panotools/Script/Line/Panorama.pm

filter: Statementstmt 100% 59 / 59 Branchbran 50.0% 23 / 46 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 75.8% 91 / 120 CC 25 SCAR 35.0
CC
25
Cov
77%
Report
42.1
BEGIN
1.0
BEGIN
1.0
CRAP 33.1
« lib/Panotools/Script/Line/Variable.pm ↑ Summary lib/Panotools/Photos.pm »
1 package Panotools::Script::Line::Panorama;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use Panotools::Script::Line;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Panotools::Script::Line::Panorama - Panotools panorama parameters
10  
11 =head1 SYNOPSIS
12  
13 Panorama parameters are described by a 'p' line
14  
15 =head1 DESCRIPTION
16  
17 w1000 width in pixels
18 h600 height in pixels
19 f0 projection format,
20 0 - rectilinear (for printing and viewing)
21 1 - Cylindrical (for Printing and QTVR)
22 2 - Equirectangular ( for Spherical panos), default
23 3 - full-frame fisheye
24 4 - stereographic
25 5 - mercator
26 6 - transverse mercator
27 7 - sinusoidal
28 8 - Lambert Equal Area Cylindrical
29 9 - Lambert Azimuthal
30 10 - Albers Equal Area Conical
31 11 - Miller Cylindrical
32 12 - Panini
33 13 - Architectural
34 14 - Orthographic
35 15 - Equisolid
36 16 - Equirectangular Panini
37 17 - Biplane
38 18 - Triplane
39 19 - Panini_General
40 20 - Thoby
41 21 - Hammer
42  
43 v360 horizontal field of view of panorama (default 360)
44 nPICT Panorama file format, one of:
45 PNG png-format, 8 & 16 bit supported
46 TIFF tiff-format, all tiff types supported (8,16,32 bit int, float, double)
47 TIFF_m tiff-format, multi-file, one image per file
48 alpha layer with non-feathered clip mask at image border
49 TIFF_multilayer tiff-format, multi-image-file, all files in one image
50 alpha layer with non-feathered clip mask at image border
51 This filetype is supported by The GIMP
52 JPEG Panoramic image in jpeg-format.
53 some more supported file formats (mostly only 8 bit support)
54 PNM, PGM, BMP, SUN, VIFF
55  
56 Special options for TIFF output:
57 n"TIFF c:NONE"
58 c - select TIFF compression, possible options: NONE, LZW, DEFLATE
59  
60 Special options for TIFF_m and TIFF_multilayer output:
61 n"TIFF c:NONE r:CROP"
62 c - TIFF compression, possible options NONE, LZW, DEFLATE
63 r - output only used image area (cropped output). The crop offsets
64 are stored in the POSITIONX and POSITONY tiff tags
65 p1 - save coordinate images (useful for further programs, like vignetting correction)
66  
67 Special options for JPEG output:
68 n"JPEG q95"
69 q - jpeg quality
70  
71 u10 width of feather for stitching all images. default:10
72 k1 attempt color & brightness correction using image number as anchor
73 b1 attempt brightness correction with no color change using image number as anchor
74 d1 attempt color correction with no brightness change using image number as anchor
75 Do not use more than one of k, d, b.This is new method of correcting
76  
77 E1 exposure value for final panorama
78 R1 stitching mode: 0: normal LDR mode, 1: HDR mode
79 T"UINT8" bitdepth of output images, possible values are
80 UINT8 - 8 bit unsigned
81 UINT16 - 16 bit unsigned
82 FLOAT - 32 bit floating point
83 By default the bit depth of the input images is used.
84 S100,600,100,800 Selection(left,right,top,bottom), Only pixels inside the rectangle
85 will be rendered. Images that do not contain pixels in this area
86 are not rendered/created.
87 P"0 60" Projection parameters. e.g. Albers Equal Area Conical requires extra parameters.
88  
89 =cut
90  
91 11 ▶use vars qw /@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
92 11 @ISA = qw /Panotools::Script::Line/;
93  
94 sub _defaults
95 17 ▶{
Subroutine _defaults: called CC=1 SCAR=0.0
96 17 my $self = shift;
97 17 $self->{w} = 1000;
98 17 $self->{h} = 500;
99 17 $self->{v} = 360.0;
100 17 $self->{n} = '"JPEG q100"';
101 17 $self->{E} = 0;
102 17 $self->{f} = 2;
103 17 $self->{R} = 0;
104 }
105  
106 28 ▶sub _valid { '^([bdfhknuvwERTSP])(.*)' }
Subroutine _valid: called CC=1 SCAR=0.0
107  
108 sub Identifier
109 12 ▶{
Subroutine Identifier: called CC=1 SCAR=0.0
Pod undocumented
110 12 my $self = shift;
111 12 return "p";
112 }
113  
114 sub Report
115 1 ▶{
Subroutine Report: called CC=25 SCAR=37.4
Pod undocumented
116 1 my $self = shift;
117 1 my @report;
118  
119 1 my $format = 'UNKNOWN';
120 1 ▶ $format = "Rectilinear" if $self->{f} == 0;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 0 0 1 1
121 1 ▶ $format = "Cylindrical" if $self->{f} == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 1 0 1 1
122 1 ▶ $format = "Equirectangular" if $self->{f} == 2;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 2 1 0 1
123 1 ▶ $format = "Fisheye" if $self->{f} == 3;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 3 0 1 1
124 1 ▶ $format = "Stereographic" if $self->{f} == 4;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 4 0 1 1
125 1 ▶ $format = "Mercator" if $self->{f} == 5;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 5 0 1 1
126 1 ▶ $format = "Transverse mercator" if $self->{f} == 6;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 6 0 1 1
127 1 ▶ $format = "Sinusoidal" if $self->{f} == 7;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 7 0 1 1
128 1 ▶ $format = "Lambert Equal Area Cylindrical" if $self->{f} == 8;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 8 0 1 1
129 1 ▶ $format = "Lambert Azimuthal" if $self->{f} == 9;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 9 0 1 1
130 1 ▶ $format = "Albers Equal Area Conical" if $self->{f} == 10;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 10 0 1 1
131 1 ▶ $format = "Miller Cylindrical" if $self->{f} == 11;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 11 0 1 1
132 1 ▶ $format = "Panini" if $self->{f} == 12;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 12 0 1 1
133 1 ▶ $format = "Architectural" if $self->{f} == 13;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 13 0 1 1
134 1 ▶ $format = "Orthographic" if $self->{f} == 14;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 14 0 1 1
135 1 ▶ $format = "Equisolid" if $self->{f} == 15;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 15 0 1 1
136 1 ▶ $format = "Equirectangular Panini" if $self->{f} == 16;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 16 0 1 1
137 1 ▶ $format = "Biplane" if $self->{f} == 17;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 17 0 1 1
138 1 ▶ $format = "Triplane" if $self->{f} == 18;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"f"} == 18 0 1 1
139  
140 1 my $mode = "LDR";
141 1 ▶ $mode = "HDR" if defined $self->{R} and $self->{R} == 1;
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"R"} and $self->{"R"} == 1 0 1 1
Condition33%1/3
defined $self->{"R"} and $self->{"R"} == 1
!ll&&!rl&&r
010
MC/DC0%0/2
defined $self->{"R"} and $self->{"R"} == 1
defined $self->{"R"} $self->{"R"} == 1
Truth table33%1/3
A and B
A= defined $self->{"R"}B= $self->{"R"} == 1
ABresult
0X0
100
111
142  
143 1 push @report, ['Dimensions', $self->{w} .'x'. $self->{h}];
144 1 push @report, ['Megapixels', int ($self->{w} * $self->{h} / 1024 / 1024 * 10) / 10];
145 1 push @report, ['Format', $format];
146 1 push @report, ['Horizontal Field of View', $self->{v}];
147 1 push @report, ['File type', $self->{n}];
148 1 push @report, ['Exposure Value', $self->{E}];
149 1 ▶ push @report, ['Stitching mode', $mode] if defined $mode;
Branch: 1 branch
BranchTrueFalseTotal
if defined $mode 1 0 1
150 1 ▶ push @report, ['Bit depth', $self->{T}] if defined $self->{T};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"T"} 0 1 1
151 1 ▶ push @report, ['Selection area', $self->{S}] if defined $self->{S};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"S"} 0 1 1
152 1 [@report];
153 }
154  
155 11 1;
« lib/Panotools/Script/Line/Variable.pm ↑ Summary lib/Panotools/Photos.pm »