The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Imager::LineTrace::Algorithm - Line trace algorithm

SYNOPSIS

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

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>