| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# Display P3, D65, linear (no transfer) |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Graphics::Toolkit::Color::Space::Instance::DisplayP3Linear; |
|
5
|
15
|
|
|
15
|
|
441429
|
use v5.12; |
|
|
15
|
|
|
|
|
73
|
|
|
6
|
15
|
|
|
15
|
|
93
|
use warnings; |
|
|
15
|
|
|
|
|
35
|
|
|
|
15
|
|
|
|
|
926
|
|
|
7
|
15
|
|
|
15
|
|
699
|
use Graphics::Toolkit::Color::Space qw/mult_matrix_vector_3/; |
|
|
15
|
|
|
|
|
32
|
|
|
|
15
|
|
|
|
|
5575
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my @D65 = (0.9504559271, 1, 1.0890577508); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub from_xyz { |
|
12
|
4
|
|
|
4
|
0
|
10
|
my ($xyz) = shift; |
|
13
|
4
|
|
|
|
|
24
|
$xyz->[$_] *= $D65[ $_ ] for 0 .. 2; |
|
14
|
4
|
|
|
|
|
23
|
return [ mult_matrix_vector_3( [[ 2.4934969119, -0.9313836179, -0.4027107845 ], |
|
15
|
|
|
|
|
|
|
[ -0.8294889696, 1.7626640603, 0.0236246858 ], |
|
16
|
|
|
|
|
|
|
[ 0.0358458302, -0.0761723893, 0.9568845240 ], ], @$xyz) ]; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
sub to_xyz { |
|
19
|
4
|
|
|
4
|
0
|
9
|
my ($lrgb) = shift; |
|
20
|
4
|
|
|
|
|
21
|
my @xyz = mult_matrix_vector_3([[ 0.4865709486, 0.2656676932, 0.1982172852 ], |
|
21
|
|
|
|
|
|
|
[ 0.2289745641, 0.6917385218, 0.0792869141 ], |
|
22
|
|
|
|
|
|
|
[ 0.0000000000, 0.0451133819, 1.0439443689 ], ], @$lrgb); |
|
23
|
4
|
|
|
|
|
26
|
$xyz[$_] /= $D65[ $_ ] for 0 .. 2; |
|
24
|
4
|
|
|
|
|
19
|
return \@xyz; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Graphics::Toolkit::Color::Space->new( |
|
28
|
|
|
|
|
|
|
name => 'display-p3-linear', |
|
29
|
|
|
|
|
|
|
alias => 'Linear Display P3', |
|
30
|
|
|
|
|
|
|
axis => [qw/red green blue/], |
|
31
|
|
|
|
|
|
|
precision => 6, |
|
32
|
|
|
|
|
|
|
convert => {XYZ => [\&to_xyz, \&from_xyz]}, |
|
33
|
|
|
|
|
|
|
); |