| 45 | } |
| 46 | |
| 47 | Result |
| 48 | Reader::decode(const BinaryBitmap& image) const |
| 49 | { |
| 50 | auto binImg = image.getBitMatrix(); |
| 51 | if (binImg == nullptr) |
| 52 | return {}; |
| 53 | |
| 54 | //TODO: this only works with effectively 'pure' barcodes. Needs proper detector. |
| 55 | BitMatrix bits = ExtractPureBits(*binImg); |
| 56 | if (bits.empty()) |
| 57 | return {}; |
| 58 | |
| 59 | DecoderResult decRes = Decode(bits); |
| 60 | // TODO: before we can meaningfully return a ChecksumError result, we need to check the center for the presence of the finder pattern |
| 61 | if (!decRes.isValid()) |
| 62 | return {}; |
| 63 | |
| 64 | return Result(std::move(decRes), {}, BarcodeFormat::MaxiCode); |
| 65 | } |
| 66 | |
| 67 | } // namespace ZXing::MaxiCode |
nothing calls this directly
no test coverage detected