()
| 536 | // Each position is in the range [0,177), and are used on both the x and y axes. |
| 537 | // This could be implemented as lookup table of 40 variable-length lists of integers. |
| 538 | private getAlignmentPatternPositions(): Array<int> { |
| 539 | if (this.version == 1) return []; |
| 540 | else { |
| 541 | const numAlign: int = Math.floor(this.version / 7) + 2; |
| 542 | const step: int = |
| 543 | this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2; |
| 544 | let result: Array<int> = [6]; |
| 545 | for (let pos = this.size - 7; result.length < numAlign; pos -= step) result.splice(1, 0, pos); |
| 546 | return result; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | // Returns the number of data bits that can be stored in a QR Code of the given version number, after |
| 551 | // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8. |
no outgoing calls
no test coverage detected