| 444 | } |
| 445 | |
| 446 | DecoderResult Decode(const BitMatrix& bits) |
| 447 | { |
| 448 | auto res = DoDecode(bits); |
| 449 | if (res.isValid()) |
| 450 | return res; |
| 451 | |
| 452 | //TODO: |
| 453 | // * unify bit mirroring helper code with QRReader? |
| 454 | // * rectangular symbols with the a size of 8 x Y are not supported a.t.m. |
| 455 | if (auto mirroredRes = DoDecode(FlippedL(bits)); mirroredRes.isValid()) { |
| 456 | mirroredRes.setIsMirrored(true); |
| 457 | return mirroredRes; |
| 458 | } |
| 459 | |
| 460 | return res; |
| 461 | } |
| 462 | |
| 463 | } // namespace ZXing::DataMatrix |