File Coverage

lib/Graphics/Toolkit/Color/Space/Instance/CIERGB.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 17 19 89.4


line stmt bran cond sub pod time code
1              
2             # CIE 1931 RGB (linear with illuminant E)
3              
4             package Graphics::Toolkit::Color::Space::Instance::CIERGB;
5 15     15   269449 use v5.12;
  15         66  
6 15     15   120 use warnings;
  15         62  
  15         948  
7 15     15   557 use Graphics::Toolkit::Color::Space qw/mult_matrix_vector_3/;
  15         32  
  15         3699  
8              
9             sub from_xyz {
10             [ mult_matrix_vector_3( [[ 2.3706743, -0.9000405, -0.4706338 ],
11             [ -0.5138850, 1.4253036, 0.0885814 ],
12 3     3 0 12 [ 0.0052982, -0.0146949, 1.0093968 ] ], @{$_[0]}) ];
  3         14  
13             }
14             sub to_xyz {
15             [ mult_matrix_vector_3( [[ 0.4887180, 0.3106803, 0.2006017 ],
16             [ 0.1762044, 0.8129847, 0.0108109 ],
17 3     3 0 10 [ 0.0000000, 0.0102048, 0.9897952 ] ], @{$_[0]}) ];
  3         10  
18             }
19              
20             Graphics::Toolkit::Color::Space->new(
21             name => 'CIERGB',
22             axis => [qw/red green blue/],
23             precision => 6,
24             convert => {XYZ => [\&to_xyz, \&from_xyz]},
25             );