ImageEn, unit IEVision

TIEVisionDrawing.fillConvexPoly

TIEVisionDrawing.fillConvexPoly

Declaration

procedure fillConvexPoly(image: TIEVisionImage; points: TIEVisionVectorPoint; const color: TIEVisionScalar; linetype: int32_t = 8; shift: int32_t = 0); safecall;

Description

Fill a convex polygon, e.g. a triangle or a convex hull. This is faster than fillPoly.
It also works for any polygon whose edges cross each horizontal line no more than twice.
Parameter Description
image Destination image (8 bit or more, 1 to 4 channels)
points Polygon vertices
color Fill color in B:G:R orientation, e.g. for blue: IEVisionScalar(255, 0, 0). For a gray scale mask, e.g. IEVisionScalar(255, 0, 0)
linetype 4 or 8 (connectivity of the edge pixels), or 16 for an antialiased edge
shift Number of fractional bits in the point coordinates (0..16), for sub-pixel positions

Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr

Example

// Create a mask from the convex hull of some points
mask := IEVisionLib().createImage( ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height, ievUINT8, 1 );
mask.setZero();
IEVisionLib().createDrawing().fillConvexPoly( mask, IEVisionLib().createMath().convexHull( points ), IEVisionScalar( 255, 0, 0 ));

See Also

◼fillPoly
◼convexHull