line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Convert::Color::HPLuv; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
23730
|
use 5.008009; |
|
2
|
|
|
|
|
5
|
|
4
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
28
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
40
|
|
6
|
2
|
|
|
2
|
|
691
|
use parent qw/Convert::Color::HSLuv/; |
|
2
|
|
|
|
|
466
|
|
|
2
|
|
|
|
|
9
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
73
|
use Convert::Color::XYZ; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
30
|
|
9
|
2
|
|
|
2
|
|
6
|
use Convert::Color::LUV; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
24
|
|
10
|
2
|
|
|
2
|
|
6
|
use Convert::Color::LCh; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
43
|
|
11
|
2
|
|
|
2
|
|
9
|
use List::Util qw/min/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
94
|
|
12
|
2
|
|
|
2
|
|
8
|
use Math::Trig qw/:pi/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
178
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN { |
15
|
2
|
|
|
2
|
|
298
|
*_get_bounds = *Convert::Color::HSLuv::_get_bounds; ## no critic (ProtectPrivate) |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '1.000001'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->register_color_space('hpluv'); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _intersect_line_line { |
23
|
9180
|
|
|
9180
|
|
6128
|
my ($l1, $l2) = @_; |
24
|
9180
|
|
|
|
|
10960
|
($l1->[1] - $l2->[1]) / ($l2->[0] - $l1->[0]) |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _distance_from_pole { |
28
|
9180
|
|
|
9180
|
|
5901
|
my ($x, $y) = @_; |
29
|
9180
|
|
|
|
|
11938
|
sqrt $x * $x + $y * $y |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub max_chroma_for_lh { |
33
|
1530
|
|
|
1530
|
0
|
1250
|
my ($self, $l) = @_; |
34
|
|
|
|
|
|
|
min map { |
35
|
1530
|
|
|
|
|
2281
|
my ($m, $n) = @$_; |
|
9180
|
|
|
|
|
7053
|
|
36
|
9180
|
|
|
|
|
10705
|
my $x = _intersect_line_line $_, [-1 / $m, 0]; |
37
|
9180
|
|
|
|
|
10127
|
_distance_from_pole $x, $n + $x * $m |
38
|
|
|
|
|
|
|
} _get_bounds $l |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |