int32_t CBC_DetectionResult::adjustRowNumbersFromLRI() { if (m_detectionResultColumns[0] == NULL) { return 0; } int32_t unadjustedCount = 0; CFX_PtrArray* codewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns.GetAt(0)) ->getCodewords(); for (int32_t codewordsRow = 0; codewordsRow < codewords->GetSize(); codewordsRow++) { if (codewords->GetAt(codewordsRow) == NULL) { continue; } int32_t rowIndicatorRowNumber = ((CBC_Codeword*)codewords->GetAt(codewordsRow))->getRowNumber(); int32_t invalidRowCounts = 0; for (int32_t barcodeColumn = 1; barcodeColumn < m_barcodeColumnCount + 1 && invalidRowCounts < ADJUST_ROW_NUMBER_SKIP; barcodeColumn++) { CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*) m_detectionResultColumns[barcodeColumn]) ->getCodewords() ->GetAt(codewordsRow); if (codeword) { invalidRowCounts = adjustRowNumberIfValid(rowIndicatorRowNumber, invalidRowCounts, codeword); if (!codeword->hasValidRowNumber()) { unadjustedCount++; } } } } return unadjustedCount; }
int32_t CBC_DetectionResult::adjustRowNumbersFromBothRI() { if (m_detectionResultColumns[0] == NULL || m_detectionResultColumns[m_barcodeColumnCount + 1] == NULL) { return 0; } CFX_PtrArray* LRIcodewords = ((CBC_DetectionResultColumn*)m_detectionResultColumns[0])->getCodewords(); CFX_PtrArray* RRIcodewords = ((CBC_DetectionResultColumn*) m_detectionResultColumns[m_barcodeColumnCount + 1]) ->getCodewords(); for (int32_t codewordsRow = 0; codewordsRow < LRIcodewords->GetSize(); codewordsRow++) { if (LRIcodewords->GetAt(codewordsRow) && RRIcodewords->GetAt(codewordsRow) && ((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber() == ((CBC_Codeword*)RRIcodewords->GetAt(codewordsRow)) ->getRowNumber()) { for (int32_t barcodeColumn = 1; barcodeColumn <= m_barcodeColumnCount; barcodeColumn++) { CBC_Codeword* codeword = (CBC_Codeword*)((CBC_DetectionResultColumn*) m_detectionResultColumns[barcodeColumn]) ->getCodewords() ->GetAt(codewordsRow); if (codeword == NULL) { continue; } codeword->setRowNumber( ((CBC_Codeword*)LRIcodewords->GetAt(codewordsRow))->getRowNumber()); if (!codeword->hasValidRowNumber()) { ((CBC_DetectionResultColumn*)m_detectionResultColumns[barcodeColumn]) ->getCodewords() ->SetAt(codewordsRow, NULL); } } } } return 0; }