FIRVisionTextBlock.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #import <CoreGraphics/CoreGraphics.h>
  2. #import <Foundation/Foundation.h>
  3. @class FIRVisionTextLine;
  4. @class FIRVisionTextRecognizedLanguage;
  5. NS_ASSUME_NONNULL_BEGIN
  6. /**
  7. * A text block recognized in an image that consists of an array of text lines.
  8. */
  9. NS_SWIFT_NAME(VisionTextBlock)
  10. @interface FIRVisionTextBlock : NSObject
  11. /**
  12. * String representation of the text block that was recognized.
  13. */
  14. @property(nonatomic, readonly) NSString *text;
  15. /**
  16. * An array of text lines that make up the block.
  17. */
  18. @property(nonatomic, readonly) NSArray<FIRVisionTextLine *> *lines;
  19. /**
  20. * The rectangle that contains the text block relative to the image in the default coordinate space.
  21. */
  22. @property(nonatomic, readonly) CGRect frame;
  23. /**
  24. * An array of recognized languages in the text block. On-device text recognizers only detect
  25. * Latin-based languages, while cloud text recognizers can detect multiple languages. If no
  26. * languages are recognized, the array is empty.
  27. */
  28. @property(nonatomic, readonly) NSArray<FIRVisionTextRecognizedLanguage *> *recognizedLanguages;
  29. /**
  30. * The four corner points of the text block in clockwise order starting with the top left point
  31. * relative to the image in the default coordinate space. The `NSValue` objects are `CGPoint`s. For
  32. * cloud text recognizers, the array is `nil`.
  33. */
  34. @property(nonatomic, readonly, nullable) NSArray<NSValue *> *cornerPoints;
  35. /**
  36. * The confidence of the recognized text block. The value is `nil` for all text recognizers except
  37. * for cloud text recognizers with model type `VisionCloudTextModelType.dense`.
  38. */
  39. @property(nonatomic, readonly, nullable) NSNumber *confidence;
  40. /**
  41. * Unavailable.
  42. */
  43. - (instancetype)init NS_UNAVAILABLE;
  44. @end
  45. NS_ASSUME_NONNULL_END