Return the QR Code as a multidimensional array, including the border. To return the array without a border, set ``self.border`` to 0 first.
(self)
| 513 | break |
| 514 | |
| 515 | def get_matrix(self): |
| 516 | """ |
| 517 | Return the QR Code as a multidimensional array, including the border. |
| 518 | |
| 519 | To return the array without a border, set ``self.border`` to 0 first. |
| 520 | """ |
| 521 | if self.data_cache is None: |
| 522 | self.make() |
| 523 | |
| 524 | if not self.border: |
| 525 | return self.modules |
| 526 | |
| 527 | width = len(self.modules) + self.border * 2 |
| 528 | code = [[False] * width] * self.border |
| 529 | x_border = [False] * self.border |
| 530 | for module in self.modules: |
| 531 | code.append(x_border + cast(list[bool], module) + x_border) |
| 532 | code += [[False] * width] * self.border |
| 533 | |
| 534 | return code |
| 535 | |
| 536 | def active_with_neighbors(self, row: int, col: int) -> ActiveWithNeighbors: |
| 537 | context: list[bool] = [] |