FIRVisionDocumentTextRecognizer.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #import <Foundation/Foundation.h>
  2. @class FIRVisionDocumentText;
  3. @class FIRVisionImage;
  4. NS_ASSUME_NONNULL_BEGIN
  5. /**
  6. * The callback to invoke when the document text recognition completes.
  7. *
  8. * @param text Recognized document text in the image or `nil` if there was an error.
  9. * @param error The error or `nil`.
  10. */
  11. typedef void (^FIRVisionDocumentTextRecognitionCallback)(FIRVisionDocumentText *_Nullable text,
  12. NSError *_Nullable error)
  13. NS_SWIFT_NAME(VisionDocumentTextRecognitionCallback);
  14. /**
  15. * A cloud document text recognizer that recognizes text in an image.
  16. */
  17. NS_SWIFT_NAME(VisionDocumentTextRecognizer)
  18. @interface FIRVisionDocumentTextRecognizer : NSObject
  19. /**
  20. * Unavailable. Use `Vision` factory methods.
  21. */
  22. - (instancetype)init NS_UNAVAILABLE;
  23. /**
  24. * Processes the given image for cloud document text recognition.
  25. *
  26. * @param image The image to process for recognizing document text.
  27. * @param completion Handler to call back on the main queue when document text recognition
  28. * completes.
  29. */
  30. - (void)processImage:(FIRVisionImage *)image
  31. completion:(FIRVisionDocumentTextRecognitionCallback)completion
  32. NS_SWIFT_NAME(process(_:completion:));
  33. @end
  34. NS_ASSUME_NONNULL_END