codec: compare 7 image encoding formats
[sheet.git] / codec.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'Codecs',
5         version => '1.0',
6         description => [
7         ],
8         keywords => [qw'
9         '],
10         stylesheet => [qw'light circus dark red'],
11         data => [qw'codec.inc.pl'],
12 });
13
14 my $info = do 'codec.inc.pl';
15 $info and %{$info} > 1 or Abort("cannot open operator include", 500, $@ // $!);
16
17 my %BOOLSCORE = (y => 5, n => 1);
18 :>
19 <h1>Image codecs</h1>
20
21 <div class="section">
22 <table class="mapped">
23         <col><colgroup span=2><colgroup span=2><colgroup span=3>
24 <thead><tr><th rowspan=2>feature
25 <:
26 my @codecs = sort {
27         $info->{codec}->{$a}->{available} <=> $info->{codec}->{$b}->{available}
28 } keys $info->{codec}->%*;
29
30 print '<th>', $_->{name} for @{$info->{codec}}{@codecs};
31 print "\n<tr>";
32 print '<td>', $_->{available} for @{$info->{codec}}{@codecs};
33 say '</thead>';
34
35 print '<tbody>';
36 for my $feat (sort keys %{$info->{feature}}) {
37         my $featinfo = $info->{feature}->{$feat};
38         printf '<tr><th>%s', $featinfo->{name} // $feat;
39         printf('<td class="l%d">%s',
40                 (map { $_ && $BOOLSCORE{$_} || $_ || 0 } $featinfo->{score}->{$_}),
41                 $featinfo->{data}->{$_} // (map {
42                         $BOOLSCORE{$_} ? ($_ eq 'y' ? '✔' : '✘') : '•' x ($_ - 1)
43                 } $featinfo->{score}->{$_}),
44         ) for @codecs;
45         say '</td>';
46 }
47
48 :></table>
49 </div>
50