ZXCapture.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2012 ZXing authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <AVFoundation/AVFoundation.h>
  17. @protocol ZXCaptureDelegate, ZXReader;
  18. @class ZXDecodeHints;
  19. @interface ZXCapture : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate, CAAction>
  20. @property (nonatomic, assign) int camera;
  21. @property (nonatomic, strong) AVCaptureDevice *captureDevice;
  22. @property (nonatomic, copy) NSString *captureToFilename;
  23. @property (nonatomic, weak) id<ZXCaptureDelegate> delegate;
  24. @property (nonatomic, assign) AVCaptureFocusMode focusMode;
  25. @property (nonatomic, strong) ZXDecodeHints *hints;
  26. @property (nonatomic, assign) CGImageRef lastScannedImage;
  27. @property (nonatomic, assign) BOOL invert;
  28. @property (nonatomic, strong, readonly) CALayer *layer;
  29. @property (nonatomic, assign) BOOL mirror;
  30. @property (nonatomic, strong, readonly) AVCaptureVideoDataOutput *output;
  31. @property (nonatomic, strong) id<ZXReader> reader;
  32. @property (nonatomic, assign) CGFloat rotation;
  33. @property (nonatomic, assign, readonly) BOOL running;
  34. @property (nonatomic, assign) CGRect scanRect;
  35. @property (nonatomic, copy) NSString *sessionPreset;
  36. @property (nonatomic, assign) BOOL torch;
  37. @property (nonatomic, assign) CGAffineTransform transform;
  38. @property (nonatomic, assign) BOOL hardStop;
  39. @property (nonatomic, assign) BOOL autoDecodeCharset;
  40. - (int)back;
  41. - (int)front;
  42. - (BOOL)hasBack;
  43. - (BOOL)hasFront;
  44. - (BOOL)hasTorch;
  45. - (CALayer *)binary;
  46. - (void)setBinary:(BOOL)on_off;
  47. - (CALayer *)luminance;
  48. - (void)setLuminance:(BOOL)on_off;
  49. - (void)hard_stop;
  50. - (void)order_skip;
  51. - (void)start;
  52. - (void)stop;
  53. @end