The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

IPA::Region

API

Contains functions that work with region data structures.

contour2region CONTOUR

A contour is a 8-connected point set that is returned by IPA::Global::identify_contours function. A region is a set of horizontal lines, describing an 2D area. The contour2region function converts contour to region and returns the region array and 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.

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
plot DRAWABLE, REGION, OFFSET_X, OFFSET_Y

Plots REGION onto DRAWABLE with OFFSET_X and OFFSET_Y

outline DRAWABLE, REGION, OFFSET_X, OFFSET_Y

Draws outline of REGION onto DRAWABLE with OFFSET_X and OFFSET_Y

combine REGION_1, REGION_2, OP = 'and'

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.

calc_extents REGION

Recalculates extensions of REGION and returns adjusted alias of REGION.

alias REGION

Returns shallow copy of REGION

copy REGION

Returns deep copy of REGION

move REGION, OFFSET_X, OFFSET_Y

Shifts REGION by OFFSET_X and OFFSET_Y