Prima::IPA::Region - region data structures
A contour is a 8-connected point set that is returned by Prima::IPA::Global::identify_contours function. A region is a set of horizontal lines, describing an 2D area. The contour2region function converts contour output of Prima::IPA::Global::identify_contours and Prima::IPA::Global::identify_scanlines to a region and returns the region array and its starting y-position. The contour has to contain no less that 2 unique points. The ultimate requirement is that all points have to be 8-connected and the contour contains no holes.
Prima::IPA::Global::identify_contours
Prima::IPA::Global::identify_scanlines
Example:
3.3 3.3-3.3 2.2 4.2 -> 2.2-------4.2 1.1 2.1 3.1 4.1 1.1----------4.1 contour region
The module provides various manipluation routines for these regions.
Converts output of Prima::IPA::Global::identify_contours to a region.
Converts output of Prima::IPA::Global::identify_scanlines to a region.
Plots REGION onto DRAWABLE with OFFSET_X and OFFSET_Y
Same as draw but optimized for speed, and DRAWABLE must be an image.
draw
Draws outline of REGION onto DRAWABLE with OFFSET_X and OFFSET_Y
Combines two regions, REGION_1 and REGION_2, with logic operation, which can be one of 'and', 'or', and 'xor' strings, and returns the result.
Recalculates extensions of REGION and returns adjusted alias of REGION.
Returns shallow copy of REGION
Returns deep copy of REGION
Shifts REGION by OFFSET_X and OFFSET_Y
Returns area occupied by a region
"identify_contours" in Prima::IPA::Global, "identify_scanlines" in Prima::IPA::Global
To install Prima::IPA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima::IPA
CPAN shell
perl -MCPAN -e shell install Prima::IPA
For more information on module installation, please visit the detailed CPAN module installation guide.