OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2013 ZXing authors | 8 * Copyright 2013 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 24 matching lines...) Expand all Loading... |
35 CBC_BoundingBox* boundingBox, | 35 CBC_BoundingBox* boundingBox, |
36 FX_BOOL isLeft) | 36 FX_BOOL isLeft) |
37 : CBC_DetectionResultColumn(boundingBox) { | 37 : CBC_DetectionResultColumn(boundingBox) { |
38 m_isLeft = isLeft; | 38 m_isLeft = isLeft; |
39 } | 39 } |
40 CBC_DetectionResultRowIndicatorColumn:: | 40 CBC_DetectionResultRowIndicatorColumn:: |
41 ~CBC_DetectionResultRowIndicatorColumn() {} | 41 ~CBC_DetectionResultRowIndicatorColumn() {} |
42 void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() { | 42 void CBC_DetectionResultRowIndicatorColumn::setRowNumbers() { |
43 for (int32_t i = 0; i < m_codewords->GetSize(); i++) { | 43 for (int32_t i = 0; i < m_codewords->GetSize(); i++) { |
44 CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i); | 44 CBC_Codeword* codeword = (CBC_Codeword*)m_codewords->GetAt(i); |
45 if (codeword != NULL) { | 45 if (codeword) { |
46 codeword->setRowNumberAsRowIndicatorColumn(); | 46 codeword->setRowNumberAsRowIndicatorColumn(); |
47 } | 47 } |
48 } | 48 } |
49 } | 49 } |
50 int32_t | 50 int32_t |
51 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers( | 51 CBC_DetectionResultRowIndicatorColumn::adjustCompleteIndicatorColumnRowNumbers( |
52 CBC_BarcodeMetadata barcodeMetadata) { | 52 CBC_BarcodeMetadata barcodeMetadata) { |
53 CFX_PtrArray* codewords = getCodewords(); | 53 CFX_PtrArray* codewords = getCodewords(); |
54 setRowNumbers(); | 54 setRowNumbers(); |
55 removeIncorrectCodewords(codewords, barcodeMetadata); | 55 removeIncorrectCodewords(codewords, barcodeMetadata); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata(); | 112 CBC_BarcodeMetadata* barcodeMetadata = getBarcodeMetadata(); |
113 if (barcodeMetadata == NULL) { | 113 if (barcodeMetadata == NULL) { |
114 e = BCExceptionCannotMetadata; | 114 e = BCExceptionCannotMetadata; |
115 return NULL; | 115 return NULL; |
116 } | 116 } |
117 adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata); | 117 adjustIncompleteIndicatorColumnRowNumbers(*barcodeMetadata); |
118 CFX_Int32Array* result = new CFX_Int32Array; | 118 CFX_Int32Array* result = new CFX_Int32Array; |
119 result->SetSize(barcodeMetadata->getRowCount()); | 119 result->SetSize(barcodeMetadata->getRowCount()); |
120 for (int32_t i = 0; i < getCodewords()->GetSize(); i++) { | 120 for (int32_t i = 0; i < getCodewords()->GetSize(); i++) { |
121 CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i); | 121 CBC_Codeword* codeword = (CBC_Codeword*)getCodewords()->GetAt(i); |
122 if (codeword != NULL) { | 122 if (codeword) { |
123 result->SetAt(codeword->getRowNumber(), | 123 result->SetAt(codeword->getRowNumber(), |
124 result->GetAt(codeword->getRowNumber()) + 1); | 124 result->GetAt(codeword->getRowNumber()) + 1); |
125 } | 125 } |
126 } | 126 } |
127 return result; | 127 return result; |
128 } | 128 } |
129 int32_t CBC_DetectionResultRowIndicatorColumn:: | 129 int32_t CBC_DetectionResultRowIndicatorColumn:: |
130 adjustIncompleteIndicatorColumnRowNumbers( | 130 adjustIncompleteIndicatorColumnRowNumbers( |
131 CBC_BarcodeMetadata barcodeMetadata) { | 131 CBC_BarcodeMetadata barcodeMetadata) { |
132 CBC_BoundingBox* boundingBox = getBoundingBox(); | 132 CBC_BoundingBox* boundingBox = getBoundingBox(); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 break; | 259 break; |
260 case 2: | 260 case 2: |
261 if (rowIndicatorValue + 1 != barcodeMetadata.getColumnCount()) { | 261 if (rowIndicatorValue + 1 != barcodeMetadata.getColumnCount()) { |
262 codewords->SetAt(codewordRow, NULL); | 262 codewords->SetAt(codewordRow, NULL); |
263 } | 263 } |
264 break; | 264 break; |
265 } | 265 } |
266 } | 266 } |
267 } | 267 } |
OLD | NEW |