VecVecPoint2f.generate constructor
VecVecPoint2f.generate(
- int length,
- VecPoint2f generator(
- int i
- bool dispose = true,
Implementation
factory VecVecPoint2f.generate(int length, VecPoint2f Function(int i) generator, {bool dispose = true}) {
final pp = calloc<cvg.VecVecPoint2f>()..ref.length = length;
pp.ref.ptr = calloc<cvg.VecPoint2f>(length);
for (var i = 0; i < length; i++) {
final v = generator(i);
pp.ref.ptr[i] = v.ref;
if (dispose) v.dispose();
}
return VecVecPoint2f.fromPointer(pp);
}