| 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
| |||||||||||
| 52 | 1 | my $type = 'Negative'; | |||||||||
| 53 | 1 | ▶ | $type = 'Positive' if $self->{t} == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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; | |||||||||