getTriangleListAsync method
Returns a list of all triangles.
The function gives each triangle as a 6 numbers vector, where each two are one of the triangle vertices.
i.e. p1_x = v0
, p1_y = v1
, p2_x = v2
, p2_y = v3
, p3_x = v4
, p3_y = v5
.
https://docs.opencv.org/4.x/df/dbf/classcv_1_1Subdiv2D.html#a26bfe32209bc8ae9ecc53e93da01e466
Implementation
Future<List<Vec6f>> getTriangleListAsync() async {
final pv = calloc<ffi.Pointer<cvg.Vec6f>>();
final psize = calloc<ffi.Size>();
return cvRunAsync0(
(callback) => cimgproc.cv_Subdiv2D_getTriangleList(ref, pv, psize, callback),
(c) {
final rval = List.generate(psize.value, (i) {
final v = pv.value[i];
return Vec6f(v.val1, v.val2, v.val3, v.val4, v.val5, v.val6);
});
calloc.free(psize);
calloc.free(pv);
return c.complete(rval);
},
);
}