KMGOCROperation.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // KMGOCROperation.h
  3. // PDF Reader Pro Edition
  4. //
  5. // Created by 万军 on 2020/3/23.
  6. //
  7. /**
  8. Google OCR 转换文本 NSOperation
  9. */
  10. #import <Foundation/Foundation.h>
  11. @class KMGOCROperation;
  12. @protocol KMGOCROperationDelegate <NSObject>
  13. @optional
  14. - (void)GOCROperation:(KMGOCROperation *)operation cancelOCRImageAtIndex:(NSInteger)index;
  15. - (void)GOCROperation:(KMGOCROperation *)operation startOCRImageAtIndex:(NSInteger)index;
  16. - (void)GOCROperation:(KMGOCROperation *)operation finishOCRImageAtIndex:(NSInteger)index results:(NSArray *)results;
  17. - (void)GOCROperation:(KMGOCROperation *)operation failureOCRImageAtIndex:(NSInteger)index error:(NSError *)error;
  18. @end
  19. @interface KMGOCROperation : NSOperation
  20. @property (nonatomic, assign) id<KMGOCROperationDelegate> operationDelegate;
  21. /* 设置的识别语言数组 */
  22. @property (nonatomic, retain) NSMutableArray *selectedLanguages;
  23. /**
  24. Google OCR ONSOperation 初始化.
  25. @param image 需要转换的NSImage对象
  26. @param imageIndex 需要转换的NSImage对象的序号
  27. */
  28. - (instancetype)initWithRecognitionImage:(NSImage *)image withImageIndex:(NSInteger)imageIndex;
  29. @end