mirror of https://github.com/status-im/qzxing.git
continuation commit after the refactoring of ECBlocks
This commit is contained in:
parent
c711a42231
commit
eaeba99ac0
|
@ -62,7 +62,7 @@ std::vector<Ref<DataBlock> > DataBlock::getDataBlocks(ArrayRef<char> rawCodeword
|
||||||
ECB *ecBlock = ecBlockArray[j];
|
ECB *ecBlock = ecBlockArray[j];
|
||||||
for (int i = 0; i < ecBlock->getCount(); i++) {
|
for (int i = 0; i < ecBlock->getCount(); i++) {
|
||||||
int numDataCodewords = ecBlock->getDataCodewords();
|
int numDataCodewords = ecBlock->getDataCodewords();
|
||||||
int numBlockCodewords = ecBlocks.getECCodewords() + numDataCodewords;
|
int numBlockCodewords = ecBlocks.getECCodewordsPerBloc() + numDataCodewords;
|
||||||
ArrayRef<char> buffer(numBlockCodewords);
|
ArrayRef<char> buffer(numBlockCodewords);
|
||||||
Ref<DataBlock> blockRef(new DataBlock(numDataCodewords, buffer));
|
Ref<DataBlock> blockRef(new DataBlock(numDataCodewords, buffer));
|
||||||
result[numResultBlocks++] = blockRef;
|
result[numResultBlocks++] = blockRef;
|
||||||
|
@ -85,7 +85,7 @@ std::vector<Ref<DataBlock> > DataBlock::getDataBlocks(ArrayRef<char> rawCodeword
|
||||||
}
|
}
|
||||||
longerBlocksStartAt++;
|
longerBlocksStartAt++;
|
||||||
|
|
||||||
int shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks.getECCodewords();
|
int shorterBlocksNumDataCodewords = shorterBlocksTotalCodewords - ecBlocks.getECCodewordsPerBloc();
|
||||||
// The last elements of result may be 1 element longer;
|
// The last elements of result may be 1 element longer;
|
||||||
// first fill out as many elements as all of them have
|
// first fill out as many elements as all of them have
|
||||||
int rawCodewordsOffset = 0;
|
int rawCodewordsOffset = 0;
|
||||||
|
|
Loading…
Reference in New Issue