Spaces:
Running
Running
Download BeadQR/miniprogram/utils/qrcore/finder-pattern.js from Ethscriptions/cut: direct link, hf CLI and curl.
- Browser
- Download file 599 Bytes
-
https://huggingface.co/spaces/Ethscriptions/cut/resolve/main/BeadQR/miniprogram/utils/qrcore/finder-pattern.js
- Command line
-
hf download hf://spaces/Ethscriptions/cut/BeadQR/miniprogram/utils/qrcore/finder-pattern.js
-
curl -L -o finder-pattern.js https://huggingface.co/spaces/Ethscriptions/cut/resolve/main/BeadQR/miniprogram/utils/qrcore/finder-pattern.js
599 Bytes
| const getSymbolSize = require('./utils').getSymbolSize | |
| const FINDER_PATTERN_SIZE = 7 | |
| /** | |
| * Returns an array containing the positions of each finder pattern. | |
| * Each array's element represent the top-left point of the pattern as (x, y) coordinates | |
| * | |
| * @param {Number} version QR Code version | |
| * @return {Array} Array of coordinates | |
| */ | |
| exports.getPositions = function getPositions (version) { | |
| const size = getSymbolSize(version) | |
| return [ | |
| // top-left | |
| [0, 0], | |
| // top-right | |
| [size - FINDER_PATTERN_SIZE, 0], | |
| // bottom-left | |
| [0, size - FINDER_PATTERN_SIZE] | |
| ] | |
| } | |