| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package GD::Image::Orientation; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26001
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
40
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
29
|
|
|
5
|
1
|
|
|
1
|
|
393
|
use GD; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub GD::Image::vertical { |
|
10
|
|
|
|
|
|
|
my $gdo = shift; |
|
11
|
|
|
|
|
|
|
my $ccw = shift || 0; |
|
12
|
|
|
|
|
|
|
my $dosq = shift() ? 0 : 1; |
|
13
|
|
|
|
|
|
|
if(!$gdo->isvertical($dosq)) { |
|
14
|
|
|
|
|
|
|
if($ccw) { return $gdo->copyRotate270 } |
|
15
|
|
|
|
|
|
|
else { return $gdo->copyRotate90 } |
|
16
|
|
|
|
|
|
|
} |
|
17
|
|
|
|
|
|
|
return $gdo; |
|
18
|
|
|
|
|
|
|
} |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub GD::Image::horizontal { |
|
21
|
|
|
|
|
|
|
my $gdo = shift; |
|
22
|
|
|
|
|
|
|
my $ccw = shift || 0; |
|
23
|
|
|
|
|
|
|
my $dosq = shift() ? 0 : 1; |
|
24
|
|
|
|
|
|
|
if(!$gdo->ishorizontal($dosq)) { |
|
25
|
|
|
|
|
|
|
if($ccw) { return $gdo->copyRotate270 } |
|
26
|
|
|
|
|
|
|
else { return $gdo->copyRotate90 } |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
return $gdo; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub GD::Image::isvertical { |
|
32
|
|
|
|
|
|
|
my ($w,$h) = shift->getBounds; |
|
33
|
|
|
|
|
|
|
return 1 if $h >= $w && shift; |
|
34
|
|
|
|
|
|
|
return 1 if $h > $w; |
|
35
|
|
|
|
|
|
|
return 0; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub GD::Image::ishorizontal { |
|
39
|
|
|
|
|
|
|
my ($w,$h) = shift->getBounds; |
|
40
|
|
|
|
|
|
|
return 1 if $w >= $h && shift; |
|
41
|
|
|
|
|
|
|
return 1 if $w > $h; |
|
42
|
|
|
|
|
|
|
return 0; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub GD::Image::issquare { |
|
46
|
|
|
|
|
|
|
my ($w,$h) = shift->getBounds; |
|
47
|
|
|
|
|
|
|
return 1 if $h == $w; |
|
48
|
|
|
|
|
|
|
return 0; |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub GD::Image::orientation { |
|
52
|
|
|
|
|
|
|
my $gdo = shift; |
|
53
|
|
|
|
|
|
|
return 'square' if $gdo->issquare; |
|
54
|
|
|
|
|
|
|
return 'vertical' if $gdo->isvertical; |
|
55
|
|
|
|
|
|
|
return 'horizontal' if $gdo->ishorizontal; |
|
56
|
|
|
|
|
|
|
return undef; # should never get here |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
|
60
|
|
|
|
|
|
|
__END__ |