// // KMGOCROperation.h // PDF Reader Pro Edition // // Created by 万军 on 2020/3/23. // /** Google OCR 转换文本 NSOperation */ #import @class KMGOCROperation; @protocol KMGOCROperationDelegate @optional - (void)GOCROperation:(KMGOCROperation *)operation cancelOCRImageAtIndex:(NSInteger)index; - (void)GOCROperation:(KMGOCROperation *)operation startOCRImageAtIndex:(NSInteger)index; - (void)GOCROperation:(KMGOCROperation *)operation finishOCRImageAtIndex:(NSInteger)index results:(NSArray *)results; - (void)GOCROperation:(KMGOCROperation *)operation failureOCRImageAtIndex:(NSInteger)index error:(NSError *)error; @end @interface KMGOCROperation : NSOperation @property (nonatomic, assign) id operationDelegate; /* 设置的识别语言数组 */ @property (nonatomic, retain) NSMutableArray *selectedLanguages; /** Google OCR ONSOperation 初始化. @param image 需要转换的NSImage对象 @param imageIndex 需要转换的NSImage对象的序号 */ - (instancetype)initWithRecognitionImage:(NSImage *)image withImageIndex:(NSInteger)imageIndex; @end