Branch Coverage

lib/ICC/Support/Color.pm
Criterion Covered Total %
branch 2 324 0.6


line true false branch
73 0 1 if (@_ == 1 and ref $_[0] eq 'HASH') { }
0 1 elsif (@_) { }
100 0 0 if (@_)
103 0 0 if (@_ == 1 and ref $_[0] eq 'HASH') { }
136 0 0 if (@_)
139 0 0 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
148 0 0 if (@{$array;})
151 0 0 unless @{$array;} == 2
154 0 0 unless ref $array->[0] eq 'ARRAY' and 3 == @{$array->[0];} and 3 == grep({&Scalar::Util::looks_like_number($_);} @{$$array[0];}) and $array->[0][2]
157 0 0 unless ($sx = ICC::Shared::round(($array->[0][1] - $array->[0][0]) / $array->[0][2])) > 0
160 0 0 unless ref $array->[1] eq 'ARRAY' and $#{$$array[1];} == $sx and @{$array->[1];} == grep({&Scalar::Util::looks_like_number($_);} @{$$array[1];})
166 0 0 if (defined $self->[2][0])
203 0 0 if (@_)
206 0 0 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
215 0 0 if (@{$array;})
218 0 0 unless @{$array;} == 2
221 0 0 unless ref $array->[0] eq 'ARRAY' and 3 == @{$array->[0];} and 3 == grep({&Scalar::Util::looks_like_number($_);} @{$$array[0];}) and $array->[0][2]
224 0 0 unless ($sx = ICC::Shared::round(($array->[0][1] - $array->[0][0]) / $array->[0][2])) > 0
227 0 0 unless ref $array->[1] eq 'ARRAY' || UNIVERSAL::isa($array->[1], 'Math::Matrix') and ref $array->[1][0] eq 'ARRAY' and $#{$$array[1][0];} == $sx and @{$array->[1][0];} == grep({&Scalar::Util::looks_like_number($_);} @{$$array[1][0];})
233 0 0 if (defined $self->[1][0])
269 0 0 if (@_)
272 0 0 if (@_ == 1 and ref $_[0] eq 'ARRAY') { }
281 0 0 if (@{$array;})
284 0 0 unless @{$array;} == 2
287 0 0 unless ref $array->[0] eq 'ARRAY' and 3 == @{$array->[0];} and 3 == grep({&Scalar::Util::looks_like_number($_);} @{$$array[0];}) and $array->[0][2]
290 0 0 unless ($sx = ICC::Shared::round(($array->[0][1] - $array->[0][0]) / $array->[0][2])) > 0
293 0 0 unless ref $array->[1] eq 'ARRAY' || UNIVERSAL::isa($array->[1], 'Math::Matrix') and ref $array->[1][0] eq 'ARRAY' and $#{$$array[1][0];} == $sx and @{$array->[1][0];} == grep({&Scalar::Util::looks_like_number($_);} @{$$array[1][0];})
336 0 0 defined($code = _encoding($self, $hash)) ? :
354 0 0 ref $_[-1] eq 'HASH' ? :
357 0 0 unless defined $_[0][3][0] and defined $_[0][3][1]
360 0 0 if (@_ == $h + 2 and UNIVERSAL::isa($_[1], 'Math::Matrix')) { }
0 0 elsif (@_ == $h + 2 and ref $_[1] eq 'ARRAY') { }
0 0 elsif (@_ == $h + 1 + grep({&Scalar::Util::looks_like_number($_);} @_)) { }
369 0 0 if (not ref $_[1][0] and @{$_[1];} == grep({&Scalar::Util::looks_like_number($_);} @{$_[1];})) { }
0 0 elsif (ref $_[1][0] eq 'ARRAY' and @{$_[1];} == grep({&Scalar::Util::looks_like_number($_->[0]) if ref $_ eq 'ARRAY';} @{$_[1];})) { }
375 0 0 if ref $_ eq 'ARRAY'
420 0 0 unless $range = $hash->{'range'} || $$srh{@{$in;}}
423 0 0 if ($range->[2] == $self->[3][0][2]) { }
0 0 elsif ($range->[2] > $self->[3][0][2]) { }
442 0 0 if (defined($encoding = $hash->{'encoding'}) and $encoding ne 'XYZ' and $encoding ne 'RGBV')
445 0 0 if ($encoding eq 'ICC_XYZ' and @{$jac;} == 3) { }
0 0 elsif ($encoding eq 'ICC_XYZNumber' and @{$jac;} == 3) { }
0 0 elsif ($encoding eq 'xyz' and @{$jac;} == 3) { }
0 0 elsif ($encoding eq 'unit' and @{$jac;} == 4) { }
0 0 elsif ($encoding eq 'density' and @{$jac;} == 4) { }
480 0 0 unless $self->[5][0] and $self->[5][1] and $self->[5][2]
521 0 0 unless $out->[0] and $out->[1] and $out->[2] and $out->[3]
551 0 0 if (wantarray) { }
578 0 0 ref $p eq 'ARRAY' ? :
0 0 defined $p ? :
581 0 0 defined $p->[0] && !ref($p->[0]) ? :
603 0 0 if ref $_[-1] eq 'HASH'
625 0 0 unless $range = $hash->{'range'} || $$srh{@{$in;}}
628 0 0 if ($range->[2] == $self->[3][0][2]) { }
0 0 elsif ($range->[2] > $self->[3][0][2]) { }
647 0 0 if ($lapack) { }
665 0 0 defined($code = _encoding($self, $hash)) ? :
684 0 0 unless $range = $hash->{'range'} || $$srh{@{$in->[0];}}
687 0 0 if ($range->[2] == $self->[3][0][2]) { }
0 0 elsif ($range->[2] > $self->[3][0][2]) { }
706 0 0 if ($lapack) { }
729 0 0 if ($code = _encoding($self, $hash))
742 0 0 UNIVERSAL::isa($in, 'Math::Matrix') ? :
771 0 0 if (@{$in;} == grep({&Scalar::Util::looks_like_number($_);} @{$in;})) { }
782 0 0 if (ref $in->[$i] eq 'ARRAY') { }
813 0 0 if (defined $self->[4][0] and $self->[4][0][0] == $range_data->[0] and $self->[4][0][1] == $range_data->[1] and $self->[4][0][2] == $range_data->[2])
833 0 0 if ($method eq 'linear') { }
0 0 elsif ($method eq 'cspline') { }
0 0 elsif ($method eq 'lagrange') { }
858 0 0 if ($lapack) { }
864 0 0 if ($bandpass)
877 0 0 if ($bandpass)
914 0 0 if ($bandpass eq 'astm') { }
925 0 0 if ($method eq 'linear') { }
0 0 elsif ($method eq 'cspline') { }
0 0 elsif ($method eq 'lagrange') { }
950 0 0 if ($bandpass eq 'triangle') { }
0 0 elsif ($bandpass eq 'trapezoid') { }
0 0 elsif (ref $bandpass eq 'ARRAY' and $#{$bandpass;} == $jx) { }
981 0 0 if ($lapack) { }
1024 0 0 if ($i == $j) { }
0 0 elsif (abs $i - $j == 1 and $i > 0 and $i < $ix) { }
0 0 elsif (abs $i - $j == 2 and $i > 0 and $i < $ix) { }
1026 0 0 if ($i == 0 or $i == $ix) { }
0 0 elsif ($i == 1 or $i == $ix - 1) { }
1043 0 0 if ($j == 0 or $j == $ix) { }
1083 0 0 unless $shape >= 0 and $shape <= 1
1086 0 0 unless $ix == int $ix and not $ix % 4
1089 0 0 if ($shape) { }
1108 0 0 $v > 1 ? :
0 0 $v < 0 ? :
1132 0 0 unless @{$bpf;} % 2
1135 0 0 unless $ix == int $ix and $ix >= 0
1180 0 0 if (defined $self->[4][0] and $self->[4][0][0] == $range_data->[0] and $self->[4][0][1] == $range_data->[1] and $self->[4][0][2] == $range_data->[2])
1197 0 0 unless abs $off - ICC::Shared::round($off) < 1e-12
1203 0 0 if ($bandpass and $bandpass ne 'six')
1206 0 0 if ($lapack) { }
1247 0 0 if ($range_matrix->[0] < $range_data->[0]) { }
0 0 elsif ($range_matrix->[0] > $range_data->[0]) { }
1267 0 0 if ($range_matrix->[1] > $range_data->[1]) { }
0 0 elsif ($range_matrix->[1] < $range_data->[1]) { }
1306 0 0 if (defined $self->[0]{'cwf_range'}) { }
0 0 elsif ($self->[2][0][2] != ($inc = $self->[0]{'increment'} // 1)) { }
1334 0 0 if ($self->[0]{'observer_exp'})
1349 0 0 if (defined $self->[1][0]) { }
1355 0 0 $self->[0]{'imethod'} // ($smooth == 0 || $smooth > 0.001) ? :
1358 0 0 if (defined($bandpass = $self->[0]{'ibandpass'})) { }
1374 0 0 if ($method eq 'linear') { }
0 0 elsif ($method eq 'cspline') { }
0 0 elsif ($method eq 'lagrange') { }
1466 0 0 if (not @{$array;}) { }
0 0 elsif (@files = grep({-f $_;} File::Glob::bsd_glob($array->[0]))) { }
0 0 elsif (@files = grep({-f $_;} File::Glob::bsd_glob(ICC::Shared::getICCPath("Data/$array->[0]_illums_*.yml")))) { }
0 0 elsif (@{$array;} == grep({ref $_ eq 'ARRAY';} @{$array;})) { }
1478 0 0 defined $array->[1] ? :
1481 0 0 unless &Scalar::Util::looks_like_number($s) and $s == int $s and $s > 0 and $s <= $illum->size
1487 0 0 unless $self->[1][1] = $illum->spectral([$s])->[0]
1502 0 0 unless $self->[1][1] = $$illum{$array->[1]}
1508 0 0 unless ref $array->[0] eq 'ARRAY' and 3 == @{$array->[0];} and 3 == grep({&Scalar::Util::looks_like_number($_);} @{$$array[0];}) and $array->[0][2]
1511 0 0 unless ($sx = ICC::Shared::round(($array->[0][1] - $array->[0][0]) / $array->[0][2])) > 0
1514 0 0 unless ref $array->[1] eq 'ARRAY' and $#{$$array[1];} == $sx and @{$array->[1];} == grep({&Scalar::Util::looks_like_number($_);} @{$$array[1];})
1527 0 0 defined $hash->{'increment'} ? :
1530 0 0 if ($inc == 1) { }
0 0 elsif ($inc == 5) { }
1555 0 0 defined $hash->{'observer'} ? :
1558 0 0 if (ref $obs eq 'ARRAY') { }
1561 0 0 unless @{$obs;} == 2
1565 0 0 unless ref $obs->[0] eq 'ARRAY' and @{$obs->[0];} == grep({&Scalar::Util::looks_like_number($_);} @{$$obs[0];}) and @{$obs->[0];} == 3 and $obs->[0][2] and not +($obs->[0][1] - $obs->[0][0]) % $obs->[0][2]
1568 0 0 unless ($sx = ICC::Shared::round(($obs->[0][1] - $obs->[0][0]) / $obs->[0][2])) > 0
1572 0 0 unless ref $obs->[1] eq 'ARRAY' || UNIVERSAL::isa($obs->[1], 'Math::Matrix') and ref $obs->[1][0] eq 'ARRAY' and $#{$$obs[1][0];} == $sx and @{$obs->[1][0];} == grep({&Scalar::Util::looks_like_number($_);} @{$$obs[1][0];})
1580 0 0 unless $key = {'2', 'CIE1931', '10', 'CIE1964', '2P', 'CIE2012D2', '10P', 'CIE2012D10'}->{$obs}
1613 0 0 if (defined $hash->{'increment'})
1619 0 0 unless @m = grep({$hash->{'increment'} eq $inc[$_];} 0 .. $#inc)
1622 0 0 @m ? :
1627 0 0 if (defined $hash->{'observer'})
1633 0 0 unless @m = grep({$hash->{'observer'} eq $obs[$_];} 0 .. $#obs)
1636 0 0 @m ? :
1641 0 0 if (defined $hash->{'illuminant'}) { }
1647 0 0 unless @m = grep({$hash->{'illuminant'} eq $illum[$_];} 0 .. $#illum)
1650 0 0 @m ? :
1661 0 0 defined $hash->{'bandpass'} && $hash->{'bandpass'} eq 'six' ? :
1705 0 0 if (defined $hash->{'status'})
1708 0 0 unless @m = grep({$hash->{'status'} eq $_;} 'A', 'M', 'T', 'E', 'I')
1711 0 0 @m ? :
1716 0 0 if (defined $hash->{'increment'})
1719 0 0 unless @m = grep({$hash->{'increment'} eq $_;} '10', '20')
1722 0 0 @m ? :
1765 0 0 if @{$v;} < 3
1779 0 0 $s ? :
1795 0 0 if (defined($encoding = $hash->{'encoding'}) and not $encoding =~ /^(XYZ|RGBV|linear)$/) { }
1801 0 0 if ($encoding eq 'ICC_XYZ' and $size == 3) { }
0 0 elsif ($encoding eq 'ICC_XYZNumber' and $size == 3) { }
0 0 elsif ($encoding eq 'xyz' and $size == 3) { }
0 0 elsif ($encoding eq 'unit' and $size == 4) { }
0 0 elsif ($encoding eq 'density' and $size == 4) { }
1816 0 0 unless $self->[5][0] and $self->[5][1] and $self->[5][2]
1831 0 0 $_ > 0 ? :
1863 0 0 if (defined($range = $hash->{'range'}))
1866 0 0 unless ref $range eq 'ARRAY' and 3 == @{$range;} and 3 == grep({&Scalar::Util::looks_like_number($_);} @{$range;})
1872 0 0 unless $ox > 0 and abs $ox * $range->[2] - $range->[1] + $range->[0] < 1e-12 and $range->[2] > 0
1880 0 0 if (defined $hash->{'status'} and not ref $hash->{'status'}) { }
0 0 elsif (defined $hash->{'illuminant'} and ref $hash->{'illuminant'} eq 'ARRAY') { }