Mat.fromMat constructor

Mat.fromMat(
  1. Mat mat, {
  2. bool copy = false,
  3. Rect? roi,
})

Implementation

factory Mat.fromMat(Mat mat, {bool copy = false, Rect? roi}) {
  roi ??= Rect(0, 0, mat.cols, mat.rows);
  final p = calloc<cvg.Mat>();
  cvRun(() => ccore.cv_Mat_create_13(mat.ref, roi!.ref, p, ffi.nullptr));
  final dst = Mat._(p, false);
  if (copy) return dst.clone();
  return dst;
}