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

NAME

Imager::Search::Match - Object describing a successful Imager::Search match

DESCRIPTION

Imager::Search::Match is a convenience class that represents the complete geometry of a successful Imager::Search match.

It is returned by the various search methods in Imager::Search.

Imager::Search::Match objects are self-contained and anonymous, they do not retain a connection to the original search context.

METHODS

name

If the Imager::Search::Pattern that was used to generate the match object had a name, then the match will inherit that name as well.

Returns the pattern name as a string, or undef if the pattern was anonymous.

top

The top accessor returns the integer value of the inclusive vertical top of the search match.

bottom

The bottom accessor returns the integer value of the inclusive vertical bottom of the search match.

left

The left accessor returns the integer value of the inclusive horizontal left of the search match.

right

The right accessor returns the integer value of the inclusive horizontal right of the search match.

height

The height accessor returns the integer value of the vertical height of the matched area.

width

The width accessor returns the integer value of the horizontal width of the matched area.

center_x

The center_x accessor returns the integer value of the horizontal centre pixel of the matched image. If the matched image has an even number of horizonal pixels, the value will be rounded to the left.

center_y

The center_y accessor returns the integer value of the vertical centre pixel of the matched image. If the matched image has an even number of vertical pixels, the value will be rounded to the top.

SUPPORT

See the SUPPORT section of the main Imager::Search module.

AUTHOR

Adam Kennedy <adamk@cpan.org>

COPYRIGHT

Copyright 2007 - 2011 Adam Kennedy.

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

The full text of the license can be found in the LICENSE file included with this module.