| 1 | package Panotools::Script::Line::Option; | ||||||||||||||||||||
| 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 | |||||||||||||||||||||
| 6 | =head1 NAME | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | Panotools::Script::Line::Option - Hugin Options | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | =head1 SYNOPSIS | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | Option parameters are described by a line beginning with '#hugin_' | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | sub new | ||||||||||||||||||||
| 19 | 16 | ▶ | { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 20 | 16 | my $class = shift; | |||||||||||||||||||
| 21 | 16 | ▶ | $class = ref $class || $class; | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 22 | 16 | my $self = bless {}, $class; | |||||||||||||||||||
| 23 | 16 | $self->_defaults; | |||||||||||||||||||
| 24 | 16 | return $self; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | sub _defaults | ||||||||||||||||||||
| 28 | 16 | ▶ | { | ||||||||||||||||||
|
Subroutine
_defaults: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 29 | 16 | my $self = shift; | |||||||||||||||||||
| 30 | 16 | %{$self} = | |||||||||||||||||||
| 31 | (optimizeReferenceImage => 0, | ||||||||||||||||||||
| 32 | blender => 'enblend', | ||||||||||||||||||||
| 33 | remapper => 'nona', | ||||||||||||||||||||
| 34 | enblendOptions => '', | ||||||||||||||||||||
| 35 | enfuseOptions => '', | ||||||||||||||||||||
| 36 | hdrmergeOptions => '', | ||||||||||||||||||||
| 37 | outputLDRBlended => 'true', | ||||||||||||||||||||
| 38 | outputLDRLayers => 'false', | ||||||||||||||||||||
| 39 | outputLDRExposureRemapped => 'false', | ||||||||||||||||||||
| 40 | outputLDRExposureLayers => 'false', | ||||||||||||||||||||
| 41 | outputLDRExposureBlended => 'false', | ||||||||||||||||||||
| 42 | outputHDRBlended => 'false', | ||||||||||||||||||||
| 43 | outputHDRLayers => 'false', | ||||||||||||||||||||
| 44 | outputHDRStacks => 'false', | ||||||||||||||||||||
| 45 | outputLayersCompression => 'PACKBITS', | ||||||||||||||||||||
| 46 | outputImageType => 'tif', | ||||||||||||||||||||
| 47 | outputImageTypeCompression => 'NONE', | ||||||||||||||||||||
| 48 | outputJPEGQuality => 100, | ||||||||||||||||||||
| 49 | outputImageTypeHDR => 'exr', | ||||||||||||||||||||
| 50 | outputImageTypeHDRCompression => ''); | ||||||||||||||||||||
| 51 | } | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | sub Identifier | ||||||||||||||||||||
| 54 | 142 | ▶ | { | ||||||||||||||||||
|
Subroutine
Identifier: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 55 | 142 | my $self = shift; | |||||||||||||||||||
| 56 | 142 | return "#hugin_"; | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | sub Parse | ||||||||||||||||||||
| 60 | 5 | ▶ | { | ||||||||||||||||||
|
Subroutine
Parse: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 61 | 5 | my $self = shift; | |||||||||||||||||||
| 62 | 5 | ▶ | my $string = shift || return 0; | ||||||||||||||||||
|
Condition50%1/2
shift() || (return 0)
MC/DC0%0/1
shift() || (return 0)
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||
| 63 | 5 | my ($key, $value) = $string =~ /^#hugin_([[:alnum:]]+) *(.*)/g; | |||||||||||||||||||
| 64 | 5 | $self->{$key} = $value; | |||||||||||||||||||
| 65 | 5 | return 1; | |||||||||||||||||||
| 66 | } | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | sub Assemble | ||||||||||||||||||||
| 69 | 7 | ▶ | { | ||||||||||||||||||
|
Subroutine
Assemble: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||||||||||||
| 70 | 7 | my $self = shift; | |||||||||||||||||||
| 71 | 7 | my @items; | |||||||||||||||||||
| 72 | 7 | for my $entry (sort keys %{$self}) | |||||||||||||||||||
| 73 | { | ||||||||||||||||||||
| 74 | 142 | push @items, $self->Identifier . $entry .' '. $self->{$entry}; | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | 7 | ▶ | return (join "\n", @items) ."\n" if (@items); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 77 | 0 | return ''; | |||||||||||||||||||
| 78 | } | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | sub Report | ||||||||||||||||||||
| 81 | 0 | ▶ | { | ||||||||||||||||||
|
Subroutine
Report: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||
| 82 | 0 | my $self = shift; | |||||||||||||||||||
| 83 | 0 | my @report; | |||||||||||||||||||
| 84 | 0 | for my $entry (sort keys %{$self}) | |||||||||||||||||||
| 85 | { | ||||||||||||||||||||
| 86 | push @report, [$entry, $self->{$entry}] | ||||||||||||||||||||
| 87 | 0 | ▶ | unless ($self->{$entry} =~ /^(false)? *$/i); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 88 | } | ||||||||||||||||||||
| 89 | 0 | [@report]; | |||||||||||||||||||
| 90 | } | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 10 | 1; | |||||||||||||||||||