BRCameraViewController
Objective-C
@interface BRCameraViewController : UIViewControllerSwift
class BRCameraViewController : UIViewControllerBase camera controller class. Subclass to build your own UI on top of the fullscreen camera view
- 
                  
                  Set this property of your subclass in order to scan only a certain region of the returned image from the camera. The values of the CGRectare all given from 0.0 to 1.0, indicating a fraction of the current view’s dimensions. Default is (0.0, 0.0, 1.0, 1.0) which scans the whole screen. It is recommended to set the scanning region equal to the area of the screen that is not covered by other UI elements, so that the frames being scanned are consistent with what the user appears to be snapping photos ofDeclarationObjective-C @property (nonatomic) CGRect scanningRegion;Swift var scanningRegion: CGRect { get set }
- 
                  
                  Indicates whether the torch is on DeclarationObjective-C @property (nonatomic, readonly) BOOL isTorchOn;Swift var isTorchOn: Bool { get }
- 
                  
                  Indicates whether scanning is paused DeclarationObjective-C @property (nonatomic, readonly) BOOL isPaused;Swift var isPaused: Bool { get }
- 
                  
                  Indicates whether edge detection is running DeclarationObjective-C @property (nonatomic, readonly) BOOL isEdgeDetectionRunning;Swift var isEdgeDetectionRunning: Bool { get }
- 
                  
                  Set this property to YESto prevent the parent view controller from starting and stopping theAVCaptureSessionbased on view lifecycle events. You will be responsible for manually calling-[BRCameraViewController resumeScanning]and-[BRCameraViewController pauseScanning]to manage the capture sessionDeclarationObjective-C @property (nonatomic) BOOL manualCaptureSession;Swift var manualCaptureSession: Bool { get set }
- 
                  
                  Unique ID of the current receipt DeclarationObjective-C @property (nonatomic, strong, readonly) NSString *blinkReceiptId;Swift var blinkReceiptId: String! { get }
- 
                  
                  Call this method to notify the camera controller that the user has attempted to snap a picture. DeclarationObjective-C - (void)userSnappedPhotoOnReady:(void (^)(UIImage *, BRFrameAttributes *))readyBlock;Swift func userSnappedPhoto(onReady readyBlock: ((UIImage?, BRFrameAttributes?) -> Void)!)ParametersreadyBlockThis block will be invoked once the camera controller has obtained a suitable frame to display to the user as a preview. Be careful of retain cycles in this block! - UIImage *frameImg- The frame to display as a preview
- BRFrameAttributes *frameAttributes- Various attributes about the current frame (blurriness, screen detection, etc see- BRFrameAttributes)
 
- 
                  
                  Call this method to notify the camera controller that the user has indicated they have finished scanning. This will perform some cleanup and then call -[BRScanResultsDelegate didFinishScanning:withScanResults:]on your scanning delegate. It is recommended that prior to or simultaneous with calling this method, you display some sort of loader until the callback is receivedDeclarationObjective-C - (void)userFinishedScan;Swift func userFinishedScan()
- 
                  
                  Call this method to invoke the same processing that happens at the end of the scan session. DeclarationObjective-C - (void)getPreliminaryResults:(BOOL (^)(BRScanResults *))callback;Swift func getPreliminaryResults(_ callback: ((BRScanResults?) -> Bool)!)ParameterscallbackThis callback is invoked as soon as it is possible to return preliminary results The client should return YESorNOdepending on whether the results are satisfactory to end the scanning session- BRScanResults *scanResults- The scan results up to this point
 
- 
                  
                  Call this method to notify the camera controller that the user has cancelled scanning. This will perform some cleanup and then call -[BRScanResultsDelegate didCancelScanning:]on your scanning delegateDeclarationObjective-C - (void)userCancelledScan;Swift func userCancelledScan()
- 
                  
                  Call this method to notify the camera controller that the user has confirmed a particular frame. This will mark the frame internally as a user frame which allows it to be saved remotely after the scan session, and also saved to disk if BRScanOptions.storeUserFramesis setDeclarationObjective-C - (void)userConfirmedFrame:(UIImage *)frameImg;Swift func userConfirmedFrame(_ frameImg: UIImage!)ParametersframeImgThe image the user has confirmed. Should be the same as the image passed to the readyBlockofuserSnappedPhotoOnReady:above
