1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // KMGOCROperation.h
- // PDF Reader Pro Edition
- //
- // Created by 万军 on 2020/3/23.
- //
- /**
- Google OCR 转换文本 NSOperation
- */
- #import <Foundation/Foundation.h>
- @class KMGOCROperation;
- @protocol KMGOCROperationDelegate <NSObject>
- @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<KMGOCROperationDelegate> operationDelegate;
- /* 设置的识别语言数组 */
- @property (nonatomic, retain) NSMutableArray *selectedLanguages;
- /**
- Google OCR ONSOperation 初始化.
- @param image 需要转换的NSImage对象
- @param imageIndex 需要转换的NSImage对象的序号
- */
- - (instancetype)initWithRecognitionImage:(NSImage *)image withImageIndex:(NSInteger)imageIndex;
- @end
|