Algorithm-BreakOverlappingRectangles
view release on metacpan or search on metacpan
lib/Algorithm/BreakOverlappingRectangles.pm view on Meta::CPAN
Returns the set of non-overlapping rectangles. Every entry is an array
of the form C<[$x0, $y0, $x1, $y1, @names]>.
=item $bor->get_rectangles_as_array_ref()
Returns an array ref (actually a tied one) containing the broken
rectangles.
Rectangles are stored inside Algorithm::BreakOverlappingRectangles
objects as packed data to reduce memory comsumption, but calling the
C<get_rectangles> method expands them and so can eat lots of memory
when the number of rectangles is high. This alternative method returns
a reference to a tied array that unpacks the rectangles on the fly.
For instance:
my $r = $abor->get_rectangles_as_array_ref;
for (@$r) {
print "@$_\n";
}
( run in 1.699 second using v1.01-cache-2.11-cpan-5b529ec07f3 )