| 1 | package Panotools::Script::Line::Mask; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use Panotools::Script::Line; | ||
| 6 | |||
| 7 | use vars qw /@ISA/; | ||
| 8 | @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 | { | ||
| 36 | my $self = shift; | ||
| 37 | } | ||
| 38 | |||
| 39 | sub _valid { return '^([itp])(.*)' } | ||
| 40 | |||
| 41 | sub Identifier | ||
| 42 | { | ||
| 43 | my $self = shift; | ||
| 44 | return "k"; | ||
| 45 | } | ||
| 46 | |||
| 47 | sub Report | ||
| 48 | { | ||
| 49 | my $self = shift; | ||
| 50 | my @report; | ||
| 51 | return [] unless defined $self->{t}; | ||
| 52 | my $type = 'Negative'; | ||
| 53 | $type = 'Positive' if $self->{t} == 1; | ||
| 54 | my $nodes = $self->{p}; | ||
| 55 | $nodes =~ s/(^"|"$)//; | ||
| 56 | my @nodes = split ' ', $nodes; | ||
| 57 | |||
| 58 | push @report, ['Mask type', $type]; | ||
| 59 | push @report, ['Nodes', scalar @nodes / 2]; | ||
| 60 | [@report]; | ||
| 61 | } | ||
| 62 | |||
| 63 | 1; |