| 1 | package Imager::LineTrace::Figure; | ||||||||||||||||||
| 2 | 2 | ▶ | use 5.008001; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 5 | |||||||||||||||||||
| 6 | 11 | ▶ | sub new { | ||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||
| 7 | 11 | my $pkg = shift; | |||||||||||||||||
| 8 | 11 | my $args_ref = shift; | |||||||||||||||||
| 9 | |||||||||||||||||||
| 10 | my @points = map { | ||||||||||||||||||
| 11 | 23 | bless $_, 'Imager::LineTrace::Point'; | |||||||||||||||||
| 12 | 11 | } @{$args_ref->{points}}; | |||||||||||||||||
| 13 | |||||||||||||||||||
| 14 | 11 | my $type = "Undefined"; | |||||||||||||||||
| 15 | 11 | ▶ | if ( $args_ref->{is_closed} ) { | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 16 | 1 | $type = "Polygon"; | |||||||||||||||||
| 17 | } | ||||||||||||||||||
| 18 | elsif ( 3 <= scalar(@points) ) { | ||||||||||||||||||
| 19 | 4 | $type = "Polyline"; | |||||||||||||||||
| 20 | } | ||||||||||||||||||
| 21 | elsif ( 2 <= scalar(@points) ) { | ||||||||||||||||||
| 22 | 1 | $type = "Line"; | |||||||||||||||||
| 23 | } | ||||||||||||||||||
| 24 | else { | ||||||||||||||||||
| 25 | 5 | $type = "Point"; | |||||||||||||||||
| 26 | } | ||||||||||||||||||
| 27 | |||||||||||||||||||
| 28 | bless { | ||||||||||||||||||
| 29 | points => \@points, | ||||||||||||||||||
| 30 | is_closed => $args_ref->{is_closed}, | ||||||||||||||||||
| 31 | value => $args_ref->{value}, | ||||||||||||||||||
| 32 | 11 | type => $type | |||||||||||||||||
| 33 | }, $pkg; | ||||||||||||||||||
| 34 | } | ||||||||||||||||||
| 35 | |||||||||||||||||||
| 36 | 2 | 1; | |||||||||||||||||
| 37 | __END__ | ||||||||||||||||||