buildImgVARP function
Implementation
VARP buildImgVARP(Uint8List img, int height, int width, int channels, {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_buildImgVARP(pImg, height, width, channels, flags);
final rval = VARP.fromPointer(pOut);
calloc.free(pImg);
return rval;
}