YH_ScanUtility.h
1.11 KB
//
// YH_ScanUtility.h
// YH_Mall
//
// Created by Cloud on 15/4/10.
// Copyright (c) 2015年 YOHO. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#define kScreenPointScale CGRectGetWidth([[UIScreen mainScreen] bounds])/320.0f
#define kScreenPoint6Scale CGRectGetWidth([[UIScreen mainScreen] bounds])/375.0f
#define kScreenWidth ([[UIScreen mainScreen] bounds].size.width)
#define kScreenHeight ([[UIScreen mainScreen] bounds].size.height)
typedef void (^StringBlock)(NSString *info, NSError *error);
@interface YH_ScanUtility : NSObject <AVCaptureMetadataOutputObjectsDelegate>
@property (assign, nonatomic) BOOL enableFlashLight;
@property (strong, nonatomic) AVCaptureDevice *device;
@property (strong, nonatomic) AVCaptureDeviceInput *input;
@property (strong, nonatomic) AVCaptureMetadataOutput *output;
@property (strong, nonatomic) AVCaptureSession *session;
@property (strong, nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
- (void)addScanCallBackHandle:(StringBlock)scanCallBack;
- (void)resetCamera;
@end