VecUChar.fromList constructor

VecUChar.fromList(
  1. List<int> pts
)

Implementation

factory VecUChar.fromList(List<int> pts) {
  final length = pts.length;
  final pdata = calloc<ffi.UnsignedChar>(length);
  pdata.cast<U8>().asTypedList(length).setRange(0, length, pts);
  final p = calloc<cvg.VecUChar>()
    ..ref.length = length
    ..ref.ptr = pdata;
  return VecUChar.fromPointer(p);
}