Barcode Xpress Mobile for iOS
 All Classes Functions Variables Properties Pages
BXRuntime Class Reference
public class BXRuntime : NSObject , AVCaptureVideoDataOutputSampleBufferDelegate

This class handles capturing streaming data from a device input source and dispatching it to be processed by the BXiOS library in other other threads.

    cameraCallback

    public var cameraCallback : (( CGImage ) -> Void )?

    This callback will be invoked with each image captured by the input device.

    processingCallback

    public var processingCallback : (( CGImage ) -> Void )?

    This callback is called whenever an image is sent to background threads for processing.

    recognitionCallback

    public var recognitionCallback : (( Status , CGImage , Result ?) -> Void )?

    This callback is called with the results of any library processing calls.

    errorCallback

    public var errorCallback : (( String ) -> Void )?

    This callback is used to report errors back to the consuming application.

    paused

    public var paused : Bool

    This variable can be read to determine whether the application is currently paused and set to pause or unpause processing.

    stopRecognition()

    public func stopRecognition ()

    Stops any currently running barcode recognition and releases the current session.

    startRecognition()

    public func startRecognition () throws

    Initializes the camera state and starts a new capture session.

    captureOutput(_:didOutput:from:)

    public func captureOutput ( _ output : AVCaptureOutput , didOutput sampleBuffer : CMSampleBuffer , from connection : AVCaptureConnection )

    This function is a part of the AVCaptureVideoDataOutputSampleBufferDelegate protocol and is the entry point for images from the capture process.

    setPreviewLayer(_:)

    public func setPreviewLayer ( pv : AVCaptureVideoPreviewLayer )

    In order for preview output from the capture process to be rendered within the view in a consuming app, this member function should be called to supply the target layer.

    Parameters

    pv

    An instance of AVCaptureVideoPreviewLayer on which to render preview output.