The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

Imager::LineTrace::Algorithm - Line trace algorithm

SYNOPSIS

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 );

DESCRIPTION

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";

LICENSE

Copyright (C) neko.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

neko <techno.cat.miau@gmail.com>