Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | 1x 1x 1x 1x 1x 1x 1x | /**
* MultiScannerElement Constants
*
* Static variables used by the MultiScannerElement
*/
/**
* MDN MediaTrackConstraints
*
* https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints
*
* Media Track Constraints.
*/
const MEDIA_TRACK_CONSTRAINTS = [
'device', // Actually is deviceId but we also allow setting by label
// 'groupId' // Unsupported.
];
/**
* Image Track Constraints.
*/
const IMAGE_TRACK_CONSTRAINTS = {
whiteBalanceMode: 'String',
exposureMode: 'String',
focusMode: 'String',
pointsOfInterest: 'Object',
exposureCompensation: 'ConstrainDouble',
colorTemperature: 'ConstrainDouble',
iso: 'ConstrainDouble',
brightness: 'ConstrainDouble',
contrast: 'ConstrainDouble',
saturation: 'ConstrainDouble',
sharpness: 'ConstrainDouble',
focusDistance: 'ConstrainDouble',
zoom: 'ConstrainDouble',
torch: 'Boolean',
};
/**
* Video Track Constraints.
*/
const VIDEO_TRACK_CONSTRAINTS = {
aspectRatio: 'ConstrainDouble',
facingMode: 'ConstrainDOMString',
frameRate: 'ConstrainDouble',
height: 'ConstrainULong',
width: 'ConstrainULong',
resizeMode: 'ConstrainDOMString',
};
/**
* Barcode Scanner Attributes.
*/
const BARCODE_SCANNER_ATTRIBUTES = [
'state',
'formats',
'web-worker',
'line-color',
'line-width',
'line-join',
'line-shadow-blur',
'line-shadow-color',
];
/**
* Supported zbar.wasm formats of scannable barcodes.
*/
const SUPPORTED_FORMATS_MAP = {
ZBAR_EAN2: 'ean_2',
ZBAR_EAN5: 'ean_5',
ZBAR_EAN8: 'ean_8',
ZBAR_UPCE: 'upc_e',
ZBAR_ISBN10: 'isbn_10',
ZBAR_UPCA: 'upc_a',
ZBAR_EAN13: 'ean_13',
ZBAR_ISBN13: 'isbn_13',
ZBAR_COMPOSITE: 'composite',
ZBAR_I25: 'itf',
ZBAR_DATABAR: 'databar',
ZBAR_DATABAR_EXP: 'databar_exp',
ZBAR_CODABAR: 'codabar',
ZBAR_CODE39: 'code_39',
ZBAR_CODE93: 'code_93',
ZBAR_CODE128: 'code_128',
ZBAR_PDF417: 'pdf417',
ZBAR_QRCODE: 'qr_code',
ZBAR_SQCODE: 'sq_code',
};
// Hex Color Regex.
const HEX_COLOR_REGEX = /^#([0-9a-f]{3}){1,2}$/i;
// Stroke Line Joins
const STROKE_LINE_JOINS = ['arcs', 'bevel', 'miter', 'miter-clip', 'round'];
export {
MEDIA_TRACK_CONSTRAINTS,
IMAGE_TRACK_CONSTRAINTS,
VIDEO_TRACK_CONSTRAINTS,
BARCODE_SCANNER_ATTRIBUTES,
SUPPORTED_FORMATS_MAP,
HEX_COLOR_REGEX,
STROKE_LINE_JOINS,
};
|