- 
                  
                  Toggle the status of the torch DeclarationObjective-C - (void)setTorch:(BOOL)torchOn;Swift func setTorch(_ torchOn: Bool)ParameterstorchOnWhether to turn the torch on or off 
- 
                  
                  Pause frame capture and scanning. Any frames that are already in the processing pipeline will continue to be scanned DeclarationObjective-C - (void)pauseScanning;Swift func pauseScanning()
- 
                  
                  Resume frame capture and scanning. DeclarationObjective-C - (void)resumeScanning;Swift func resumeScanning()
- 
                  
                  After receiving the didDetectWrongRetailer:callback, call this method to indicate that scanning should use the new retailer going forwardDeclarationObjective-C - (void)confirmCorrectRetailer:(WFRetailerId)retailerId;Swift func confirmCorrectRetailer(_ retailerId: WFRetailerId)ParametersretailerIdThe new retailer to use 
- 
                  
                  Override this method to be notified when a determination is made that the user’s scanning distance is either too far or is acceptable (OK) DeclarationObjective-C - (void)userDistanceChanged:(BRDistanceStatus)newStatus;Swift func userDistanceChanged(_ newStatus: BRDistanceStatus)ParametersnewStatusThe newly detected distance status 
- 
                  
                  Override this method to receive statistics on each frame that is processed DeclarationObjective-C - (void)didGetFrameStats:(NSDictionary *)frameStats;Swift func didGetFrameStats(_ frameStats: [AnyHashable : Any]!)ParametersframeStatsA dictionary with the following keys: contentWidth- a float indicating what percent (0-100) of the image the receipt appears inedgesRect- aCGRectwrapped inNSNumberindicating the location of edges found in percentages of image sizeisReceipt- aBOOLwrapped inNSNumberindicating whether the current frame is believed to contain a receipt
- 
                  
                  Override this method to be notified when the SDK detects that the receipt being scanned is from a different retailer than was specified DeclarationObjective-C - (void)didDetectWrongRetailer:(WFRetailerId)correctRetailer withConfidence:(BRWrongRetailerConfidence)confidence;Swift func didDetectWrongRetailer(_ correctRetailer: WFRetailerId, with confidence: BRWrongRetailerConfidence)ParameterscorrectRetailerThe retailer the SDK believes the receipt to be from confidenceWhether the new retailer is based only on a store phone match, or if we have also successfully parsed products using the new retailer 
- 
                  
                  Override this method to receive frame by frame scan results (note: metadata only, does not include product results). Results are cumulative from all frames previously scanned. DeclarationObjective-C - (void)didGetFrameResults:(BRScanResults *)frameResults;Swift func didGetFrameResults(_ frameResults: BRScanResults!)ParametersframeResultsThe scan results at this point in time 
- 
                  
                  Override this method to receive frame by frame estimations about whether the user is scanning a valid receipt (estimation is cumulative based on all previous frames scanned to that point) DeclarationObjective-C - (void)receiptValidityEstimate:(BOOL)validReceipt;Swift func receiptValidityEstimate(_ validReceipt: Bool)ParametersvalidReceiptWhether the SDK believes that it is scanning a valid receipt at this point 
- 
                  
                  When BRScanOptions.manualTorchControlis enabled, this callback will indicate to the client VC if the SDK detects a new lighting condition. Note: Lighting is assumed to start inBRLightingConditionTerrible, so there will never be a callback with that passed as a parameter, rather we only upgrade the lighting toBRLightingConditionLoworBRLightingConditionGoodDeclarationObjective-C - (void)didGetLightingCondition:(BRLightingCondition)lightingCondition;Swift func didGet(_ lightingCondition: BRLightingCondition)ParameterslightingConditionThe new lighting condition 
- 
                  
                  Override this method to receive a callback when one or both horizontal edges is detected on the current frame. Note: This does not guarantee that this frame will be scanned. To determine if a top/bottom edge was seen on any of the scanned frames, consult BRScanResults.foundTopEdgeandBRScanResults.foundBottomEdgeDeclarationObjective-C - (void)didGetHorizontalEdges:(BOOL)topEdge andBottomEdge:(BOOL)bottomEdge;Swift func didGetHorizontalEdges(_ topEdge: Bool, andBottomEdge bottomEdge: Bool)ParameterstopEdgeWhether a top edge was detected on this frame bottomEdgeWhether a bottom edge was detected on this frame 
 
       View on GitHub
            View on GitHub
          