Herror ::gen_region_polygon_filled (
    Hobject *Region,
    const HTuple &Rows,
    const HTuple &Columns
)
HRegion HRegion::GenRegionPolygonFilled (
    const HTuple &Rows,
    const HTuple &Columns
)

Store a polygon as a ``filled'' region.

The operator ::gen_region_polygon_filled creates a region from a polygon containing the corner points of the region (line and column coordinates) either clockwise or anti-clockwise. Contrary to ::gen_region_polygon a ``filled'' region is returned here.


Attention

All base points must be located within the image format. If no pixels are passed an empty region is created.


Parameters

Region (output_object)
region -> Hobject * : HRegion
Created region.

Rows (input_control)
polygon.y-array -> HTuple.long
Line indices of the base points of the region contour.
Default value: 100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 500
Typical range of values: 0 <= Rows <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Columns (input_control)
polygon.x-array -> HTuple.long
Column indices of the base points of the region contour.
Default value: 100
Suggested values: 0, 10, 30, 50, 100, 200, 300, 500
Typical range of values: 0 <= Columns <= 511 (lin)
Minimum increment: 1
Recommended increment: 1
Number of elements: Columns == Rows


Example
/* Polygon approximation */
T_get_region_polygon(Region,7,&Row,&Column);
T_gen_region_polygon_filled(&Pol,Row,Column);
/* fill up with original gray value */
reduce_domain(Image,Pol,&New);

Result

If the base points are correct the operator ::gen_region_polygon_filled returns the value H_MSG_TRUE. Otherwise an exception handling is raised. If an empty region is created the operator ::set_system('store_gen_empty_region',<true/false>) determines whether the region is returned.


Possible Predecessors

::get_region_polygon, ::draw_polygon


Alternatives

::gen_region_polygon, ::gen_region_points, ::draw_polygon


See also

::gen_region_polygon, ::reduce_domain, ::get_region_polygon, ::gen_region_runs


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH