lib/quagga.js
/**
	         * With the help of the configured readers (Code128 or EAN) this function tries to detect a
	         * valid barcode pattern within the given area.
	         * @param {Object} box The area to search in
	         * @returns {Object} the result {codeResult, line, angle, pattern, threshold}
	         */
With the help of the configured readers (Code128 or EAN) this function tries to detect a
valid barcode pattern within the given area.
@param {Object} box The area to search in
@returns {Object} the result {codeResult, line, angle, pattern, threshold}
With the help of the configured readers ( Code128 or EAN ) this function tries to detect a valid barcode pattern within the given area . @param { Object } box The area to search in @returns { Object } the result { codeResult line angle pattern threshold }
function _decodeFromBoundingBox(box) {
	            var line,
	                lineAngle,
	                ctx = _canvas.ctx.overlay,
	                result,
	                lineLength;
	            if (false) {
	                if (config.debug.drawBoundingBox && ctx) {
	                    _image_debug2.default.drawPath(box, { x: 0, y: 1 }, ctx, { color: "blue", lineWidth: 2 });
	                }
	            }
	            line = getLine(box);
	            lineLength = getLineLength(line);
	            lineAngle = Math.atan2(line[1].y - line[0].y, line[1].x - line[0].x);
	            line = getExtendedLine(line, lineAngle, Math.floor(lineLength * 0.1));
	            if (line === null) {
	                return null;
	            }
	            result = tryDecode(line);
	            if (result === null) {
	                result = tryDecodeBruteForce(box, line, lineAngle);
	            }
	            if (result === null) {
	                return null;
	            }
	            if (false) {
	                _image_debug2.default.drawPath(line, { x: 'x', y: 'y' }, ctx, { color: 'red', lineWidth: 3 });
	            }
	            return {
	                codeResult: result.codeResult,
	                line: line,
	                angle: lineAngle,
	                pattern: result.barcodeLine.line,
	                threshold: result.barcodeLine.threshold
	            };
	        }
function _decodeFromBoundingBox ( box ) { var line , lineAngle , ctx = _canvas . ctx . overlay , result , lineLength ; if ( false ) { if ( config . debug . drawBoundingBox && ctx ) { _image_debug2 . default . drawPath ( box , { x : 0 , y : 1 } , ctx , { color : "blue" , lineWidth : 2 } ) ; } } line = getLine ( box ) ; lineLength = getLineLength ( line ) ; lineAngle = Math . atan2 ( line [ 1 ] . y - line [ 0 ] . y , line [ 1 ] . x - line [ 0 ] . x ) ; line = getExtendedLine ( line , lineAngle , Math . floor ( lineLength * 0.1 ) ) ; if ( line === null ) { return null ; } result = tryDecode ( line ) ; if ( result === null ) { result = tryDecodeBruteForce ( box , line , lineAngle ) ; } if ( result === null ) { return null ; } if ( false ) { _image_debug2 . default . drawPath ( line , { x : 'x' , y : 'y' } , ctx , { color : 'red' , lineWidth : 3 } ) ; } return { codeResult : result . codeResult , line : line , angle : lineAngle , pattern : result . barcodeLine . line , threshold : result . barcodeLine . threshold } ; }
With the help of the configured readers (Code128 or EAN) this function tries to detect a
 valid barcode pattern within the given area.
With the help of the configured readers ( Code128 or EAN ) this function tries to detect a valid barcode pattern within the given area .