12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // KMOCROperation.h
- // PDF Reader Pro Edition
- //
- // Created by 万军 on 2020/3/23.
- //
- /**
- 无法网络翻墙 OCR 转换文本 NSOperation
- */
- #import <Foundation/Foundation.h>
- @class KMOCROperation;
- @protocol KMOCROperationDelegate <NSObject>
- @optional
- - (void)OCROperation:(KMOCROperation *)operation cancelOCRImageAtIndex:(NSInteger)index;
- - (void)OCROperation:(KMOCROperation *)operation startOCRImageAtIndex:(NSInteger)index;
- - (void)OCROperation:(KMOCROperation *)operation finishOCRImageAtIndex:(NSInteger)index results:(NSArray *)result;
- - (void)OCROperation:(KMOCROperation *)operation failureOCRImageAtIndex:(NSInteger)index error:(NSError *)error;
- @end
- @interface KMOCROperation : NSOperation
- @property (nonatomic, assign) id<KMOCROperationDelegate> operationDelegate;
- /* 设置的识别语言数组 */
- @property (nonatomic, strong) NSMutableArray *selectedLanguages;
- /* 需要转换的文件类型 PDF/TXT */
- @property (nonatomic, strong) NSString *fileType;
- /* 转换的文件保存路径 */
- @property (nonatomic, strong) NSString *filePath;
- /**
- 非 Google OCR ONSOperation 初始化.
- @param image 需要转换的NSImage对象
- @param imageIndex 需要转换的NSImage对象的序号
- */
- - (instancetype)initWithRecognitionImage:(NSImage *)image withImageIndex:(NSInteger)imageIndex;
- @end
|