buildImgVarpYuvNV21 function

VARP buildImgVarpYuvNV21(
  1. Uint8List img,
  2. int height,
  3. int width, {
  4. int flags = IMREAD_COLOR,
})

Implementation

VARP buildImgVarpYuvNV21(Uint8List img, int height, int width, {int flags = IMREAD_COLOR}) {
  final pImg = calloc<ffi.Uint8>(img.length)..asTypedList(img.length).setAll(0, img);
  // This uses `_Const` internally, which will copy data, so it's safe to free `pImg` after calling.
  final pOut = c.mnn_cv_buildImgVarpYuvNV21(pImg, height, width, flags);
  final rval = VARP.fromPointer(pOut);
  calloc.free(pImg);
  return rval;
}