Imager::LineTrace::Algorithm - Line trace algorithm
use Imager::LineTrace::Algorithm; my @pixels = Imager::LineTrace::Figure->new( [ 1, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 1 ] ); my %args = ( ignore => 0 ); my $figures_ref = Imager::LineTrace::Algorithm::search( \@pixels, \%args );
Trace algorithm for Imager::LineTracer.
RETURN DATA
# $figures_ref is ARRAY reference. my $figures_ref = Imager::LineTrace::Algorithm::search( \@pixels, \%args ); # $figure_ref is HASH reference. my $figure_ref = $figures_ref->[0]; # $figure_ref->{points} is ARRAY reference. foreach my $point (@{$figure_ref->{points}}) { printf( "x = %d, y = %d\n", $point->[0], $point->[1] ); } # Traced pixel value. print $figure_ref->{value}, "\n"; # Figure is closed. print $figure_ref->{is_closed}, "\n";
Copyright (C) neko.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
neko <techno.cat.miau@gmail.com>
To install Imager::LineTrace, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager::LineTrace
CPAN shell
perl -MCPAN -e shell install Imager::LineTrace
For more information on module installation, please visit the detailed CPAN module installation guide.