locate method
Returns the location of a point within a Delaunay triangulation.
rval
an integer which specify one of the following five cases for point location:
- The point falls into some facet. The function returns PTLOC_INSIDE and edge will contain one of edges of the facet.
- The point falls onto the edge. The function returns PTLOC_ON_EDGE and edge will contain this edge.
- The point coincides with one of the subdivision vertices. The function returns PTLOC_VERTEX and vertex will contain a pointer to the vertex.
- The point is outside the subdivision reference rectangle. The function returns PTLOC_OUTSIDE_RECT and no pointers are filled.
- One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected, PTLOC_ERROR is returned.
https://docs.opencv.org/4.x/df/dbf/classcv_1_1Subdiv2D.html#aec8f1fd5a802f62faa97520b465897d7
Implementation
// ignore: comment_references
/// [rval] an integer which specify one of the following five cases for point location:
///
/// - The point falls into some facet. The function returns [PTLOC_INSIDE] and edge will contain one of edges of the facet.
/// - The point falls onto the edge. The function returns [PTLOC_ON_EDGE] and edge will contain this edge.
/// - The point coincides with one of the subdivision vertices. The function returns [PTLOC_VERTEX] and vertex will contain a pointer to the vertex.
/// - The point is outside the subdivision reference rectangle. The function returns [PTLOC_OUTSIDE_RECT] and no pointers are filled.
/// - One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error processing mode is selected, [PTLOC_ERROR] is returned.
///
/// https://docs.opencv.org/4.x/df/dbf/classcv_1_1Subdiv2D.html#aec8f1fd5a802f62faa97520b465897d7
(int rval, int edge, int vertex) locate(Point2f pt) {
final pedge = calloc<ffi.Int>();
final pvertex = calloc<ffi.Int>();
final prval = calloc<ffi.Int>();
cvRun(() => cimgproc.cv_Subdiv2D_locate(ref, pt.ref, pedge, pvertex, prval, ffi.nullptr));
final rval = (prval.value, pedge.value, pvertex.value);
calloc.free(pedge);
calloc.free(pvertex);
calloc.free(prval);
return rval;
}