imdecode function

Mat imdecode(
  1. Uint8List buf,
  2. int flags, {
  3. Mat? dst,
})

imdecode reads an image from a buffer in memory. The function imdecode reads an image from the specified buffer in memory. If the buffer is too short or contains invalid data, the function returns an empty matrix. @param buf Input array or vector of bytes. @param flags The same flags as in cv::imread, see cv::ImreadModes. For further details, please see: https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga26a67788faa58ade337f8d28ba0eb19e

Implementation

Mat imdecode(Uint8List buf, int flags, {Mat? dst}) {
  final vec = VecUChar.fromList(buf);
  dst ??= Mat.empty();
  cvRun(() => cimgcodecs.Image_IMDecode(vec.ref, flags, dst!.ptr));
  return dst;
}