Imager::APIRef - Imager's C API - reference.
i_color color; color.rgba.r = 255; color.rgba.g = 0; color.rgba.b = 255; double x[] = { ... }; double y[] = { ... }; i_polygon_t poly; poly.count = sizeof(x) / sizeof(*x); poly.x = x; poly.y = y;
EOS
for my $cat (sort { lc $a cmp lc $b } keys %cats) { print OUT "\n # $cat\n"; my @funcs = @{$cats{$cat}}; my %orig; @orig{@funcs} = 0 .. $#funcs; @funcs = sort { $order{$a} <=> $order{$b} || $orig{$a} <=> $orig{$b} } @funcs; for my $func (grep $funcsyns{$_}, @funcs) { my $syn = $funcsyns{$func}; $syn =~ s/^/ /gm; print OUT $syn; } }
print OUT <<'EOS';
my %undoc = %funcs;
for my $cat (sort { lc $a cmp lc $b } keys %cats) { print OUT "=head2 $cat\n\n=over\n\n"; my @ordered_funcs = sort { $order{$a} <=> $order{$b} || lc $a cmp lc $b } @{$cats{$cat}}; for my $func (@ordered_funcs) { print OUT @{$alldocs{$func}}, "\n"; print OUT "=for comment\nFrom: $from{$func}\n\n"; delete $undoc{$func}; } print OUT "\n=back\n\n"; }
# see if we have an uncategorised section if (grep $alldocs{$_}, keys %undoc) { print OUT "=head2 Uncategorized functions\n\n=over\n\n"; #print join(",", grep !exists $order{$_}, @funcs), "\n"; for my $func (sort { $order{$a} <=> $order{$b} || $a cmp $b } grep $undoc{$_} && $alldocs{$_}, @funcs) { print OUT @{$alldocs{$func}}, "\n"; print OUT "=for comment\nFrom: $from{$func}\n\n"; delete $undoc{$func}; } print OUT "\n\n=back\n\n"; }
if (keys %undoc) { print OUT <<'EOS';
The following API functions are undocumented so far, hopefully this will change:
print OUT "=item *\n\nB<$_>\n\n" for sort keys %undoc; print OUT "\n\n=back\n\n"; }
Tony Cook <tonyc@cpan.org>
Imager, Imager::API, Imager::ExtUtils, Imager::Inline
apidocs.perl - parse Imager's source for POD documenting the C API
perl apidocs.perl lib/Imager/APIRef.pod
Parses Imager's C sources, including .c, .h and .im files searching for function documentation.
Besides the normal POD markup, the following can be included:
The category the function should be in.
Sample code using the function to include in the Imager::APIRef SYNOPSIS
Allows a function to be listed out of order. If this isn't specified it defaults to 50, so a value of 10 will cause the function to be listed at the beginning of its category, or 90 to list at the end.
Functions with equal order are otherwise ordered by name.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Imager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager
CPAN shell
perl -MCPAN -e shell install Imager
For more information on module installation, please visit the detailed CPAN module installation guide.