mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
C++: fix dormat BitArray quiet zone checking bug that was causing rampant false positives
also make zxing test app decode call a little cleaner. git-svn-id: https://zxing.googlecode.com/svn/trunk@1566 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
d26cfc7fd1
commit
84b6b3d57b
|
@ -90,9 +90,9 @@ bool BitArray::isRange(size_t start, size_t end, bool value) {
|
|||
size_t lastWord = end >> logBits_;
|
||||
for (size_t i = firstWord; i <= lastWord; i++) {
|
||||
size_t firstBit = i > firstWord ? 0 : start & bitsMask_;
|
||||
size_t lastBit = i < lastWord ? logBits_ : end & bitsMask_;
|
||||
size_t lastBit = i < lastWord ? bitsPerWord_ - 1: end & bitsMask_;
|
||||
unsigned int mask;
|
||||
if (firstBit == 0 && lastBit == logBits_) {
|
||||
if (firstBit == 0 && lastBit == bitsPerWord_ - 1) {
|
||||
mask = numeric_limits<unsigned int>::max();
|
||||
} else {
|
||||
mask = 0;
|
||||
|
|
|
@ -54,7 +54,7 @@ static const int MAX_EXPECTED = 1024;
|
|||
|
||||
Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints) {
|
||||
Ref<Reader> reader(new MultiFormatReader);
|
||||
return Ref<Result> (new Result(*reader->decode(image, hints)));
|
||||
return reader->decode(image, hints);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue