AztecReader.cpp Example File
appdemos/qtws/QZXing/zxing/zxing/aztec/AztecReader.cpp
#include <zxing/aztec/AztecReader.h>
#include <zxing/aztec/detector/Detector.h>
#include <zxing/common/DecoderResult.h>
#include <iostream>
using zxing::Ref;
using zxing::ArrayRef;
using zxing::Result;
using zxing::aztec::AztecReader;
using zxing::BinaryBitmap;
using zxing::DecodeHints;
AztecReader::AztecReader() : decoder_() {
}
Ref<Result> AztecReader::decode(Ref<zxing::BinaryBitmap> image) {
Detector detector(image->getBlackMatrix());
Ref<AztecDetectorResult> detectorResult(detector.detect());
ArrayRef< Ref<ResultPoint> > points(detectorResult->getPoints());
Ref<DecoderResult> decoderResult(decoder_.decode(detectorResult));
Ref<Result> result(new Result(decoderResult->getText(),
decoderResult->getRawBytes(),
points,
BarcodeFormat::AZTEC));
return result;
}
Ref<Result> AztecReader::decode(Ref<BinaryBitmap> image, DecodeHints) {
return this->decode(image);
}
AztecReader::~AztecReader() {
}
zxing::aztec::Decoder& AztecReader::getDecoder() {
return decoder_;
}