detectBuffer method

Future<List<DocumentResult>> detectBuffer(
  1. Uint8List bytes,
  2. int width,
  3. int height,
  4. int stride,
  5. int format,
  6. int rotation,
)

Document edge detection bytes - bytes of the image. width - width of the image. height - height of the image. stride - stride of the image. format - format of the image. Returns a List of DocumentResult.

Implementation

Future<List<DocumentResult>> detectBuffer(Uint8List bytes, int width,
    int height, int stride, int format, int rotation) async {
  if (_cvr != null) {
    final dsImage = jsify({
      'bytes': bytes,
      'width': width,
      'height': height,
      'stride': stride,
      'format': format,
      'orientation': rotation
    });

    DetectedResult detectedResult = await handleThenable(
            _cvr!.capture(dsImage, 'DetectDocumentBoundaries_Default'))
        as DetectedResult;

    return _createContourList(detectedResult.items);
  }

  return [];
}