<(common.inc.plp)><: my ($page, @feat) = split m{/+}, $Request || 'image'; $page !~ /\W/ or Html(), Abort('Invalid codec type request', 400); @feat or @feat = 'default'; my $title = "$page codecs"; Html({ title => "$title cheat sheet", version => '1.0', description => [ ], keywords => [qw' codec encoder encoding decode file format type mime feature comparison support benchmark compression image audio video '], stylesheet => [qw'light circus dark red'], data => [qw'codec.inc.pl'], raw => '', }); my $info = do "codec-$page.inc.pl"; $info and %{$info} > 1 or Abort("Requested codec type $page not available", '404 request not found', $@ // $!); say "

\u$title

"; say "

$_

" for $info->{intro} // (); my %BOOLSCORE = (y => [5, '✔'], n => [1, '✘'], 0 => [0, 'n/a']); :>
<: my @codecs = sort { $info->{codec}->{$a}->{available} <=> $info->{codec}->{$b}->{available} } keys $info->{codec}->%*; my @codeccols = @{$info->{codec}}{@codecs}; { print ''; my @spans; $spans[ $_->{generation} ]++ for @codeccols; print "" for @spans; } say ''; print ''; while (defined (my $feat = shift @feat)) { my $featinfo = $info->{feature}->{$feat} or next; unshift @feat, @{$_} for $featinfo->{children} // (); $featinfo->{score} or next; print '' if $featinfo->{children}; printf ''; } :>
'; say "\t", '', $_->{name} for @codeccols; print '
', $_->{available} for @codeccols; say '
%s', $featinfo->{name} // $feat; for (@codecs) { my ($score, $data, $title) = map { ref ? @$_ : $_ } $featinfo->{score}->{$_}; if (not defined $data) { if (my $override = $BOOLSCORE{$score}) { ($score, $data) = @{$override}; } else { $data = '•' x ($score - 1); } } printf '', $data; } say '