FIRVisionTextLine.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #import <CoreGraphics/CoreGraphics.h>
  2. #import <Foundation/Foundation.h>
  3. @class FIRVisionTextElement;
  4. @class FIRVisionTextRecognizedLanguage;
  5. NS_ASSUME_NONNULL_BEGIN
  6. /**
  7. * A text line recognized in an image that consists of an array of elements.
  8. */
  9. NS_SWIFT_NAME(VisionTextLine)
  10. @interface FIRVisionTextLine : NSObject
  11. /**
  12. * String representation of the text line that was recognized.
  13. */
  14. @property(nonatomic, readonly) NSString *text;
  15. /**
  16. * An array of text elements that make up the line.
  17. */
  18. @property(nonatomic, readonly) NSArray<FIRVisionTextElement *> *elements;
  19. /**
  20. * The rectangle that contains the text line 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 line. 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 line 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 line. 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