Example #1
0
 public CameraService(BarcodeScanner renderer, RebuyCameraSource cameraSource, CameraConfigurator configurator)
 {
     this.renderer           = renderer;
     this.cameraSource       = cameraSource;
     this.cameraConfigurator = configurator;
     this.autoFocus          = new AutoFocusCallback(cameraSource.Camera);
 }
        private RebuyCameraSource createCameraSource(Context context, BarcodeScanner barcodeScanner, CameraConfigurator configurator)
        {
            var barcodeDetector = new BarcodeDetector.Builder(context).Build();
            var barcodeFactory  = new BarcodeTrackerFactory(barcodeScanner);

            barcodeDetector.SetProcessor(new MultiProcessor.Builder(barcodeFactory).Build());

            return(new RebuyCameraSource.Builder(context, barcodeDetector)
                   .SetFacing(RebuyCameraSource.CameraFacingBack)
                   .SetConfigurator(configurator)
                   .Build());
        }
        public CameraService Create(Context context, BarcodeScanner barcodeScanner, CameraConfigurator configurator)
        {
            var cameraSource = createCameraSource(context, barcodeScanner, configurator);

            return(new CameraService(barcodeScanner, cameraSource, configurator));
        }