processFrame method

Future<Rectangle?> processFrame(
  1. CameraImage image,
  2. int rotation
)

Should called each frame, returns rectangle of recognized doc if any.

Implementation

Future<Rectangle?> processFrame(CameraImage image, int rotation) async {
  //some checks to ignore problems with flutter camera plugin
  if (!image.isEmpty() && _scanner != nullptr) {
    return compute(
        _processFrameAsync, _FrameData(_scanner.address, image, rotation));
  } else {
    return null;
  }
}