| 1493 | } |
| 1494 | |
| 1495 | inline int full_match(const ImageBin &binary, rect_t &rc, const uint8_t *data) { |
| 1496 | // 匹配 |
| 1497 | int idx = 0; |
| 1498 | for (int x = rc.x1; x < rc.x2; ++x) { |
| 1499 | for (int y = rc.y1; y < rc.y2; ++y) { |
| 1500 | int val = GET_BIT(data[idx / 8], idx & 7); |
| 1501 | if (binary.at(y, x) != val) |
| 1502 | return 0; |
| 1503 | idx++; |
| 1504 | } |
| 1505 | } |
| 1506 | return 1; |
| 1507 | } |
| 1508 | |
| 1509 | inline int part_match(const ImageBin &binary, rect_t &rc, int max_error, const uint8_t *data) { |
| 1510 | // 匹配 |