convert method

Tensor convert(
  1. Uint8List src,
  2. int iw,
  3. int ih,
  4. int stride,
  5. Tensor dst,
)

Implementation

Tensor convert(Uint8List src, int iw, int ih, int stride, Tensor dst) {
  final pSrc = calloc<ffi.Uint8>(src.length);
  pSrc.asTypedList(src.length).setAll(0, src);
  final code = c.mnn_cv_image_process_convert(ptr, pSrc, iw, ih, stride, dst.ptr);
  calloc.free(pSrc);
  if (code != c.ErrorCode.MNNC_NO_ERROR) {
    throw MNNException('convert failed');
  }
  return dst;
}