SBSDKBarcodeScanner

@interface SBSDKBarcodeScanner : NSObject

— BETA — This component is a BETA feature and is still under active development and improvement. We will try to keep the API as stable as possible. However, please note that we can’t guarantee that.


Wrapper class for searching and decoding multiple types of bar codes. Recognition is performed on still UIImage or SampleBufferRef, result is incapsulated in an array of SBSDKBarCodeScannerSearchResult instances.

  • Search and decode all known types of bar codes on given image.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)detectAllBarCodesOnImage:
        (nonnull UIImage *)image;

    Swift

    func detectAllBarCodes(on image: UIImage) -> [SBSDKBarcodeScannerResult]

    Parameters

    image

    The image where search is to be done.

    Return Value

    Operation result.

  • Search and decode specified types of bar codes on given image.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)
        detectBarCodesOnImage:(nonnull UIImage *)image
                      ofTypes:(nonnull NSArray<NSNumber *> *)barCodeTypes;

    Swift

    func detectBarCodes(on image: UIImage, ofTypes barCodeTypes: [NSNumber]) -> [SBSDKBarcodeScannerResult]

    Parameters

    image

    The image where search is to be done.

    barCodeTypes

    Specified bar code types.

    Return Value

    Operation result.

  • Search and decode all known types of bar codes from sample buffer reference.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)
        detectAllBarCodesOnSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                            orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func detectAllBarCodes(on sampleBuffer: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> [SBSDKBarcodeScannerResult]

    Parameters

    sampleBufferRef

    The sample buffer reference.

    videoOrientation

    Video frame orientation.

    Return Value

    Operation result.

  • Search and decode specified types of bar codes from sample buffer reference.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)
        detectBarCodesOnSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                             ofTypes:(nonnull NSArray<NSNumber *> *)barCodeTypes
                         orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func detectBarCodes(on sampleBuffer: CMSampleBuffer, ofTypes barCodeTypes: [NSNumber], orientation videoOrientation: AVCaptureVideoOrientation) -> [SBSDKBarcodeScannerResult]

    Parameters

    sampleBufferRef

    The sample buffer reference.

    barCodeTypes

    Specified bar code types.

    videoOrientation

    Video frame orientation.

    Return Value

    Operation result.

  • Search and decode all known types of bar codes from sample buffer reference.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)
        detectAllBarCodesOnSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                            orientation:(AVCaptureVideoOrientation)videoOrientation
                           searchInRect:(CGRect)searchInRect;

    Swift

    func detectAllBarCodes(on sampleBuffer: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation, searchIn searchInRect: CGRect) -> [SBSDKBarcodeScannerResult]

    Parameters

    sampleBufferRef

    The sample buffer reference.

    videoOrientation

    Video frame orientation.

    searchInRect

    Rectangle in frame containing bar codes

    Return Value

    Operation result.

  • Search and decode specified types of bar codes from sample buffer reference.

    Declaration

    Objective-C

    - (nonnull NSArray<SBSDKBarcodeScannerResult *> *)
        detectBarCodesOnSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                             ofTypes:(nonnull NSArray<NSNumber *> *)barCodeTypes
                         orientation:(AVCaptureVideoOrientation)videoOrientation
                        searchInRect:(CGRect)searchInRect;

    Swift

    func detectBarCodes(on sampleBuffer: CMSampleBuffer, ofTypes barCodeTypes: [NSNumber], orientation videoOrientation: AVCaptureVideoOrientation, searchIn searchInRect: CGRect) -> [SBSDKBarcodeScannerResult]

    Parameters

    sampleBufferRef

    The sample buffer reference.

    barCodeTypes

    Specified bar code types.

    videoOrientation

    Video frame orientation.

    searchInRect

    Rectangle in frame containing bar codes

    Return Value

    Operation result.